Other Parts Discussed in Thread: C2000WARE
Hi Team,
Here's an issue from the customer may need your help:
When acting as a LIN master, what are the commands or settings to request slave data?
Thanks & Regards
Yale Li
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.
Hi Team,
Here's an issue from the customer may need your help:
When acting as a LIN master, what are the commands or settings to request slave data?
Thanks & Regards
Yale Li
Hi Yale,
Our LIN expert is out of office today. Please expect a delay in response
Regards,
Peter
Hi Yale,
Please take a look at the following C2000Ware example: C:\ti\c2000\C2000Ware_version\device_support\f2803x\examples\c28\lina_external_loopback
In general, you have to write the correct ID to the header. All slave nodes will receive the message, but only the slave with a matching ID will respond.
Best Regards,
Marlyn
Hi Marlyn,
Thanks for your support!
you have to write the correct ID to the header.
Does this ID refer to LINID? How to write? The corresponding writing method is not given in the routine.
Thanks & Regards
Yale Li
Hi Yale,
Yes, I was rereferring to the LINID. The LIN example I pointed to shows how to write to the LINID register and how to setup the RXIDMASK/TXIDMASK.
// // LIN MASK Configuration 2 // LinaRegs.LINMASK.bit.RXIDMASK = RXID_MASK; // 0xA LinaRegs.LINMASK.bit.TXIDMASK = TXID_MASK; // 0xA // // Initialize the Slave LINIDNUM register // LinaRegs.LINID.bit.IDSLAVETASKBYTE = LINIDNUM_Slave; // 0x30 // // Release SCI from software reset state - End of Config // LinaRegs.SCIGCR1.bit.SWnRST = 1; // // LIN Response Length // LinaRegs.SCIFORMAT.bit.LENGTH = RESP_LENGTH; for(i=0;i<8;i++) { // // Transmit Data - This populates the LIN transmit // buffers - no data is actually sent yet. // LinaRegs.LINTD0.all = *Tx_DataPtr++; LinaRegs.LINTD1.all = *Tx_DataPtr++; // // Send ID by writing to LINIDNUM register // This causes the ID to be written to the bus. In turn, // this causes both TX and RX ID matches in the slave task // to occur - causing the data in the transmit buffers to // be placed on the bus and also read into the receive buffers // LinaRegs.LINID.bit.IDBYTE = LIN_ID; // 0x3A
Best Regards,
Marlyn
Hi Marlyn,
The customer now sends the header correctly, but the slave does not send the matching message. Do they need to set anything other than LINID (PID)?
When the 2803x sends a message as the host. Suppose 0x01 is the master's control message header (assuming no data), and 0x02 is the message header requesting slave data. When sending a message header, how to judge whether the message is a host control message or a message requesting data? After all, the assignment method of this header is to write the PID into the LINID.
Thanks & Regards
Yale Li
Hi Yale,
The customer now sends the header correctly, but the slave does not send the matching message. Do they need to set anything other than LINID (PID)?
How has the customer setup the IDSLAVETASKBYTE, this is also needed so that the slave knows whether a RX response, a TX response, or no action needs to be done by the LIN node.
Best Regards,
Marlyn
Hi Marlyn,
Thanks for your follow up support! This issue resolved. The reason is that the frame time gap set by the customer is too short. The slave has not responded yet, the master will send the next frame.
Thanks & Regards
Yale Li