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.

sciNotification doesn't work correctly TMS570LS20216SZWT

Other Parts Discussed in Thread: HALCOGEN

Hello,

i'm trying to configure the UART and interrupt when i send some characters in UART but i can't to call the function sciNotification. It seems that the ISR dosn't work when i call the function sciSend. Attached my simple project created with HALCogen ver. 03.05 and CCS Version: 5.3.0.00090. I'm also using XDS 100v2 USB Emulator.7840.LightADC.zip

Can you check my configuration please?

Many thanks in advance

  • Hello Ciro,

    The Halcogen generates SCI ISR routins and blank sciNotification function.

    1. You use the interrupt mode, but you don't enable the SCI interrupt and give the ISR routine in VIM (in sys_startup.c). When you call sciSend(), it doesn't jump to ISR.

    2. You need to add your own code to handle the notification. 

    Regards,

    QJ


  • Hi Wang, 

    i added the ISR sci1LowLevelInterrupt in sys_startup.c and disabled the SCI interrupt, but the ISR doesn't work and the sciNotification is not called. Following the VIM_init in the sys_startup.c

    #define vimRAM ((vimRAM_t *)0xFFF82000U)

    static const t_isrFuncPTR s_vim_init[64] =
    {
    phantomInterrupt,
    esmHighInterrupt,
    phantomInterrupt,
    vPortPreemptiveTick,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    sci1LowLevelInterrupt,
    sci1HighLevelInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    adc1Group1Interrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    vPortYeildWithinAPI,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    };

    Can you help me please?

    Thanks

  • Can you provide me an example that works, with any notification?

    Many thanks

  • Hi Ciro,

    1. The SCI1 Interrupt ISR should be assigned to address 0x38 (offset. It is #13).

    #define vimRAM ((vimRAM_t *)0xFFF82000U) /*VIM RAM*/

    static const t_isrFuncPTR s_vim_init[] =
    {
    phantomInterrupt,
    esmHighLevelInterrupt, /*0*/
    phantomInterrupt,
    rtiCompare0Interrupt, /*2*/
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt, /* 10 */
    phantomInterrupt,
    phantomInterrupt,
    sci1HighLevelInterrupt, /*13; LIN level0, this one is used in this project */
    phantomInterrupt,
    phantomInterrupt,
    can1HighLevelInterrupt, /*16; CAN1 level0 */
    phantomInterrupt,
    phantomInterrupt,
    phantomInterrupt,
    esmLowLevelInterrupt, /*20; ESM low level INT */

    ....

    #2, You also need to enable the interrupt for SCI1

    /* enable interrupts */
    vimREG->REQMASKSET0 = 1U /*enable*/
    | (0U << 1) /*disable*/
    | (1U << 2)
    | (0U << 3)
    | (0U << 4)
    | (0U << 5)
    | (0U << 6)
    | (0U << 7)
    | (0U << 8)
    | (0U << 9)
    | (0U << 10)
    | (0U << 11)
    | (0U << 12)
    | (1U << 13) //lin, SCI1 level0
    | (0U << 14)
    | (0U << 15)

    Regards,

    QJ


  • Hi Ciro,

    I don't have example using TX interrupt. I think your project should after changing the VIM setting and enabling the SCI INT.

    Regards,

    QJ

  • Hi Wang,

    i added your suggestion in my code but the sciNotification is never called by the interrupt. The register CPSR is always in mode 10011. Can you help me please?

    Many thanks

  • Hi Ciro,

    Can I have your CCS project? The interrupt priority has to be consistent between the configuration and ISR routine:

    1. #pragma INTERRUPT(sci1LowLevelInterrupt, FIQ)

     2.                 | (SYS_FIQ << 13U)         /*13, LIN level0*/          

    Regards,

    QJ

  • Hello Wang,

    this is my project   8461.LightADC.zip

    I think that the problem is the is not enabled the IRQ. In fact if i enable the CPSR - IRQ register enable in debug mode, the sciNotification is called.

    Thank you for your support

  • Hi Ciro,

    Good to know the ISR is called. Did you get the transferred data on your PC terminal?

    Regards,

    QJ

  • Yes i see the data on the PC terminal. 

  • Hello,

    i solved my problem :)

    I added in sys_main.c the keword  "_enable_IRQ();" in order to enable the bit 7 of CSPR. Now the sciNotification is called when i try to send some character on the UART.

    Thank you very much for your support.