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,
I am trying to use the LIN in master mode. I have a microcontroller as a slave which I can send a message to with "linSendHeader(linREG1, 0x28)". However, when I send the response to the master, the (linREG1->FLR & LIN_RX_INT) == LIN_RX_INT) does not hold. However, when I send the response as a [break, sync, ID, data] sequence, it is detected and the data bytes are set in the RDx register.
I have two questions:
1) Do I need a special tranceiver to use the TMS570LC4357 board as master?
2) Shouldn't the master be able to detect the response just as data (i.e. there should be no need for break, sync, ID sequence), however, it seems to be so, or else it is acting as a slave...
Thanks
SA
Hi QJ,
Does this mean when I set LIN1 in TMS570LC4357 as master, it can also receive frames as slaves (i.e. detect the break, sync, ID ... sequence)? If so and I want to use it as master, how can I receive payload+checksum using the Halcogen's generated API? I see there is a function linGetData(linREG1, data), but this only worked when I sent the whole frame (including header).
Can all this be because I am not using a transceiver connected to the Hercules board?
I have a http://skpang.co.uk/catalog/linbus-breakout-board-p-1417.html
If I connect this as master to my Hercules LIN1 pins, will I be able to receive payload+checksum response, after I have sent a header to a slave node?
Hello SA,
Any slave, including the slave task in the master control unit, can respond with a data frame. Only one slave can respond to each identifier.
The master can transfer data to any number of slaves through its slave task. i.e. the master’s slave task responds to a header (sent by the master task of master) and transmits data on to the bus. All other slaves can simultaneously receive the data frame.
Yes, linGetData(linREG1, data) can be used to receive data. I am not sure if the LIN module can get the correct data without the LIN transceiver.
Hello SA,
The LIN transceiver is required for LIN module (in MCU) to interface the external LIN bus.
The LIN message header is sent by the master task, and used for synchronization. The message response is sent by a slave task, and the message response contains the data and the checksum. The payload is 1 to 8 bytes. Your issue might be caused by the lack of the LIN transceiver in your LIN network.
Hi QJ,
Yes that was my problem as I already explained. I have another issue now. When I use the linSend() function from HL_lin.c, does this cause sending the checksum as well? I can see in the documentation that the transmit and receive buffers (SCITXSHF, SCIRXSHF)have checksum calculator. Does this mean the checksum gets sent after 1 to 8 data byte automatically and I do not need to calculate and send the checksum to the LIN bus?
SA
Hi QJ,
I have another question now. When I try the linsend() function I can see the same data on both RDx and TDx. Why and how does RDx get the data I am sending out? My node is configured as master (this only happens when I have a connection to RX pin on the board, i.e. a wire going out from RX pin to LIN transceiver).
Also there is no possibility to enable the TX interrupt on HALcogen. Does this mean I do not need to implement the ISR for TX?
Best,
Sahar
Hello SA,
The LIN message on LIN bus will shift into the RX buffer automatically. We are not able to disable it.