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.
Tool/software: Code Composer Studio
Hellow everybady:
I have a urgent item, we use the TMS320F280049 to implement the LIN communication with the main node.but i have some questions.i bag someone can help me.
(1) First, I need receive 3 frames,but need not respond (these IDs are 0x3c、0x06、0x18,and these frames have diffierent data length,they are 8byte、7byte and 1byte),we use the way of LIN_COMM_LIN_USELENGTHVAL . I check the Guidence book of TMS320F280049 . Inside the book, It have description that "The 3-bit compare register contains the number of data bytes expected to be received or transmitted.the LENGTH value in SCIFORMAT register indicates the expected length and is used to load the 3-bit compare register." So i want to know when should i set the expected length when we receive different frames.
(2)Second, i want to use CCS perform online simulation,but we can not check LIN register .we can not monitor LIN register change.
best wish!
YJ
Hi Yj,
In order to set length based on ID, first ID should be read and then length needs to be set based on the received ID.
1. Poll on LIN_isRXMatch(LINA_BASE) until the flag is set, to make sure the ID is received without any error.
2. Read the ID using LIN_getRxIdentifier(LINA_BASE), and based on the ID set the frame length
3. Set the frame length using LIN_setFrameLength() function
On your second question, what do you mean by online simulation? You can use CCS in debug mode to run the code and monitor LIN registers.
Regards,
Nirav
Regards,
Nirav
Hi Nirav:
Thanks for your help,but i don't understand the second step:"Read the ID using LIN_getRxIdentifier(LINA_BASE), and based on the ID set the frame length"
if we use< LIN_setCommMode(base, LIN_COMM_LIN_USELENGTHVAL)>, how can i based on the ID set the frame length? i think ID will use 6 bits and 2 bits is parity. For example,i need receive a frame its ID is 0x18, so PID is 0xD8. if we don't use the mode of LIN_COMM_LIN_ID4ID5LENCTL,How can i get the frame length?
Second,when i was using CCS in debug mode to run the code ,i can not monitor LIN registers. and when i receive some new frame, i find LIN registers didn't change.
best wish!
YJ
Hi Yj,
Since every LIN pid has different length, once the ID is received you need to set the length according to the ID, hence you need to use the function LIN_getRxIdentifier().
Which LIN standard you are using? If it is above 1.3 than you should use LIN_setFrameLength() to set the length.
Regards,
Nirav