This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Polling an I/O Pin

Other Parts Discussed in Thread: MSP430F2274

Hey All,

Im trying to poll P3.6 and P3.7 on MSP4302274. I found out while debugging that for some reason P3IN = 0xF0 when I initialize the hardware. This is messing my project up. I need it to be bit 6 and 7 to be 0 until they are made 1, but for some reason they change. How can I fix this??

Please help!!

  • What do you have connected to these pins on the device?  Specifically, P3.6 and P3.7?

    Also, how do you have the other P3 registers setup?

  • Hi Moiz,

    pls post your initialization code for P3.x pins. It would also be of interest how you check the I/O-pins (how you do the polling) and how you access the other P3 I/O's (P3.0 to P3.5) in your project.

    Kind regards
    aBUGSworstnightmare 

  • Hey Guys,

    I have two MSP430 on two different boards. Lets call them Unit0 and Unit1. This is how they are connected:

    Unit0 -------> Unit1

    P1.3 ------> P1.3

    P3.6------->P3.6

    This is how i setup the ports on Unit0:

    P1.3 --- output

    P3.6 --- input, resistor enabled, pull down

    and Unit1:

    P1.3 --- input, resistor enabled, pull down

    P3.6 --- output

    This is what I am trying to do. When i make P1.3 on Unit0 Hi, it should make P1.3 of Unit1 Hi as well. Which it does. Now, if P1.3 on Unit1 is Hi, I want to make P3.6 of Unit1 Hi, making P3.6 of Unit0 Hi. All this is working for me but the problem arises when I dont want anything to happen on Unit1 when P1.3 becomes Hi. It still make P3.6 Hi.

    The only other thing P3.x is connected to is: USCI_A0 TXD/RXD (P3.4/5), becuase I am using the terminal to toggle P1.3 of Unit0 . P3.0-P3.3 are not connected to anything.

    I hope I am making sense :).

    Thanks for your help

     

  • Hi Moiz,

    how do you distinguish between the two states for P1.3 (male P3.6 high or not)? 

    It looks like you need something like:

    if {P1.3 == HIGH)

    if {do something with P3.6 == HIGH)
    P3.6 = HIGH; // set to high level

    else
    // do something else (or not) and keep P3.6 as is 
    }

    Rgds
    aBUGSworstnightmare 

  • Moiz said:

    Hey All,

    Im trying to poll P3.6 and P3.7 on MSP4302274. I found out while debugging that for some reason P3IN = 0xF0 when I initialize the hardware. This is messing my project up. I need it to be bit 6 and 7 to be 0 until they are made 1, but for some reason they change. How can I fix this??

    Please help!!

    I presume you mean MSP430F2274 instead of MSP4302274.

    I do not have a MSP430F2274. Prompted by your post, I read the data-sheet. It says that if the ADC10AE0 register BIT7 or BIT6 is set, P3.7 or P3.6 is used as analog I/O respectively. BIT7 or BIT6 of P3IN are meaningless under such circumstance.

    Did you see this in the data-sheet? Did you check the setting of ADC10AE10 register?

**Attention** This is a public forum