Searching \ for 'PIC 16C63 Resetting itself' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/devices.htm?key=16C
Search entire site for: 'PIC 16C63 Resetting itself'.

Truncated match.
PICList Thread
'PIC 16C63 Resetting itself'
1998\10\06@202556 by Paul Gaastra

flavicon
face
I'm stumped.

I'm using the PIC C compiler (CCS)

I have a 16C63 which runs some initialise code
and part of a while
loop and then does a sleep.  The chip is woken
up by either a change in level on the RB0 or
edge on RB6 or RB7.

The code works perfectly on our emulator but
when I burn windowed version it runs and goes to
sleep and then when the wakeup signal is given
there is a delay and then the code runs from the
start again instead of carrying on in the loop.

If i burn the EPROM and power up the code works
perfectly the first time without doing the
second run from start but when I turn the power
off start again it does the second "reboot".

The bare bones code is:

#fuses WDT

main(){
 initialise();
   while(1){
     statements...
     restart_wdt();
     sleep()
     #asm
       NOP
     #endasm
       //go back to sleep if just watchdog wakeup
     while (restart_cause() == WDT_FROM_SLEEP){
       restart_wdt();
       sleep();
       #asm
         NOP
       #endasm
       }
       more statements
   }

The NOPs are because the instruction after SLEEP
is discarded.

Can anybody spot any glaring mistakes?  By
putting in some printf statements I can see that
the code runs to where it goes to sleep but when
the RB0,6 or 7 is "stimulated" the uP runs from
the start and the "more statements" code isn't
executed.








Paul Gaastra                              spam_OUTpgaastraTakeThisOuTspamhort.cri.nz
Technology Development Group, Hort Research
Private Bag 3123            phone +64 7 8584745
Hamilton, NEW ZEALAND         fax +64 7 8584705

1998\10\07@001803 by Peter Homann

picon face
Paul,
You have the Watchdog Timer is enabled. I presume that it is
continuously reseting the chip.

Note: I'm only guessing.

Regards,

Peter.

Paul Gaastra wrote:

{Quote hidden}

--
Peter Homann   email: peterhspamKILLspamadacel.com.au       Work : +61 3 9596-2991
Adacel Technologies Ltd                          Fax  : +61 3 9596-2960
250 Bay St, Brighton 3186, VIC, AUSTRALIA      Mobile :     014 025-925
http://www.adacel.com.au     Australian Software Engineering Excellence

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...