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.

TDC1000-TDC7200EVM: Don't know how to connect Keypad with MSP430F5528

Part Number: TDC1000-C2000EVM
Other Parts Discussed in Thread: MSP430F5528

Hi!!! Everybody!!

I'm trying to attach 1 on/off keypad to GPIO3 of J6. As shown in the picture below;

.

I connected tried to short GPIO3 and GND but nothing happens. This is my code (whole code). ScanKeyPads() is called in "while" loop of the main.

#define KEYPAD_PxOUT       P4OUT //Port4
#define KEYPAD_Px_IN       P4IN //Port4
#define KEYPAD_PxDIR       P4DIR //Port4
#define KEYPAD_PxSEL       P4SEL //Port4

#define KEYPAD1_PIN     BIT4  //P4.4 -->J6.GPIO3
#define KEYPAY2_PIN     BIT5  //P4.5 -->J6.GPIO4

void ScanKeyPads()
{
    if ((KEYPAD_Px_IN>>5)&0)
        {
        while(1);
        }
}

Please let me know how to achieve this.

Also,

 Is it good to call it in while loop of main?

because 1. The LCD (via I2C) is flickering. 2. The measurement result is introduced because of it.

Please help me again!!! I always thank you for your helps..

Best Regards,

Suh, Sukho

  • Hi Sukho,

    The EVM you have pictured is the TDC1000-TDC7200 EVM which uses an MSP430F5528 microcontroller, and not a C2000. I am moving this to the MSP forum, and editing the title for better visibility.

    Regards,
  • Hello Sukho,

    I am unfamiliar with this particular EVM, but let's see if I can help you out here. First can you describe what you are trying to do when shorting P4.4? Are you trying to get an interrupt? If you are just trying to check the status of P4.4 (Is P4.4 = 0?) then you will need to mask the full P4IN register for this. For example:

    if( ~(P4IN & BIT4))

    {

    //do something

    }

    The check you have above will not be zero unless pins P4.4-P4.7 are all Zero.

  • Hello Sukho,

    Did the above post help with your issue?
  • Hi,

    Actually, if the check above that you are referring to is " if ((KEYPAD_Px_IN>>5)&0)"  Then it will always be zero.  Anything anded with zero is going to be zero.

    I think your solution above is what he is looking for though. Very nice.

    Cheers,

    Barry

  • Thank you all....

    I managed to find an unused port and decided to use it for port interrupt. And I got it working, though I still struggling. If the port interrupt is generated amid sending I2C data over to LCD, the whole program just stops. Turning off the interrupt before sending and on again after sending mitigated the problem a little but not completely. I think I have to turn it on and off again in other parts of the codes....

    Have a nice weekend!!!

**Attention** This is a public forum