Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

output ports of microcontrollers

Status
Not open for further replies.
I wanted to know if after i give power to micro controller and before the software starts executing what is the state of output ports? Will it be in uninitialized state or in some logic high or logic low and also can i control the states of these ports?
 
look in the data sheet. It tells you the state on reset, else its floating and unknown.
 
Look on the page that give the Register File Addresses/Summary you will see a "value on POR,BOR at the end.
Status at Power on Reset.
The first thing in the program or routine is set the status to how you need them.
Max.
 
The datasheet is your best bet, The 1802 had input and output posts and some were configurable.

"Generally" with configurable ports, they may be in a high Z state. The ULN2003 was/is a good way to interface to ports because unconnected the "relay" was off, a low resulted in the relay off and a high resulted in the relay being on. TTL floated high.
 
A non-decent reset will screw things up royally.

I had a single board system (not PIC) that would not work reliably with a linear power supply. Worked fine with a switching supply.
Fix was to change a chip to a Schmidt trigger version that fed the reset pin from an RC network. I think it was from a lack of a clean edge.

Incidentally, the system controlled motors.
 
After power up, the answer is as given above. During or before power up you need to look at how the port is constructed. Here is a typical I/O port:
upload_2016-2-7_11-33-11.png


One very obvious thing is that power to a port when the MCU is not powered may power it. That might not be what you want to happen. Here are a couple of threads from the Microchip forums among several that address this question:
https://www.microchip.com/forums/m828348.aspx
https://www.microchip.com/forums/m626214.aspx

In particular, look at Ian.M's responses.

John
 
As I posted recently, there is at least one 18F micro (18F4431) where the setting of certain pins at POR depends from your election at configuration time. Surely there are more.
 
The op said after applying power and before software runs.
The reset on the micro will take an amount of time, during which the state of the o/p pins may be unknown, check the datasheet.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top