Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

What precautions should be taken when programinning I/O port

Status
Not open for further replies.

kk2mkk

Member level 2
Joined
Apr 20, 2006
Messages
44
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Location
Hyderabad India
Activity points
1,622
What precautions should be taken when programinning I/O port of a microcontroller...?
 

Re: What precautions should be taken when programinning I/O

In which context?

TOK ;)
 

Re: What precautions should be taken when programinning I/O

If u are using 51 series microcontroller.If u r reading data from outside make the port as input by sending port pin in to highstate(output 0xFF).if u want to make port as output send (0x00) to the port,with out this it will work,better u follow this.also connect a pullup resistor in the port0.
 

Re: What precautions should be taken when programinning I/O

thanks for ur reply vibeesh
yes my question related to 51 MCU
are there any other precautions that i should take while programming I/O ports of 51 MCU.
that u can suggest

thankyou
 

Re: What precautions should be taken when programinning I/O

Hi,
No need to do anything on ur I/O port pins. Also it depents on what u r connecting to the particular pin. To use a pull-up resitor for open drain pins is a good practice when using I/O pins.
This is all about hardware. If u r speaking about software precautions the answer is nothing to be alert. Depents upon which port u r using
Let me know if any further help needed
Thanks.
 

Re: What precautions should be taken when programinning I/O

thankyou Gladis

ur reply given some idea in the angle of software point of view.
i want to know what are the other precautions needed to be taken in hardware point of view , other than adding pull-up resistors.

thankyou
 

Re: What precautions should be taken when programinning I/O

Hi,
One thing u hav to make clear is that: What is the thing u r connecting to the I/O. Are u trying to connect LEDs to I/O pins ?
If u r connecting an LED in I/O pin then u hav to simply use a series resistor of 470E and connect the LED. If u r connecting a Switch u have to use a pullup resistor of 10K to Vcc and connect groung through switch.

If u r trying to connect anything else let me know

Thanks.
 

Just check your interface circuit (circuit between microcontroller pins and device you are looking to act on it) before connecting it to the microcontroller pin

i.e it should has no shorts , if you are interfacing your microcontroller to a DC motor you should isolate the microcontroller from the back emf of the motor,.....
 

Re: What precautions should be taken when programinning I/O

Do not connect the port line to the vdd for sensing the logic by keeping port line low this will damage the port line . This could be silly mistake .
 

Re: What precautions should be taken when programinning I/O

kk2mkk said:
What precautions should be taken when programinning I/O port of a microcontroller?
Be sure to always access the port atomically if multiple threads will perform read-modify-write accesses to it:
  • If multiple scheduled threads access a port then each access should be protected with a semaphore or by disabling interrupts during the access.
  • If an interrupt handler and one or more scheduled threads access a port then each such thread should protect its accesses to the port by disabling interrupts during the access.
 

when the port is working as Output port: check that you dont drain from each pin more than the maximum allowable current , this can be done by using limiting resistors for example.

when the port is working as Input port:
check the voltage at the input doesnt exceed Vcc (5 volt).
 

Re: What precautions should be taken when programinning I/O

take care when ur intrfacing circuit withdraw higher current than the MC can sink,in this case u shoud add a current buffer such as PNP or NPN transistor or IC buffer.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top