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.

How to invoke ISR for UART in DM6437

Other Parts Discussed in Thread: TMS320DM6437

Hi,

I am using TMS320DM6437 EVM for my project application. And I am new to this TI + DSP area. I need to do some task on UART (mainly receive routine).

My UART module is working fine in polling method at Baud 115200, But I need to use interrupt service based on my application. I have read the SPRA544 Application report and they have given a formula to calculate the vector address as follows Address = ISTP + 32* <interrupt number>. In the Device specific datasheet it is stated that the '84' is the event number for  UART0. I have configured the UART IER register to enable the Receive interrupt(ERBI = 1).

My query is :

1. Is it necessary to set the Global Interrupt Enable bit ? If so please guide me in which register I need to configure to do so.

2. # How to calculate ISTP value for UART0 Rx. After calculating the address of the ISR where should i configure ?

3. interrupt void myISR(void)  {....}. Is this format for an ISR? If not, please correct me for the same

  • saravana Muthu said:
    1. Is it necessary to set the Global Interrupt Enable bit ? If so please guide me in which register I need to configure to do so.

    To receive interrupts in general it is necessary to set the GIE, the GIE bit is not in a memory mapped register but rather the Control Status Register (CSR) which is accessed directly using a special assembly instruction. Typically if you are using DSP/BIOS on your device than you would set this bit using the HWI_enable() API call.

    saravana Muthu said:
    2. # How to calculate ISTP value for UART0 Rx. After calculating the address of the ISR where should i configure ?

    There is more to this than calculating an address, you have to configure the interrupt hardware to route the UART event to a particular Interrupt, one of the 16 hardware CPU interrupt lines. You can read more on the internal interrupt hardware used in the DM643x series in section 7.4 of SPRU871, though you would usually configure the interrupt through the DSP/BIOS configuration file as opposed to directly configuring it yourself.

    saravana Muthu said:
    3. interrupt void myISR(void)  {....}. Is this format for an ISR? If not, please correct me for the same

    The interrupt keyword will tell the compiler to put the proper state saving code around your function, however this is not typically used these days as most applications run DSP/BIOS which has its own interrupt dispatcher that means you no longer use the interrupt keyword, you just specify the function to call in the DSP/BIOS configuration file.