9 years, 5 months ago.

is my mbed microcontroler ok ?

Hi,

I followed the exemple for the can Hello world (http://developer.mbed.org/handbook/CAN).

But after launch the Loopback example, the Mbed can't read nothing. If I have a look on the signal on the pin 10, I have nothing, Just a 3v3.

If i switch the can1 and can2 to write from p29 CAN can2(p9, p10); CAN can1(p30, p29);

i can see : /media/uploads/julienB/scope_0.png

Do you think I can have a problem with my board ?

Thanks Julien

Mbed NXP LPC1768 Transceiver mcp2551

Question relating to:

2 Answers

9 years, 5 months ago.

Hi Julien,

Here's a few thoughts -

  • Is your wiring like that shown at Handbook - CAN?
  • There might be some tips on this page CAN - Getting Started, but with the scope you have access to, you might be well beyond anything you'll find there.
  • If you disconnect the transceivers completely, and create a simple test program to wiggle the pins directly as DigitalOut lines, you might be able to see if they are working ok.
  • Is your module on a PCB where there might be another circuit (or a short circuit) on any of those pins?
  • If it is in a white protoboard , then perhaps the protoboard has a short - remove your module and test w/o the proto.
  • Can you share your code in case there is subtle error we might spot?
  • The scope trace you provided doesn't look like a CAN packet to me. Even w/o knowing what message ID and Data you tried to send, it doesn't look familiar. CAN will automatically append a CRC, so even if you were sending "FF" and the occasional pulse were a "stuff bit", I would expect to see something more complex near the end of the frame where the CRC would be. See the example diagram: Wikipedia - CAN Bus, and scope traces on Kvaser - CAN tutorial (you need to look at slide 6 for scope traces).

Accepted Answer

the code and the wiring are exactly like that shown at http://developer.mbed.org/handbook/CAN

- My module is on a white protoboard.

- if I disconnect the transceivers completely and connect directly the pin 9 to the pin 29 and the pin 10 to the pin 30, the Loopback example doesn't work. I tested it without the white protoboard.

- with a simple test program to wiggle the pins directly as DigitalOut lines, I can see the value change.

- I agree with you. The scope trace I provided doesn't look like a CAN packet. So I ask me if my mbed board don't have problem with CAN protocol.

posted by julien bertaud 03 Nov 2014
9 years, 5 months ago.

Did you check all the wiring? Are the two terminating resistors in place?