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.

TMS320F280025: Lin register configuration problem

Part Number: TMS320F280025
Other Parts Discussed in Thread: C2000WARE

Dear team:

After transplanting the Lin module configuration code of f28034 to f280025, my customer found that the chip could not receive data. Is there anything to pay attention to in the Lin configuration of these two chips?

The following is the code for f280025:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
EALLOW;
CpuSysRegs.PCLKCR19.bit.LIN_A = 1;
GpioCtrlRegs.GPAPUD.bit.GPIO28 = 0; //GPIO28 (LIN TX)
GpioCtrlRegs.GPAPUD.bit.GPIO29 = 0; //GPIO29 (LIN RX)
GpioCtrlRegs.GPAQSEL2.bit.GPIO29 = 3;
GpioCtrlRegs.GPAQSEL2.bit.GPIO29 = 0x01;
GpioCtrlRegs.GPACTRL.bit.QUALPRD3 = 0x03;
GpioCtrlRegs.GPAGMUX2.bit.GPIO28 = 2;
GpioCtrlRegs.GPAMUX2.bit.GPIO28 = 2;
GpioCtrlRegs.GPAGMUX2.bit.GPIO29 = 2;
GpioCtrlRegs.GPAMUX2.bit.GPIO29 = 2;
EDIS;
//Lin register configuration
EALLOW;
LinaRegs.SCIGCR0.bit.RESET = 0;
LinaRegs.SCIGCR0.bit.RESET = 1;
LinaRegs.SCIGCR1.bit.SWnRST = 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

LinaRegs.SCIPIO0.bit.RXFUNC = 1;
LinaRegs.SCIPIO0.bit.TXFUNC = 1;

These two codes are not available on 28034. Other configurations are the same as 28034.

In addition, the above configuration method can only view the register configuration in registers. I don't know how to view the register configuration in expressions?

Best regards

  • Hi,

    Can you not develop the code for LIN using C2000Ware's F28002x driverlib example? There could be shuttle configuration differences that could be missing, so its a good idea to use F28002x driverlib example which is tested.

    Also, few questions:

    Are you using LIN in SCI mode, or using LIN communication?

    Where are you setting baud rate?

    Can you send a snapshot of what you see in the expressions window? Lin regs should be available using expression window, can you take snapshot of the expression window? Do you not find LinaRegs or you dont see values configured after running the code?

    Best Regards,

    Nirav

  • Hi Nirav:

    This is the snapshot of expressions window and registers window:

    Best regards

  • About using C2000Ware's F28002x driverlib example, since this is my forum support customer, I don't know why he uses register form for programming. However, what should we pay attention to if we use register programming?

  • Hi,

    Register programming is fine, but I am mainly concerned about the configuration sequence between the two devices. If you can send me the customer project, I can try that at my end.

    Also, can you please provide answers to other questions:

    1. Is customer using LIN or SCI?

    2. How is the baud rate configured?

    3. Is customer transmitting data through LIN transceiver, if so what is the baud rate configured to?

    Best Regards,

    Nirav

  • Hi Nirav:

    This is my customer's project, thank you for your support.

    28002xProject_TI.rar

    The customer mentioned that his main problem is that the register cannot be set. For example, after executing "linaregs. Scigcr0. Bit. Reset = 1", observe whether the value of "linaregs. Scigcr0. Bit. Reset" is still "0".

    Best regards

  • Hi,

    I am able to see the LINA regs getting updated at my end. Did you try stepping through the code, or did you put a break point and ran it till the end of configuration?

    Also, I see the configuration is for SCI and not LIN, LINMODE is not configured.

    Best Regards,

    Nirav

  • Hi Nirav:

    The customer mentioned that his project is actually configured with SCI function, but his problem is that the register cannot be written in.

    For example, after he performs single step debugging and executes the following statements:

    LinaRegs. SCIGCR1. bit. RXENA = 1;

    The results viewed through the expressions window are as follows:

    When he runs continuously and then stops Ho, the result he sees is still the result shown in the figure above, that is, the value of the register cannot be written in;

    Seeing your screenshot, he has the following questions (i.e. the Chinese content in the picture):

    Since scigcr1 all = 0x010200A2; Why is the corresponding value in the bit field still "0"?

    For example, SCIGCR1.bit.TIMINGMODE and SCIGCR1.bit.CLK_MASTER, shouldn't them be displayed as 1?

  • Hi,

    If customer does not step through the code and puts break point on configuration and then run, does he see the SCI registers configured?

    On your question based on the snapshot:

    For some reason bit fields does not seem to show the updated values. But if you look at the memory map and register window they are updated correctly.

    I suggest customer to use Register window to view the configuration updates while debugging.

    Best Regards,

    Nirav

  • Hi Nirav:

    The customer also mentioned that the problem of bit field display seems to be only for LIN-related registers, and not for others. For example, for the configuration of the IO port in the project, the bit field display is normal;

    In addition, he wants to know if you can receive data with the customer's project? That is, accepting the interruption can get in?

    Best regards

  • Hi Deng,

    LIN is on the VBUSP bridge and has byte accessibility, so that could be the reason why the bit display is not working correctly, as other peripherals has x16 addressing. In any case you should be able to check the memory map or the register view to confirm the configuration. 

    Give us couple of days to check the customer project for data reception. Just to confirm from customer configuration inside project it is SCI communication and not LIN.

    Best Regards,

    Nirav

  • Hi Green,

    Running the code, I see that the SCIGCR1 bits are set correctly:

    When running the code, the RX-ISR is not being entered (tested with a break-point). Therefore there is something incorrectly set up with the configuration or the interrupt code

    For debugging, please utilize the "lin_ex2_sci_loopback.c" example from C2000Ware to start with. See if any errors occur with this C2000Ware example on the customer setup.

    If no errors with this example, modify the example to change from loopback to external connections.

    Finally, if external connections work with the example, try porting to the customer's desired final code.

    By going in small incremental changes from known-good code like this, it should help resolve the issue/find the source of the problem quickly.

    Regards,

    Vince