09-16-2009 04:31 AM
Hi,
I'm trying to run diagnostic communication with USB8476 LIN interface.
For that I use "LinMasterSendFullFrameAnd Receive.vi" (under LW7.1).
NI-CAN driver is 2.6 .
Please see attached screenshot of the result:
- what does LinBusError 10 40 01 02 mean ? (it is not listed in NI documents)
The same frame returns correct response BUT with Vector CANCardXL interface.
Thanks in advance
09-16-2009 09:12 AM
Apparently the documentation needs to be updated to include a missing error frame. I have filed the relevant requests to have that done.
The error should be documented as:
Error Name Error Code (hex) Description
LinBusErrorTxSyncTimeout 1040 The LIN interface master task attempted to send a
sync byte and did not self not receive the sync byte
within the timeout period.
If you have a scope, you could look at the LIN bus to see what it looks like. Do you see a proper SYNC byte (0x55) go across the bus after the break?
If I were to make a guess, I would assume that you are overterminating your bus. I see that you have termination enabled on board. Do you also have termination in your cable or somewhere else on the bus? If you had too much termination, it could degrade the signal and that could cause the LIN transceiver not to self-receive. I would try disabling termination (checkbox in upper left corner of example).
09-16-2009 10:20 AM - edited 09-16-2009 10:20 AM
Yes, I see 0x55 sync byte after ~800us break field...
Voltage level is OK too...
I don't use any additional terminated resistors ...
I tried with switched On/OFF SW termination but result is the same...
When compare both oscillograms, USB8476 and CANCardXL, it seems there is a difference in baud rate (or interbyte space ?) - it is difficult to fix it... But voltage level is OK for both...
09-16-2009 10:33 AM
09-16-2009 10:42 AM
... Here is attached a full frame sent:
- by USB8476
- by CANCardXL
09-17-2009 07:47 AM
From what I can see, they both look like they are running at the same baud rate. The differences from what I can see is that:
NI: 13-bit time break, ~80us extra space between each byte
Vector: 19-bit break time, 0us space between each byte
The LIN spec calls for a >= 13-bit break time, so both are in spec
The LIN spec calls for the total time of a transfer to be <= 1.40 * minimum time. If a byte takes ~520us at 19.2kBaud, this allows for each byte to take ~208 extra us. The 80us of the NI board is well within tolerance.
I am seeing the waveforms look a little different, but both of them appear to be fully within spec and I would expect them both to work.
09-17-2009 08:15 AM
Hi,
Meanwhile, I modified VI by adding header sent after full frame (see attached .zip)...
But first, second, and sometime third run of .vi gives 0x8400 error (see attached "LinBusErr"screenshot) ... after that correct frame is received (see "LinBusOk" screenshot) ...
Can You look over .vi ???
May be something is wrong ???
09-17-2009 01:07 PM
09-18-2009 02:24 AM
Electronic module for car wiper motors...
LIN tranceiver - TJA1020, ST microcontroller...
Only diagnostic frames are used - DLC = 8, MasterRequest=0x3C, SlaveID=0xA0, SlaveResponse=0x3D
Request frame to sent is: A0 02 10 84 FF FF FF FF
Positive response is: A0 02 50 84 00 00 00 00
Negative response is: 7F 10 F0 00 00 00 00 00
To get postitve response, module power must reset (power on/off) ... But positive response is obtained after 2...4 times request sending followed by LIN bus error 84 00...
After positive response is get, each frame request returns negative response ...
In short: LIN bus error 84 00 ... is returned only after slave power reset untill positive response is returned.
09-18-2009 07:42 AM
How does that behavior differ from the Vector behavior? The 84 error just means that the slave didn't respond. Is it possible that the slave takes a certain amout of time to startup and until that time, it is not really doing LIN communication? That explains the 84. Then, it returns 1 positive and N negative responses.
If you power cycle the hardware and then wait a couple minutes, does it follow the same trend?