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.

TIRTOS gpio interrupt example problem

Other Parts Discussed in Thread: SYSBIOS

I am working through the TIRTOS examples to learn TI-RTOS, SYSBIOS, XDCTOOLS, etc.  I am on the GPIO interrupt example and I have a problem.  I am using CCS v5.3, the latest version of TIRTOS and a DK-LM3S9B96 dev kit board. 

I am able to recompile, load, and download the .out file to the board and run it in debug mode.  When I hit the user button slowly, the led toggles (as it should).  However, when I hit the user button faster, the led misses some of the button presses.

Is there some implicit timing built into TIRTOS or the driver?  I need t be able to trust an interrupt to work every time or I will revert back to polling.

BillP

  • Hi Bill,

    The GPIO module driver and the interrupt example does not do any de-bounce management. Is the interrupt not running or are you seeing a de-bounce issue?

    Which version of TI-RTOS do you have. TI-RTOS 1.10.00.23 requires CCS 5.4 and no longer supports the LM3 parts. 1.01.00.25 requires CCS 5.3 and has support for the LM3 parts.

    Todd

  • Hi Todd,

    I am using TI-RTS 1.01.00.25 and CCS v5.3, so the LM3 part should be OK (and it seems to be).

    Debounce sounds like the problem.  Is there a built-in way to deal with this or do I have to add my own debounce logic?  If so, are there examples for a button similar to what is on the LM3S9B96 board?  Thanks.

    BillP

  • We do not have any de-bounce management example code in TI-RTOS. You can take a look in the buttons.c file in StellarisWare.

    Todd

  • Todd,

    Thank you for answering the original question.  I have not had time to thoroughly review the buttons.c code for debounce, but at first glance, it appears the debounce logic is included in the hwi code.  Doesn't debounce take milliseconds to stabilize?  If so, shouldn't the logic be pushed off to a lower priority task (using TI-RTOS)? 

    Bill

  • Which code are you referring to? Can you attach the file and denote which lines you are talking about.

    Thanks,

    Todd

  • Hi Bill,

    I am a new user of TI-RTOS. I am currently trying this example. After loading and runing the program, I cannot find any user button to toggle the led. Can you please advise where can I find a button to achieve this task?

    Thanks in advance!

    Bin

  • Hi Bin,

    I am using the LM3S9B96 development kit.  The user switch and LED are clearly marked on the board.  You must be using a different kit.

    This example shows how to connect a GPIO pin to a hardware interrupt.  It is not a good example for actually monitoring the state of a switch due to the debounce problems.  I found a simple solution which I will post when I have time.

    Bill

  • Hi Bill,

    Thanks for this, yes, I am using concerto board F28M35H52C1. So I do not have any button on the board. Thanks for letting me know that.

    Regards,

    Bin

  • Hello,

    I am also using Concerto Experimental Kit for F28M35H52C1. So, for GPIO interrupt example. I can not use user switch as its not provided on board.

    I plan to make one GPIO as Digital INput and do some soldering stuff around the kit bread board to add a user switch. Is this possible? If possible Can I have the circuit diagram of this kit?

    Thanks,

    Priyank Soni

  • Hi Priyank,

    I think that would be ok. Please check the link below which may be helpful.

    http://e2e.ti.com/support/embedded/bios/f/355/p/284610/993355.aspx#993355

    Regards,

    Bin