PIC 12C508 reset problem
From: A Beaujean (abeaujean_at_gillam-fei.be)
Date: 11/30/04
- Next message: Jason L James: "Re: Multi-threaded Sockets Application"
- Previous message: Alex: "Can't connect through BDM Interface"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 30 Nov 2004 02:11:53 -0800
I am encountering a very strange behaviour on a PIC 12C508A, nominally
powered at 5 Volts.
To alleviate possible brownout conditions in my design, I use a Dallas
DS1233-5 (Microprocessor supervisor) to act on GP3 (MCLR/ pin). The
threshold of the Dallas chip is around 4.5 Volts, way within the PIC
Vcc operating range.
At power up, no problem ever happens : the program ALWAYS performs as
expected, and that may be done flawlessly hundreds and hundreds of
time.
BUT : first tests made on my prototype under simulation of brownout
conditions (just slowly lowering the power supply) and bringing back
Vcc to nominal value showed that the MCLR/ does not reset (completely
?) the chip. The chip appears to hang and it may be pulled out off its
hanging condition ONLY by bringing the PIC Vcc to 0 Volts for more
than 2-3 seconds.
The "hanging" is somewhat particular in the sense that the IOs, some
of which have been put in output mode (things work well at power up),
return to high impedance once MCLR/ has been asserted (this is easily
measured by measuring the output current to Vcc or Ground if any).
BUT, the program never performs again as from power on.
A first look at the Web for similar problems indicates that some
people appear to have alike problems (on other PICs) if the MCLR/ is
asserted while Vcc is going down (which is of course the case when
using a supervisory chip connected on the same Vcc line).
But : more testing showed that even at stable Vcc (+5V), shorting the
MCLR/ pin to ground for any period of time had the same result
(infinite hanging).
I am using a XELTEK SP3000U programmer.
The GP3 pin is programmed as MASTER CLEAR.
Watchdog is enabled.
Internal RC mode is selected.
A more complete reading of the PIC product spec made me think that the
MCLR/ function does not operate correctly in internal RC mode. I thus
decided, for the purpose of testing, to use an external crystal
instead for a while. BUT : same thing !!
I took a few actions:
- additional decoupling at a very short distance of the PIC power pins
: no help.
- additional pullup resistor (10K) to Vcc on MCLR/ : no help
So, what happens ?
There might be a software problem I miss completely, although the
program is very simple.
You will find hereafter part of the program (essentially some
definitions and inits, the body of the program being absolutely
trivial)
Can anyone help ?
OPTION_IN EQU B'11001111' ;
;
OPTION_CF EQU B'11001110'
; configuration
; 7 : Disable wake-up on pin change
; 6 : Weak pullups disabled
; 5 : TMR0 clock source = Fosc/4
; 4
; 3 : Prescaler --> Wdog
; 210 : WDOG Postscaler rate = 1:64 --> WDOG TO
of 1.09 Seconds
TMR0_CF EQU D'38' ; TIMER0 reload value.
;
TRIS_CF EQU B'11111011' ;
;
GPIO_CF EQU B'00000000' ; Valeurs initiales: tout à 0.
ORG 0
Inits:
;
; Initialisations
;
clrf STATUS
;
; OPTION sequence recommanded by Microchip
;
clrwdt
clrf TMR0
movlw OPTION_IN
option
clrwdt
movlw OPTION_CF
option
;
movlw GPIO_CF
movwf GPIO
;
movlw TRIS_CF
tris GPIO ;
;
; BODY OF PROGRAM
;
ORG h'1FF'
goto Inits ; Not using calibration value
END
- Next message: Jason L James: "Re: Multi-threaded Sockets Application"
- Previous message: Alex: "Can't connect through BDM Interface"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|