digitalwritefast v digital write on teensy 3.2 , 3.6

Status
Not open for further replies.

drjohnsmith

Well-known member
Looking at updating / tidying up some code I have.

Only use the teensy 3.2 or 3.6 now days.

whats the advantage of using the digitalWrite against gigitalWriteFast ?

Looks to me as if I should just drop digitalWrite and use digtiaWriteFast,

or are there some places where digitalWriteFast has problems ?

should I just map digitalWrite to digitalWriteFast ?

Thanks
 
Hi,

My understanding is the digitalWriteFast works when the pin numbers is it using are known at compile time. If you're writing to pins represented by a variable, use digitalWrite().

best,
Michael
 
My understanding is the digitalWriteFast works when the pin numbers is it using are known at compile time.
digitalWriteFast works either way and has less overhead.
If you're writing to pins represented by a variable, use digitalWrite().
No, digitalWriteFast is better.

digitalWriteFast behaves the same as digitalWrite if the pin is configured as output. However, the Arduino guys in their infinite wisdom have chosen to overload digitalWrite so that it will reconfigure the internal pin pullups if the pin is configured for input mode (adding unnecessary overhead to each call). Teensy is compatible with that insanity.
 
Status
Not open for further replies.
Back
Top