We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello all,
I am working on a project using Winbond W77E58. To save energy, if there is no trigger input from P3.2 (INT0/), P3.3 (INT1/) or P3.0 (Serial Port) for some time the MCU will go into power-down mode. In my design, the MCU is woken by the external interrupt 3 (INT3/).
For the first time of power-down, the MCU can be woken by triggering the INT3/. But after some time when the MCU goes into power-down mode again, the MCU does not respond even though same input is from INT3/. It seems the MCU sleeps forever after the first awake.
unsigned char counter1=0x00; unsigned char counter2=0x00; void main(void) { unsigned short timer=0x0000; while(1) { timer++; if(timer=0x0F00) { PCON |= 0x02;//Power Down Mode _nop()_; timer=0x0000; }//if }//while }//main void interrupt_int0 (void) interrupt 0 using 1 { counter1++; } void interrupt_int1 (void) interrupt 2 using 1 { counter2++; } void interrupt_int3 (void) interrupt 8 { }
Does anyone know how to solve this problem?
Please help.
Jones
A typo in the original code, or a typo in the code you posted to this forum? It is important to copy the code - never retype it - when asking for help.
"It is important to copy the code - never retype it"
That is, use copy-and-paste from your editor into this forum.
Otherwise, who knows what other changes might have beeen introduced by the manual re-typing...?
Sorry. My program was big and not well-organized so I re-typed the codes instead of copy and paste them. I should chop down the program a bit or use a little test program next time. Thank you for your advice.