Author Topic: programming  (Read 1227 times)

0 Members and 1 Guest are viewing this topic.

Offline sonicbrainzz123Topic starter

  • Beginner
  • *
  • Posts: 2
  • Helpful? 0
programming
« on: April 07, 2011, 10:16:13 AM »
Hi everybody,
I am an amatuer as far as programming is concerned.My doubt is regarding configuring ports of 8051 as input ports. I am aware that a high signal or a 1 must be sent to all the port bits to use the port as an input port. I do not know if this must be done in the main program or by some other means. Most of the sample programs i see do not seem to address these issues. If this is done in the main program then would not the port initialisation with the component connected to the port be affected?Kindly help me in this regard.
Thank you.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: programming
« Reply #1 on: April 07, 2011, 10:31:38 AM »
There is a register in the 8051 that allows setting the Port pins as inputs or outputs, not the port register itself. Look in the data sheet for the 8051 you have (there are currently many variants) for this register. Exactly which 8051 do you have? Link to the correct data sheet?
This would be done near the beginning of MAIN either directly coded or in the init function called from main.

 


Get Your Ad Here

data_list