FRDM-K64f flexcan oscilloscope not reading

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

FRDM-K64f flexcan oscilloscope not reading

1,055 Views
smith1
Contributor II

I've been working on getting the FRDM-K64f to send out CAN using the flexcan example in the Kinetis SDK. I've disabled the flexcan loopback, but I'm not getting any reading on my oscilloscope unless I put a resistor across the Tx and Rx, but then both readings are the same.  I'm wondering how my setup needs to change.

Labels (1)
Tags (2)
5 Replies

778 Views
egoodii
Senior Contributor III

To support multi-master distributed arbitration and potential collision-effects, CAN is always defined as an 'open collector' (and technically open-emitter for the other wire of the pair) bus.  A transceiver interface, and resistive-termination is REQUIRED, not only to properly terminate the signal impedance, but ALSO to supply the 'return to recessive voltage' across the pair --- nominally two 120ohm parts, one at each end, where 'stubs' are 'limited' to a length defined by the applicable standard and bit-rate.

CAN is also inherently half-duplex, so when the signal on the wire-pair is 'good', your received bit stream WILL (and MUST) contain your TX pattern, plus whatever is sent by 'others'.

Furthermore, for successful CAN message transmission, you MUST have (at least) a second CAN node which is able to fully receive your whole message and 'acknowledge' said receipt, which means at LEAST matching bit-rate +/-0.1%.

0 Kudos

778 Views
ndavies
Contributor V

The CAN controllers usually won't work correctly without a CAN transceiver connected to the RX and TX lines. The transceiver turns CAN TX and RX into the CAN high/Low signals needed by the CAN bus.  The Transceiver normally echos back the data from the CAN high/low info to the RX pin including the info driven on the TX line. The CAN controller will shut down if it tries to drive a recessive bit state on the TX line and doesn't see the recessive bit state returned on its RX line. (that's why adding the resistor across the TX/RX lines made it work.)

Once you get the transceiver in and transmitting, you will then need to bring up a second CAN node. The transmitting CAN node will jabber without a second node on the buss that can acknowledge the message from the transmitting node.

You need a valid CAN electrical buss before you can get the CAN nodes to communicate. They need to be terminated correctly to work.

778 Views
smith1
Contributor II

Thanks, that makes it very clear. So to test it out on a scope, I should hook two transceivers together with the board's Tx and Rx going into one and the scope hooked up to the Tx and Rx of the other one?

0 Kudos

778 Views
ndavies
Contributor V

That will only get you part way there. You need to electrically terminate the CAN high/Low bus between the 2 receivers. Use a 120 ohm resistor between the CAN high and CAN low lines. 

You also need a second active CAN node to ACK the transmitted message. Just having a second transceiver on the bus is not enough. The second module can either be another frdm module or a CAN analyzer tool. The second module must be programmed with the correct baud settings and set to active. If you use a CAN analyzer, make sure you set it to ACK the packets. Without a second live module ACKing the transmitted packet, the transmitter will jabber (pounding out the first message over and over again) until it fault times out. The transmitted flag will never set in the transmitting CAN node. The next message will never get queued. This is part of CANs error handling response. It continues sending out the same packet until another CAN node sees it.

You will see the initial packet on both the TX/RX pins and the CAN high/Low pins of the transmitting transceiver. You can hook the scope up either to the RX/TX lines or differentially to the CAN High/Low lines.

778 Views
smith1
Contributor II

Thank you very much. I unfortunately don't have a CAN analyzer tool or another FRDM board, but I do have a TWR k60f120m with a SER board. I haven't had much luck programming it, but I think I'm gonna try and focus are trying to set that up as my second CAN node.

I really appreciate your help with this, and it has definitely made CAN more clear to me.

0 Kudos