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.

TMS320F280039C: set Lin as sci function but can not go into the RX interrupt

Part Number: TMS320F280039C

Hi expert, 

My customer wants to use LIn as SCI function. the baud rate is 250Khz, and they can see the correct data on TX pin.

they can get the data on SCIRD register. But they can not go into the RX interrupt, not even once!

The register status is as below:

the configuration code is 

LIN.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
SysCtl_enablePeripheral(SYSCTL_PERIPH_CLK_LINA);
Interrupt_register(INT_LINA_0, DEBUG_RX_ISR);
Interrupt_enable(INT_LINA_0);
EALLOW;
GPIO_setPinConfig(GPIO_28_LINA_TX);
GPIO_setPinConfig(GPIO_29_LINA_RX);
GPIO_SetupPinMux(29, GPIO_MUX_CPU1, 10);
GPIO_SetupPinOptions(29, GPIO_INPUT, GPIO_PUSHPULL);
GPIO_SetupPinMux(28, GPIO_MUX_CPU1, 10);
GPIO_SetupPinOptions(28, GPIO_OUTPUT, GPIO_ASYNC);
EDIS;
LIN_initModule(LINA_BASE);
configureSCIMode();
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Since the sci share the clock with SPI and they can not get the baud rate they want by SCI module. so they must use Lin to achieve this function.

Could you kindly help on this case since it is a really urgent project?

BR

Emma

  • Hi Emma,

    I believe the clock is also shared with LIN peripheral, so I don't know if you will be able to avoid using the same clock as SPI/SCI with LIN. I will reach out to LIN owner on this.

    Regards,

    Vince

  • Hi Emma,

    Could you try the "lin_ex2_sci_loopback.c" example and see if it works for you? I'm looking at your code and a lot of the items from that example are missing. For example, clearing interrupts in the ISR is missing.

    I will let LIN owner comment further if you cannot get loopback example to work.

    Regards,

    Vince

  • Vince, 

    No, Lin and SPI /SCI is clocked from different clock source.

    Emma 

  • Vince,

    They have tested the lookback mode. they still can receive the data on SCIRD but can not go into the interrupt.

    Could you kindly give me the code which support external communication, setting lin as SCI?

    Then I can just change the baud rate and use it.

    Emma

  • Hi Emma,

    In "lin_ex2_sci_loopback" example you just need to comment out the "LIN_enableIntLoopback(LINA_BASE)", which I see you have already done. Also if you are receiving the data on SCIRD, then looks like the code is working.

    Can you check if all the interrupt configurations are happening correctly i.e. when below lines get executed, does it really set the bits?

      //
      // Enable interrupt for when a frame has been completely received
      //
        LIN_enableSCIInterrupt(LINA_BASE, LIN_SCI_INT_RX);

        //
        // Set the interrupt priority to line 0 (high)
        //
        LIN_setSCIInterruptLevel0(LINA_BASE, LIN_SCI_INT_RX);

    Best Regards,

    Nirav