Re: Timing issue
Hi All, and thanks for your answers!!!

Originally Posted by
mackrackit
Sorry, I missed the GPIO setting.
No problem Dave!!!

Originally Posted by
Acetronics
Hi,
Three things ...
1) you use the IOC interrupt ... so that rings the " Mismatch condition " bell in my head ... see Sleep datasheet chapter.
2) Microchip recommends to place a NOP instruction just past the Sleep one, when using the feature this way.
3) when you push a button ... you obviously release it one day ! makes two input changes ...
Alain
Alain; I read the datasheet but couldn't get anywhere, believe me, I tried.

Originally Posted by
bogdan
try to add
@ sleep
@ nop
bogdan, tried also that, but its not the solution for my problem.
Ok, the only conclusion that i came up, is this:
If i disable the WPU on the button pin, put a pull-down resistor in this pin and connecting the VCC to the button, i don't get the issue. I only get the issue, if i take of the pull down resistor, enable the WPU and connect the GND to the button.
So the conclusion that i came up, not knowing it it is the correct one, is that, on power up the GPIO state is LOW. So because i have the WPU enable on this pin, i think a interrupt is triggered, because i have a mistmach condition on this pin. If i disable the WPU, put a pull-down resistor in this pin and connecting the VCC to the button, i don't have the mistmatch condition, so the PIC goes to sleep.
If this conclusion is not the correct one, i don't know, why the micro is not going to sleep on power up!!!
Thanks and Regards;
Gadelhas
Bookmarks