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.

c5515 ezdsp: How do I set up a pushbutton event interrupt?

Other Parts Discussed in Thread: CC3200

Please,

Can somebody guide me through the correct directions to set up an interrupt on push button (SW1 or SW2) press?

  • Hi Samuel,

    On the C5515 eZdsp, these are connected to the SAR - different voltages appear at the SAR input when the buttons are pressed and short to different resistors to GND (resistor divider).

    The SAR can interrupt on completion of an analog to digital conversion, or if configured for touchscreen, whenever a pen touches the screen... I havent thought about reusing the touchscreen interrupt as an edge detect, but it might be possible. Otherwise, I think the best you can do is to use the timer to generate interrupts periodically and read the SAR in one of those interrupts.
    The CSL has an example on interrupting after a completed conversion. Download the CSL here: http://www.ti.com/tool/sprc133

    Refer to the INT CSL example: c55xx_csl_3.06\ccs_v6.x_examples\sar\CSL_SAR_IntcExample\csl_sar_IntcExample.c
    Refer also to the timer interrupt example: c55xx_csl_3.06\ccs_v6.x_examples\gpt\CSL_GPT_NestedIntrNmiExample\csl_gpt_nested_intr_nmi_example.c

    Although those buttons are not connected to GPIOs, GPIOs can be configured to generate edge detected interrupts to the CPU on either the rising or falling edge. I suspect this is what you are looking for.
    Refer to the GPIO interrupt CSL example: c55xx_csl_3.06\ccs_v6.x_examples\gpio\CSL_GPIO_InputPinExample\gpio_Input_Pin_Example.c
    An example of GPIO used as inputs (polling, not interrupt) can be found in the C5545 Boosterpack diagnostics: c55xx_diagnostics\board\diag\gpio_dsp_to_lp_cc3200_test\src\gpio_dsp_to_lp_cc3200_test.c

    There are also dedicated interrupt pins INT0 and INT1 that interrupt on a synchronous negative edge detector circuit.
    I could not find an example for using these interrupts in the CSL, but I'm sure there is one in some example - I'll keep checking.

    As always, check the User Guides for details of usage. http://www.ti.com/product/TMS320C5515/technicaldocuments

    Studying and tinkering with these examples will help you to configure the interrupt vectors and initialize everything correctly.
    Play around with them and we'll help to answer any questions you come across.

    Hope this helps,
    Mark

  • Another example of using these buttons as inputs (polling, not interrupt) is in the Spectrum Digital examples: usbstk5515_v1\tests\switch\switch_test.c

    Download the Test Code at http://support.spectrumdigital.com/boards/usbstk5515/

    Hope this helps,
    Mark