Hello everyone,
How can I read data on CAN bus at speed 100kbps? Enumerator “ControllerAreaNetwork.Speed” has only 1000, 500, 250, 125kbps values.
Example:
var can = new ControllerAreaNetwork(ControllerAreaNetwork.Channel.One,
ControllerAreaNetwork.Speed.Kbps125);
Is there some way to read CAN bus at 100kbps?
There si overload method, but I do not know timing parameters:
var timings = new ControllerAreaNetwork.Timings(15, 8, 7, 20, 1);
var can = new ControllerAreaNetwork(ControllerAreaNetwork.Channel.One, timings);
CiA Draft Standard DS-102 states “100kbps is not recommended for new development” without giving any explanations. I guess that’s why it is not in the enumeration.
Ok,
my input clock frequency is: 6MHz.
Desired CAN bus bit rate is 100kbps.
I am confused in parameters of method “ControllerAreaNetwork.Timings”. Method has these:
int propagation
int phase1
int phase2
int brp
int synchronizationJumpWidth
Calculated result table has: (http://www.kvaser.com/support/calculators/bit-timing-calculator/)
T1: the number of quanta before the sampling point.
T2: the number of quanta after the sampling point.
BTQ: the number of quanta per bit.
SP%: the position of the sampling point, in percent of the whole bit.
SJW: the Synchronization Jump Width.
Bit Rate: the resulting bus speed, in kbps.
Err%: the deviation, in percent, from the desired bit rate.
BTR0: Bus Timing Register 0, in hex, for 82527/SJA1000/82C200/compatible.
BTR1: Bus Timing Register 1, in hex, for 82527/SJA1000/82C200/compatible.
What is what? I’m sorry, I’m not CAN BUS expert. Thank you!
I have only two nodes. Now, distance between them is about 10m, but at the end of debugging it will be 0,5m. Terminators are on both devices and both have 120ohm.
The second device is Inverter and is connected to solar panels. I am trying to read some values as actual supplied power and so on… I know, and on the oscilloscope I can see it, that bit rate is 100kbps. Connection is made with two wires. CANL is connected on CANL and CANH is connected to CANH. It seems that everything is OK. Have you some advice please?