Page 1 of 1

digitalWrite not working

Posted: Thu Apr 07, 2022 6:41 am
by mkeyno
I'm doing some pulse generator with a simple timer to drive the stepper driver (DRV8225), In the timer interrupt callback, the designated pin is toggled, but when I run the code the pin state has not changed, I put the LED pin, inside the interrupts and its work fine while the driver pin dose not change, following is the timer call back
```cpp

void ARDUINO_ISR_ATTR timerCBS0(){
portENTER_CRITICAL_ISR(&locks0);
digitalWrite(GPIO_NUM_17, !digitalRead(GPIO_NUM_17)); //no change
digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); // has changed
portEXIT_CRITICAL_ISR(&locks0);
}
```
any tips really appreciated

Re: digitalWrite not working

Posted: Thu Apr 07, 2022 1:40 pm
by rpiloverbd
Hi, I think you may get more responses if you post the circuit diagram.

Re: digitalWrite not working

Posted: Thu Apr 07, 2022 4:56 pm
by mkeyno
I only use dev board , but I think pins 16&17 dedicated for PSRAM and I mess up with them