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