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.

Does TMS570LS3137 support two or more interrupts from GPIO at the same time?

Other Parts Discussed in Thread: TMS570LS3137, HALCOGEN

I have to deal with the situation that 2 interrupts come together ,but I find my code dose not work well ,dose the TMS570LS3137 support 2 interrupt from GPIO at the same time?

  • Hello,

    Yes, each of the dedicated GIO terminals can generate interrupts independently. The GIO module integrates these into two separate interrupt requests to the interrupt manager (VIM). These are the two connections to VIM channels 9 and 23. These correspond to interrupt levels "high" and "low" respectively inside the GIO module. The interrupt level for each GIO input can be configured using the "GIO Interrupt Priority Registers", GIOLVLSET and GIOLVLCLR.

    If you do expect two GIO interrupts "at the same time", it is recommended to assign one to be a high-priority interrupt and the other to be a low-priority interrupt out of the GIO module. This way, there will be two interrupts requested to the VIM module, on channels 9 and 23, respectively. The interrupt service routines for these two channels can then handle both the requests one after the other.

    Alternatively, you can let both the GIO pins generate an interrupt request at the same level (high or low, per your preference). Then the ISR can address both the requests in the same ISR call. The GIO module has a built-in priority scheme including registers that capture the source of the first interrupt request. These are the GIOOFF1 and GIOOFF2 registers. Reading these registers for the first time will give you the value of the GIO pin that caused the interrupt request first. The read by the CPU will also cause the offset register to show the value of the next GIO pin that caused an interrupt, if any. This way your ISR can manage the interrupts that happen "at the same time".

    As an example, also note that if GIOA0 and GIOA2 generate interrupt requests at exactly the same time, then the GIO offset register will show GIOA0 first as there is also a built-in priority between the GIO interrupts. This specific information is missing in the TRM and will be added in the next update.

    Regards, Sunil

  • Please find attached a test case that demonstrate the priority within GIO PortA.

    This code will configure the GIO_PORTA as output for GIOA[7:0]
    All GIO_A[7:0] are also defined as interrupt enable on rising edge and will generate:
    For GIO_A[3:0] a low level interrupt to VIM.
    For GIO_A[7:0] a high level interrupt to VIM.

    This code is generated with Halcogen, but the original gioNotification has been modified by hand to demonstrate in the same test the GIO High and GIO Low interrupt generation. So do not regenerate the code with Halcogen or you will loose this support.

    Please let me know if this clarify your question on multiple GIO interrupt at the same time.5460.GIO_Interrupt_be.zip

  • When I use CCS V5.3.0.00090 open your project , it shows errors below

    "See details below.   Error: Import failed for project 'GIO_Interrupt_be' because its compiler definition is not available. Please install the ARMv5.1 compiler before importing this project. "

    How do I  use your project?

  • ,

    I've re-created the project, you should now be able to import it.

    Please let me know.

    8306.GIO_Interrupt_be.zip

  • yes ,I can import it ,but when I compile the project ,it has one error .

  • Jiaming,

    I'm not sure what is going wrong on your side. I've imported this project on another laptop just to double check and it is working fine for me.

    One comment, in my previous zip file, I was using an XDS560 as emulator.
    I've changed this to XDS100V2 (On board HDK) So to run the code, just connect your PC using USB connection.

    Here is the new zip file:8546.GIO_Interrupt_be.zip