946Views10Replies

Author Options:

Anyone with experience with CAN bus + Teensy 3.6? Answered

I have been recently messing around with the Teensy 3.6, of which the MK66FX1M0VMD18 it's rocking is probably one of the most powerful microcontroller I have ever messed with. (180MHz ARM Cortex M4, 256K RAM, hardware FPU, far more than enough GPIO, and an insane amount of serial interfaces!)

I am particularly interested in the 2 CAN bus interfaces that it's sporting. However when loading the example code (which explicitly states it is only compatible with the Teensy 3.6! as only it has 2 CAN busses) I have not had much luck getting it to work.

I don't really understand what CAN_TX and CAN_RX are suppose to be. I would assume it is simalar to UART where TX is connected to RX and RX is connected to TX. However at least with the MCP2551's I also ordered, the RX (on this chip) is actually an output while the TX appears to be an input. As it turned out, I was not able to use this chip due to it being a strictly 5V logic component.

So after having discovered that, I decided to just connect the TX of CAN1 directly to RX on CAN0, and vice versa. Using the Object Oriented CAN example, I get absolutely nothing. If I swap the connections, connecting the low-impedance TX to the other low-impedance TX, and RX to RX, I also get nothing, but if I bring my hand close to the wires, or touch and feel around some of the pins, I will get some packets through and to appear on the serial monitor, almost as if one of the pins is acting as an input and of course it's floating because I don't know which pin that would be, as there is no code or comments to indicate such a button. I honestly have no idea what the hell is going on, and don't have access to a proper scope to see what is going on.

Discussions

0
None
rickharris

1 year ago

There are a LOT of web sites that describe the standard. It is apparently hard to access because the buss is 2 way ie you have to interrogate it for some information.

There are arduino shields out there for this I believe and certainly ready made black boxes that can be interfaced to,.

https://www.google.co.uk/?gws_rd=ssl#q=CANBUS+read...

0
None
-max-rickharris

Answer 1 year ago

Sure, there is plenty of info about CAN itself, but what about the API for teensy or what can rx and can tx denote?

0
None
-max-rickharris

Answer 1 year ago

I know that much, my question is referring to more of the physical layer. tx and tx are def. not the same as can-H and can-L. I would expect I can connect tx directly to rx and rx directly to tx without needing CAN bus transeiver chips, at least for an example test until I get the parts to do it right.

0
None
rickharris-max-

Answer 1 year ago

There are thousands of can bus pages on the web.
http://www.cypress.com/file/127981/download
for example as well as the texas specification for it.
You need to read and read and read through them to understand what it does.

0
None
steveastrouk

1 year ago

Get the MCP 2651 instead, then look at application circuits. And of course, there;s every chance you've cooked the port.

0
None
-max-

1 year ago

Probing around with a few LEDs (my only method currently for measuring signals) I see that the TX rests in the HIGH state, and I guess is active low.