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.

C2000 DRV-8312 Start button

Other Parts Discussed in Thread: CONTROLSUITE

Hi!

I want to control the LED(GPIO31 or34) when I pressing the start button(GPIO9).

I look for  ti example code but there have nothing to talk about this.

Could you teacher me how to use start button connect  to control board?

Give me some simple reference code.

Thanks

  • Hi,

    Why don't you initialize the start button as external interrupt? You can find this external interrupt sample code in controlSuite. The only change you'll have to do is: changing the gpio pin.

    Regards,

    Gautam

  • OK, thank you.

    I'll try it.

  • I follow you suggest to use the code.

    Because I want the LED lighting(GPIO31) when I pressing the Start button(GPIO9)

    This program sets up GPIO31 as XINT1. GPIO signals are used to trigger the interrupt (GPIO9 triggers
     XINT1)

    Here's the code. I follow the sample code to modify and initial.

    // GPIO9 is inputs

    EALLOW;

    GpioCtrlRegs.GPAMUX1.bit.GPIO9 = 0; // GPIO
    GpioCtrlRegs.GPADIR.bit.GPIO9 = 0; // input
    GpioCtrlRegs.GPAQSEL1.bit.GPIO9 = 2; // XINT1 Qual using 6 samples
    GpioCtrlRegs.GPAPUD.bit.GPIO9 = 1;
    GpioCtrlRegs.GPACTRL.bit.QUALPRD1 = 0xFF; // Each sampling window is 510*SYSCLKOUT

    EDIS;

    // GPIO31 is XINT1

    EALLOW;

    GpioIntRegs.GPIOXINT3SEL.bit.GPIOSEL = 31; // XINT1 is GPIO31

    EDIS;

    But I don't  know. 

    How to make that link together and performance what I think.

    Have I lose something or the initial portion is wrong?

  • Hi Chi!

    You need to create an interrupt handler for  XINT1 (where you can toggle any GPIO) into your code like this example

    ti\controlSUITE\device_support\f2803x\v127\DSP2803x_examples_ccsv5\external_interrupt\Example_2803xExternalInterrupt.c

    Regards,

    Igor 

  • I know what you mean.

    But I don't know how to write it?

    Could you write a simple for me?