Axelman8
Member
Hey there,
I have a working solution with an Arduino Due, where I am writing directly to the GPIO ports instead of using digitalWrite(); .
For basic usage, you would use REG_PIO?_SODR to set output lines high and REG_PIO?_CODR to set them low.
For example
REG_PIOC_SODR = 0x00000002 would set bit 1 (numbered from zero) on PORTC (this is Due digital pin 33) high. All other pins on PORTC remain unchanged.
REG_POIC_CODR = 0x00000002 would set bit 1 on PORTC low. Again all other pins would be unchanged.
With this code, my program is running much faster.
The question is:
Will this pin I/O option work for the Teensy 4.1 or is there a better solution for the teensy to LOW / HIGH pins?
Here is an example for the scema that im using with the Due:
Thank you in advance
Cheers
I have a working solution with an Arduino Due, where I am writing directly to the GPIO ports instead of using digitalWrite(); .
For basic usage, you would use REG_PIO?_SODR to set output lines high and REG_PIO?_CODR to set them low.
For example
REG_PIOC_SODR = 0x00000002 would set bit 1 (numbered from zero) on PORTC (this is Due digital pin 33) high. All other pins on PORTC remain unchanged.
REG_POIC_CODR = 0x00000002 would set bit 1 on PORTC low. Again all other pins would be unchanged.
With this code, my program is running much faster.
The question is:
Will this pin I/O option work for the Teensy 4.1 or is there a better solution for the teensy to LOW / HIGH pins?
Here is an example for the scema that im using with the Due:
Thank you in advance
Cheers