Searching \ for 'Help!! Power on, reset problems!!' 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/power.htm?key=power
Search entire site for: 'Help!! Power on, reset problems!!'.

Truncated match.
PICList Thread
'Help!! Power on, reset problems!!'
1997\07\01@110332 by Lars Johansson 6018384

flavicon
face
Hi All.

I«ve written a small C-program for pic16c84.
I'm using Hi-tech C-compiler (Beta-3).

The problem is that when I turn on the power to the circuit,
it's sometimes completly dead. If I
then turn the power on and off a few times, it
(randomly) start's to work again!!??

The same happens if I do a reset (MCLR).
Sometime's everything works ok, the program
start's all over again.
But sometimes it crash - it's dead.
I think that the program sometime's doesn't find
right startposition and therefore not work.
Or maybe it's some hardware problem, to small
currents etc, but I don't think so.

Do I need a special "start-function" or "reset-function"
when I use Hi-tech C-compiler?
I didn't have this problem when I used MPLAB-C.

I hope it's something simple that I've missed.

thanks in advance
Lars Johansson, Stockholm - Sweden.
spam_OUTlrsTakeThisOuTspamstoa.mobile.telia.se
(sorry for my english)

1997\07\01@151317 by david

flavicon
face
In <D222IXI3NVVL*/R=A1/R=MRGST/U=LRS/@MHS.stoa.mobile.telia.se>, on
07/01/97 at 05:02 PM,
  Lars Johansson 6018384 <.....LRSKILLspamspam@spam@STOA.MOBILE.TELIA.SE> said:


****Watchdog timer*******Watchdog timer*******Watchdog
timer********Watchdog timer********

I beat myself senseless trying to deal with a similar problem, using
hi-tech C.  Either  set the watchdog timer bit *off* when programming the
PIC, or use the  clrwdt();  function in your code.

I hope this helps!
David


->Hi All.

->I ve written a small C-program for pic16c84.
->I'm using Hi-tech C-compiler (Beta-3).

->The problem is that when I turn on the power to the circuit, it's
->sometimes completly dead. If I
->then turn the power on and off a few times, it
->(randomly) start's to work again!!??

->The same happens if I do a reset (MCLR).
->Sometime's everything works ok, the program
->start's all over again.
->But sometimes it crash - it's dead.
->I think that the program sometime's doesn't find
->right startposition and therefore not work.
->Or maybe it's some hardware problem, to small
->currents etc, but I don't think so.

->Do I need a special "start-function" or "reset-function"
->when I use Hi-tech C-compiler?
->I didn't have this problem when I used MPLAB-C.

->I hope it's something simple that I've missed.

->thanks in advance
->Lars Johansson, Stockholm - Sweden.
->lrsspamKILLspamstoa.mobile.telia.se
->(sorry for my english)






                        \|||/
                         o o
David Darknell
-------+--+--oOO-(_)-OOo--+--+-----------------------------------------
             |--|__|--|___|--|__|--|   .....davidKILLspamspam.....xia.com EraseMEdavidspam_OUTspamTakeThisOuTpapdev.com

"In a world without need of fences, who needs Gates."
                                                                 Author
unknown
_______________________________________________________________________

1997\07\01@172649 by Steve Smith

picon face
Lars Johansson wrote

The problem is that when I turn on the power to the circuit,
it's sometimes completly dead. If I
then turn the power on and off a few times, it
(randomly) start's to work again!!??
Snip

The following section of code is part of the startup code for a '57 and I had
a similar iritation until i simulated it with random info in the registers it
somtimes crashed I traced it to the FSR not initalising properly and the
program jumping into the subroutienes and never coming back while trying to
clear the RAM.
Check FSR is cleared before trying to use it.

INIT
       BCF     STATUS,PA0      ; SET TO PAGE 0
       BCF     STATUS,PA1      ; DO IT
       CLRW                    ; CLEAR W TO SET PORTA TO O/P
       TRIS    PORTA           ; TRIS PORTA TO MAKE IT O/P

;the fix for two days headache.....
       MOVWF   FSR             ; FIX FOR FSR B5,6 TO 0 BY SMS 20-1-97

       MOVLW   B'0111'         ; SET CONTENTS OF PORTA
       MOVWF   PORTA           ; DO IT
       MOVLW   B'01111000'     ; SET CONTENTS OF PORTC
       MOVWF   PORTC           ; DO IT
       MOVLW   B'10000001'     ; SET I / O OF PORTC
       TRIS    PORTC           ; DO IT
       MOVLW   .22             ; LOAD LAST RAM REGISTER WITH 22
       MOVWF   LAST_REG        ; DO IT
       MOVLW   MEMBASE         ; LOAD FIRST RAM ADDRESS INTO FSR REG
       MOVWF   FSR             ; DO IT
CLR_REG CLRF    INDF            ; CLEAR THE RAM REG POINTED TO BY FSR REG
       INCF    FSR,F           ; INC FSR
       DECFSZ  LAST_REG,F      ; DEC LAST_REG COUNTER
       GOTO    CLR_REG         ; LOOP BACK UNTIL COUNTER IS ZERO
       CLRF    LAST_REG        ; CLEAR THE LAST_REG LOCATION
       CLRF    FSR             ; CLEAR THE FSR REG

1997\07\02@002527 by Mike Smith

flavicon
face
Ppl have already mentioned the watchdog that might have bit you.  Look also
at the rate of rise on the power supply when turning on and off.  Pic's
without brownout cct do not like a slow rising Vcc.

MikeS
<mikesmith_ozspamspam_OUTrelaymail.net>

----------
{Quote hidden}

<snip>

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