PIC12C508A : WDT Reset during sleep problem

Dear colleagues,

I work with ICE2000 (pcm16xa0 & dva12xp80) to emulate PIC12C508A. I've experienced with a very strange problem: after the chip goes to SLEEP, the WDT Reset occures (STATUS = 0 on Reset), whereas it should be only Wake up from sleep !

__CONFIG _CP_OFF & _WDT_ON & _MCLRE_ON & _IntRC_OSC

START movwf OSCCAL ; update register with factory cal value ; ========================================================================== movlw 0x0f ; Select internal RC,enable pull-ups ; assign prescaller 1:128 to WDT,Wake Up on change option ;

;===========================================================================

movlw 0xEF ; tris GPIO ; Set GP4[Relay] to output direction

LOOP

sleep btfsc GPIO,0 ; Has the DATA_PIN fallen down ? goto LOOP ; No, it is High movlw ...

I've tried this code only with ICE, since currently I haven't possibility to burn a real chip.So, perhaps the problem exists only when working with ICE ?

Thank you in advance, Eli.

Reply to
Eli
Loading thread data ...

Not true. The 12C508 always does a reset when it wakes up from sleep. There is no option for continuing execution with the instruction after the SLEEP instruction. Your only choice is to put code in your reset code to check if this is a wake-up from sleep and take appropriate action, if needed.

Any instructions put here will never get executed.

-Robert Scott Ypsilanti, Michigan (Reply through this forum, not by direct e-mail to me, as automatic reply address is fake.)

Reply to
Robert Scott

Dear Robert, Thank you for your responce. Actually I am already aware of this fact. But I still don't understand why on reset, caused by input change, the STATUS register always equal to 0, despite it has to be 0x98 ?

Best regards, Eli.

address is fake.)

Reply to
Eli

OK, now everything is clear for me. The PCM16XA0 has a limitation with emulation of wake up from sleep on GP0/1/3 pins change, therefore the STATUS register always 0. RTFM problem. :)

Thanks to all those who tried to help me.

Best regards , Eli.

address is fake.)

Reply to
Eli

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.