This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

How to configure one same pin as input and output both

Hi All,

I am trying to implement I2C (using bit banging) protocol on TI-MSC1210Y5 micorcontroller.

For implementation, I am using two pins of port 1 for providing clocking and receiving/sending data from the device (sensor) connected to I2C bus.

P1.2 = DATA (write/send device address on I2C bus and receive/read data from the sensor)
P1.3 = Clock (configure to provide clock to the connected device-sensor)

As apparent, that P1.2 is used for both send and receive data therefore it is used as input as well as output pin.

My question is, how to configure (tell the data direction of) this pin P1.2 so that it can be used as input(when required) as well as output(when required).

Do i need to configure any special function register for it? If yes, then please let me know how?
OR microcontoller is intelligent enough to recognize the data direction self?

Regards
Asad

0