Automotive and Embedded Networks

cancel
Showing results for 
Search instead for 
Did you mean: 

How exact does the baud-rate must be configured?

Hallo!

I have troubles to configure the baud-rate of the CAN-module of the TMS320LF2406 DSP.
I can programm 122500 baud or 127500 baud, but not 125000. What is the tolerance for the baud-rate of the ni-can PCMCIA board?
When I select 125kBaud for ni-can I get an error: stuff or form failure when receiving.

Golubkov Andrej
0 Kudos
Message 1 of 3
(4,976 Views)
If you have to run it at 122500 or 127500 baud, you can manually type in the baud rate. I currently have my card running at 800000 baud which is not a standard baud rate, so perhaps the 122500 or 127500 baud rate will work. attached is the code i used to set the baud rate. (altered for 122500 baud rate)

AttrIdList(0) = NC_ATTR_BAUD_RATE
AttrValueList(0) = 122500
AttrIdList(1) = NC_ATTR_START_ON_OPEN ' CAN Network Interface Object starts automatically
AttrValueList(1) = NC_TRUE
AttrIdList(2) = NC_ATTR_READ_Q_LEN
AttrValueList(2) = 0
AttrIdList(3) = NC_ATTR_WRITE_Q_LEN
AttrValueList(3) = 0
AttrIdList(4) = NC_ATTR_CAN_COMP_STD ' CAN arbitration ID for the standard frame comparator.
AttrValueList(4) =
NC_CAN_ARBID_NONE
AttrIdList(5) = NC_ATTR_CAN_MASK_STD
AttrValueList(5) = NC_CAN_MASK_STD_DONTCARE
AttrIdList(6) = NC_ATTR_CAN_COMP_XTD
AttrValueList(6) = NC_CAN_ARBID_NONE
AttrIdList(7) = NC_ATTR_CAN_MASK_XTD
AttrValueList(7) = NC_CAN_MASK_XTD_DONTCARE

Status = ncConfig("CAN0", 8, AttrIdList(0), AttrValueList(0))
txtStatus = CheckStat(Status, ("ncConfig " & checkCAN)) ' check for errors
If (txtStatus <> "") Then GoTo error:


Hopefully this works for you.

Marty
0 Kudos
Message 2 of 3
(4,976 Views)
Thanks for answering!

I tried to programm this baud- rates however I get an error: Invalid attribute value.

I also compared the CAN frames sended by NI-CAN an DSP- CAN, the are identically but have different baud-rates.
(above I made a mistake I mean not 127500 Baud but 126700 Baud)

I can receive CAN frames transmitted by NI-CAN on the DSP however I can't receive CAN Frames transmitted by the DSP with NI_CAN.

In the documentation of NI-CAN I haven't found anything about the baud-rate tolerance.
0 Kudos
Message 3 of 3
(4,976 Views)