PIC12C508A : WDT Reset during sleep problem

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View
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.

Re: PIC12C508A : WDT Reset during sleep problem

Quoted text here. Click to load it

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.

Quoted text here. Click to load it

Any instructions put here will never get executed.

Quoted text here. Click to load it

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

Re: PIC12C508A : WDT Reset during sleep problem
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.

no-one@dont-mail-me.com (Robert Scott) wrote in message
Quoted text here. Click to load it
address is fake.)

Re: PIC12C508A : WDT Reset during sleep problem
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.

no-one@dont-mail-me.com (Robert Scott) wrote in message
Quoted text here. Click to load it
address is fake.)

Site Timeline