PDA

View Full Version : MCLR Question.



muddy0409
- 5th September 2005, 04:46
G'day again everyone.
Today's question is: Is there any consequence of holding MCLR low for an extended period of time (could be days). The rest of the chip and all other parts of the circuit are powered up normally. I just want to start the thing working by removing the low on MCLR and let it rise to 5v via its pullup R. Also, under these actions, what would be the state of the program while in reset? Does reset send the program back to the beginning at the falling edge, the low level or the rising edge??? And what would be the state of the output pins while in reset??
I know this probably is not the kosher way to control a device, but it is what needs to be done...(trust me), so I don't really want to hear all the alternatives, just intrigued by the answer to the questions
Thanks, in advance, for the great responses I know I will get.
Peter Moritz.

Acetronics2
- 5th September 2005, 07:38
Hi, Peter

This question is quite difficult to answer ...as we all have left a circuit "a certain time" under reset, and probably none had further problems.

I think the best way could be to post your thread on Microchip's users Forum or to Microchip support team ... They're great pros.

you should get a trustable answer from a Microchip product Engineer ...

Alain

PS: I left Logic CMOS circuits for very long time in the "reset" state ...so why wouldn't the PIC's do the same ??? ...

Melanie
- 5th September 2005, 08:31
There is no problem with doing this.

The PIC will start your program normally from the beginning, once MCLR rises above it's threshold and POR timesout and the other conditions for running such as Vdd and Oscillator are present.

The state of the internal Registers will be as per the table found in the back of the Datasheet for your PIC in the section "Special Features of the CPU". Read the section on Reset to determine how your PIC handles the condition.

Do not rely on your program variables being zeroed on start-up (you shouldn't anyway).

muddy0409
- 5th September 2005, 10:37
Thanks people.
Mel, the real part I need to know is what do the ports do, while in reset, ie do they turn off, or on, or no change? They will be off'ed at startup, but is a semi permanent reset equivelent to "startup"?, Intriguing, ain't it?
Where do I come up with these bloody questions??

Acetronics2
- 5th September 2005, 12:01
Hi Peter

At reset ( or power up ...) all ports are INPUTS ...but output flip flops do not have a specific reset value ...
that's why, it's better to write output values at start before defining inputs and outputs ...

read you soon ...
Alain

PS: hi, Mel
sometimes output values have to bet set to 1 at power up !!! ... with no "0 " transients allowed !!! Programmable curve Electronic ignition program available today ... which shows it ... don't say it's pure assembler to the list !!!

Melanie
- 5th September 2005, 19:48
Datasheet!

If you Power-On your PIC yet hold MCLR Low, your PIC will be in the Power-On start-up state until MCLR goes high. Port I/O's will be INDETERMINATE. They can be pulled High, or Low or be High-Impedance Input.

Only once you've set TRIS and assigned an initial I/O state, subsequently then when MCLR goes low, the I/O's will REMAIN in the state prior to MCLR stopping the show.

Let me reitterate in case you missed it, if you've never run your PIC following power-on (because MCLR is being held low), you CANNOT guarantee the state of the I/O's.

Read the Datasheet for your PIC.

muddy0409
- 6th September 2005, 05:29
Right, thanks heaps Mel.
Funny as it may seem that's just what I figured after reading, in more detail, about various chips. It's good to have someone who knows these things inside out to agree with me.
That comes from working with PICs all day, every day as I gather from your various posts.

Thanks again Mel, and Alain.
Your sort of comitment to this gear is what makes this a great forum for the old twits like me.