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.

TMS 570 push buttons

Other Parts Discussed in Thread: HALCOGEN

Hi, 

I'm trying to use the two push buttons (Mbspi5[1] and Mbspi5[2]) to toggle recording modes on an Accelerometer. How would I set the pins to activate a function when the button is pushed?

  • You have to enable the MIBSPI5 and GIO driver,
    You'll have to define the two pins as GIO and input, both in the MIBSPI5 Port tab.
    You'll have to call the mibspiInit() method in your program to apply the settings done in HALCoGen
    Then, you'll have to check the value of the pins at regular times within your loop to check if the button is pushed.

    You can use gioGetBit(mibspiPORT5, X) to retrieve the value.