cancel
Showing results for 
Search instead for 
Did you mean: 

Using CAN on STM32F4 discovery

britchenu
Associate
Posted on June 18, 2012 at 15:24

Hi,

I'm trying to get my two discovery cards to communicate using CAN. It works perfectly when the transmitting card is in Loopback-mode and the receiving card is in Silent-mode, but when I change them to Normal-mode nothing works.

I've read about something called a CAN transceiver, is that something thats already on the discovery card or do I need an external component? Is there some way to make it work without the transceiver?

#can-transceiver-stm32-discovery
3 REPLIES 3
Posted on June 18, 2012 at 20:36

Don't know.

You'd almost certainly need to cross-over the RX and TX if you're crudely wiring them together, although realistically it might expect feed back on the RX side to detect contention on the bus.

The STM3240G-EVAL board uses the TI SN65HVD230 CAN Transceiver.

http://www.ti.com/product/sn65hvd230

Download a manual for the schematic.

Given that CAN is a bidirectional bus, you're going to need a transceiver to get the data on/off the differential pair on a real CAN bus.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
frankmeyer9
Associate II
Posted on June 19, 2012 at 10:58

I've read about something called a CAN transceiver,...

You might need that, check the schematics.

CAN uses pseudo-differential levels, not TTL (or 3.3V).

CANH and CANL have ''mirrored'' signals, CANH between Vdd/2 and Vdd, and CANL between GND and Vdd/2. You can hardly interface this with GPIO directly.

And don't forget a termination resistance an your bus, usually 120 Ohm.

donald2
Associate II
Posted on June 21, 2012 at 03:21

The CAN controller monitors for faults and expects to see it's own traffic.  It also requires at least one listener to provide an ACK response near the end of the frame.

You can test without using transceivers and terminators by creating an AND gate with diodes and a weak pull-up, or perhaps configuring the Rx pin with the internal pull-up and omit the resistor.