CAN 'listen only' advice - S08DZ

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CAN 'listen only' advice - S08DZ

1,910 Views
donw
Contributor IV

I have not designed for CAN bus before.

Can anyone with CAN bus experience please comment...

 

I want to implement a 'listen only' CAN bus micro board, to pick up

certain known packets of data (vehicle speed info). Not sure of the CAN bus

speed yet.  The packet filtering seems straight forward enough (famous last words?)

 

Is the s08DZ60 the best micro?   (must be in the S08 family.)

Is there any sample code for initilising the CPU clock , CAN module ?

I can't find anything on freescale. ( but as many have discovered before,

their web page search doesn't often find many relevant software App notes! )

 

Added p/n to subject.

 

 

Message Edited by NLFSJ on 2009-05-26 08:33 AM
Labels (1)
0 Kudos
4 Replies

392 Views
Lundin
Senior Contributor IV
Regarding listeners in general:
One thing you should be aware of is that the filters only operate on a software level. That is, -all- CAN-buss messages will pass through the MSCAN controller, though not all of them will reach the software in forms of flags/interrupts. This hardware implementation is a bit unfortunate, as it means that the MCU will clear all CAN messages on the bus and tell the sender of them that "yes I have received your message", even though the message isn't handled by the node.

This can cause troubles when there is just your listener and another CAN node on the bus, because then the other node may think that the CAN bus is operational. If it was just alone on the bus, the CAN controller would have given up sending after 100 something packages.

The S08DZ is an excellent micro, I'd say it is the best 8-bit on the market for automotive apps (I'm actually doing some extensive search among the competitors right now, and they fail to impress).
0 Kudos

392 Views
kef
Specialist I

Lundin, what about listen only mode, in which MSCAN doesn't acknowledge messages and doesn't disturb the bus in any way. Something like automatic baudrate detection wouldn't be possible if there was no listen only mode. What you said applies to listeners that operate in active mode.

I don't think it's bad that all active nodes acknowledge all messages.

Regards

0 Kudos

392 Views
Lundin
Senior Contributor IV
Oh you are right, I had completely forgotten about this functionality! Listen only modes solves all issues mentioned.

---

Regarding automatic baudrate detection, I don't really understand what you mean. Are you suggesting a trial & error method, ie:

set baudrate
see if you get the correct token
if not, loop

That would indeed spam down the bus with error frames if not in "listen only".

A much better way to implement baudrate detection is by connecting RxCAN to a timer input and measure the bit length. Not only is it faster and safer: you can also reuse the same routines for baudrate detection of UART etc. And yet another advantage is variable baudrate: by measuring the time, you can manipulate "tq" (time quanta) of MSCAN and get a baudrate closely matching the one on the bus. Since CAN is pretty picky with baudrate accuracy (I believe the spec says 0.4%), this will further improve the quality of the system.
0 Kudos

392 Views
kef
Specialist I

Of course, timer pin cound be used, when available. You are right, auto could be achieved without listen only mode. (yes, I meant trial and error in listen only mode). Regards

0 Kudos