Pin IRQ Debounce Messing with REPL

The official pyboard running MicroPython.
This is the reference design and main target board for MicroPython.
You can buy one at the store.
Target audience: Users with a pyboard.
Posts: 12
Joined: Wed Mar 25, 2020 8:53 pm

Re: Pin IRQ Debounce Messing with REPL

Post by Duramaximizer » Wed Apr 01, 2020 1:33 pm

Finally got it working!

Made a new debounce routine using a timer, thank you for the suggestion jimmo!

I needed to wait for the user to press and release the button as I was getting bounce after the release also. After the debounce is handled it calls my function to put the board to sleep, first enabling the wake up on rising edge of PA0 pin using:

Code: Select all

stm.mem32[stm.PWR + stm.PWR_CSR] |= 1 << 8
The button is then used to wake up from deep sleep. Some delays in my main program prevent any bounce on the wake up press from putting the board back to sleep since the timer interrupt is not initialized until all initialization are complete and the main routine is running.

Thanks for the help everyone!

Post Reply