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.

PGA450Q1EVM: Lin problme

Part Number: PGA450-Q1

I have a Lin problem that I try to communicate with 2 slave devices

one's device address is 04, other one's device address is 05

first step :  it is okay

send a message in GUI

PID : 14,

Data 04 

before and receive datas from slave device with PID 24 and below datas

data0 : 0xAA,

data1 : 0x24(this is PID),

data2 : 0x14,

data3 : 04(this data was received by PID 14, data 04 )

data4: 0x55

Seconde step : it is okay

send a message in GUI

PID : 15,

Data 04 

before and receive datas from slave device with PID 25 and below datas

data0 : 0xAA,

data1 : 0x25(this is PID),

data2 : 0x15,

data3 : 0x04(this data is received by PID 15, data 04 )

data4: 0x55

Third step : it is wrong

send a message in GUI

PID : 14,

Data 04 

before and receive datas from slave device with PID 24 and below datas

data0 : 0xAA,

data1 : 0x24(This is PID),

data2 : 0x14,

data3 : 0xAA(this data is received by PID 14, data 04 )

data4: 0x55

Seconde step : it is wrong

send a message in GUI

PID : 15,

Data 04 

before and receive datas from slave device with PID 25 and below datas

data0 : 0xAA,

data1 : 0x25(this is PID),

data2 : 0x15,

data3 : 0xAA(this data is received by PID 15, data 04 )

data4: 0x55

If you need my source, please refer the attached source

Please let me know the reason why happened this problem

I have to fix this problem within this weekend

src.zip

  • Hi WonGeun,

    Cleaning up your data log, please confirm this summary matches your above description:
    STEP1: (PASS)
    Master: PID=14 {0x04}
    Slave: PID=24 {0xAA,0x24,0x14,0x04,0x55}
    STEP2: (PASS)
    Master: PID=15 {0x04}
    Slave: PID=25 {0xAA,0x25,0x15,0x04,0x55}
    STEP3: (FAIL)
    Master: PID=14 {0x04}
    Slave: PID=24 {0xAA,0x24,0x14,0xAA,0x55}
    STEP4: (FAIL)
    Master: PID=15 {0x04}
    Slave: PID=25 {0xAA,0x25,0x15,0xAA,0x55}
    where:
    Slave: data1=PID, data3=data received by PID

    Can you more specifically state the problem? What is the objective of the four step command set you are executing?

    From what I gather, data3 from the slave should match the master transmitted value of 0x04, but in STEP3 and STEP4, the return value does not match when executing the same command the second time on each device.
  • Hi Akeem

    Yes, you right

    Data3 from the slave should match the master transmitted value(0x04)

    but the step3, step4 does not match with 0xAA

  • Hi Akeem

    I just changed the source of PID that one's PID is 0x11, 0x21 and another one's PID is 0x12, 0x22
    but this source is also happened the same problem
    so I thought that your provided source(PGA450Q1EVM-S UART-LIN Demo Rev.2.7) had a same problem
    Refer the attached source and Please help me fix the problem

    WonGeun

    1830.src.zip

  • Part Number: PGA450-Q1

    Hello all

    I asked about the Lin problem(Link) but I did not receive any answer

    Please check my problem and fixed the error

    Thank you

  • Hi WonGeun,

    We are still in the process of reviewing your firmware, and will respond once we complete our assessment.
    I am merging this post with your original to prevent a split discussion.
  • Hi Akeem

    How is going about my question ?

    WonGeun

  • Hi WonGeun,

    Do you have an error in the PGA450_isrs.c file?

    id = pid&0x0F;
    cmd = pid&0x30;
    cmd = cmd>>4;	
    if (id != deviceAddress && pid != 0x01)
    {
    	return;
    }
    switch (cmd){

    From the looks of this code snippet, you are allocating the the first 4-LSBs to the ID for a total of 16 different addresses (b0000xxxx).

    Your CMD field is only 2-bits to allow up to 4 commands (b00xx0000).

    I suspect you want to swap these such that the first 4-LSBs allow support for up to 16 commands, and a 2-bit address field be available for up to four devices. The revised code would look like:

    cmd = pid&0x0F;
    id = pid&0x30;
    id = id>>4;

    You will also need to update your deviceAddress code in the main function to ensure only bits 4 and 5 reflect the address, and then shift to bit space 0 and 1 to properly check against the id != deviceAddress condition.

    When hardcoding the ID to 0 and 1, the LIN commands worked as expected on a single device based on your customized command 2 return:

    id = pid&0x30;                 // Akeem changed to reflect new id method
    DATA_CNT = 5;		// Number of bytes to be transmitted
    TX_DATA0 = 0xAA;
    TX_DATA1 = pid;
    TX_DATA2 = id | 0x10;
    TX_DATA3 = rangetest;
    TX_DATA4 = 0x55;

    Results:

    When ID=0, NumBytesToRecv=5, RxPID=02, RtrnData= AA,02,10,00,55

    When ID=1, NumBytesToRecv=5, RxPID=02, RtrnData= AA,12,10,00,55

  • Hi Akeem

    I just changed the source of PID that one's PID is 0x11, 0x21 and another one's PID is 0x12, 0x22
    but this source is also happened the same problem
    so I thought that your provided source(PGA450Q1EVM-S UART-LIN Demo Rev.2.7) had a same problem
    Refer the attached source and Please help me fix the problem

    Please check this soure

    WonGeun

    1830.src.zip

  • Hi WonGeun,

    Please refer to the following E2E post about a bug in version 2.7 of the PGA450-Q1 UART/LIN demo firmware.
    e2e.ti.com/.../2679295
    This may be affecting your results also.