View previous topic :: View next topic |
Author |
Message |
khalis
Joined: 12 Feb 2009 Posts: 54
|
Curious about IO Port Status During PIC is Powered Up |
Posted: Sun Jul 24, 2011 9:02 pm |
|
|
Hi
I'm just want to know what is the condition for every i/o pins that PIC has during power up before the program inside it is started to execute?. Is it all pins are in High Impedance?The PIC datasheet describes the pins condition only during MCLR Low and Watchdog Timer Reset but during power up, i unable to find it.
Looking forward the answer and thanks in advance. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Mon Jul 25, 2011 2:08 am |
|
|
Look at the TRIS register in the data sheet.
Note that the bits in this _default_ on power on, to '1`.
A '1' on a TRIS bit says 'set pin as input'.
So pins on the PIC all wake up as inputs (some exceptions, on later chips where some may wake as analog inputs, and a few may wake 'driven' - on things like the power PWM, there is fuse selecting whether the pins are driven on wake up, or left unconnected to the peripheral).
Best Wishes |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Mon Jul 25, 2011 6:48 am |
|
|
It depends on what you mean by "power up". If there is time between the application of VCC and the assertion of MCLR, the IO pins are usually undefined during that period. That is why good circuit design makes that time short or non-existant. Sometimes you have to rely on brown-out circuitry or a Power Up Timer to handle this. Once MCLR is asserted the IO pin status is clearly defined in the datasheet. Every PIC I have used defaults its pins to input, but as Ttelmah suggests, check your PIC for exceptions. After MCLR is released the program controls the IO pins. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
khalis
Joined: 12 Feb 2009 Posts: 54
|
|
Posted: Wed Jul 27, 2011 1:33 am |
|
|
Thanks again for the explanation. I already looked into it and it was useful for me and my team. |
|
|
|