CAN configuration bug

Post Reply
Bernard Leak
Posts: 18
Joined: Fri Aug 15, 2008 3:42 pm
Location: Armitage, Staffordshire, England

CAN configuration bug

Post by Bernard Leak » Wed Apr 20, 2011 1:33 pm

See also my changes to
http://www.kerhuel.eu/wiki/Block/CAN_Configuration
These include suggestions for better prompts in the block's masked parameter
dialogue.
In particular, note
'Progagation' should be 'Propagation'
(and 'bits' should be 'quanta').

'Baud Rate' should be 'Baud Rate Prescaler - 1'
I was thoroughly confused by 'Baud Rate'!
Note the - 1! N in this field is the value
written to the register, when the oscillator
rate is reduced by a scale factor of (N + 1).

If you don't mind breaking backward compatibility,
it would be best to let this parameter be like the
segment lengths, set to match the actual
ratio used rather than the register setting

Now the important bit:
The CAN frequency is wrong (on all
CAN modules I know about, including
the PIC30f6014a). You've added
together the propagation and phase buffer
segment lengths and added 2: but you
should only add 1. Perhaps you counted
the synchronisation quantum at both
ends of the bit? It is 'between
bits' and should only be counted once
for each bit in determining the baud
rate.

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests