digitalWrite not working

mkeyno
Posts: 6
Joined: Thu Jan 27, 2022 1:34 am

digitalWrite not working

Postby mkeyno » Thu Apr 07, 2022 6:41 am

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

rpiloverbd
Posts: 101
Joined: Tue Mar 22, 2022 5:23 am

Re: digitalWrite not working

Postby rpiloverbd » Thu Apr 07, 2022 1:40 pm

Hi, I think you may get more responses if you post the circuit diagram.

mkeyno
Posts: 6
Joined: Thu Jan 27, 2022 1:34 am

Re: digitalWrite not working

Postby mkeyno » Thu Apr 07, 2022 4:56 pm

I only use dev board , but I think pins 16&17 dedicated for PSRAM and I mess up with them

Who is online

Users browsing this forum: No registered users and 80 guests