I am trying to pulse 8 pins simultaneously and as quickly as possible. I quickly realized DigitalWriteFast() would not be adequate and port manipulation might be the only solution. I found this tutorial very helpful but could not find anything more relevant in the forum.
I was able to write directly to PORTD and get desirable results. However, I noticed that some pins are not getting pulsed, specifically pins 8, 14, 20 and 21.
Here's the view on the scope. Showing desirable results (yellow, purple) and no pulse (blue):
Here's my code:
I am using a Teensey 3.6. I have verified that all of these pins (2,5,6,7,8,14,20,21) work when I use digitalWrite().
Has anybody with more technical know-how have an idea on how to resolve this?
Greatly Appreciated,
Jacob
I was able to write directly to PORTD and get desirable results. However, I noticed that some pins are not getting pulsed, specifically pins 8, 14, 20 and 21.
Here's the view on the scope. Showing desirable results (yellow, purple) and no pulse (blue):
Here's my code:
Code:
void setup() {
DDRD = 0xFF;
GPIOD_PDDR = 0xFF;
}
void loop() {
GPIOD_PDOR = 0xFF;
//delay(1000); // still no output on some pins
GPIOD_PDOR = 0x00;
//delay(1000); // still no output on some pins
//*(volatile uint8_t *)(&GPIOD_PDOR) = 0xFF; // Tried this instead, didn't work
//*(volatile uint8_t *)(&GPIOD_PDOR) = 0x00;
}
I am using a Teensey 3.6. I have verified that all of these pins (2,5,6,7,8,14,20,21) work when I use digitalWrite().
Has anybody with more technical know-how have an idea on how to resolve this?
Greatly Appreciated,
Jacob