ikalogic

Open full view…

How to decode CAN bus CAN_H/CAN_L?

Dave Comer
Mon, 05 Feb 2018 18:10:06 GMT

Ibrahim, Hi. Hopefully this isn't a dumb question. I am learning how to script, but am not yet proficient. In the mean time, I was attempting to use the script you wrote for the CAN bus. It appears that the intent in that script is to use the post physical CAN signals (i.e. the data from a CAN transceiver, not the differential signals, CAN_H/CAN_L) that are input directly to a micro-controller? I assume that is the case as there is only one logic trace, on channel 1, whereas if CAN_H/CAN_L were being monitored, you would have two channels. That being the case, is there an existing script to decode and display CAN_H/CAN_L right on the CAN bus? Is that possible with the ScanaQuad? That's what I am seeking to write or use. Thanks, Dave

Ibrahim KAMAL
Tue, 06 Feb 2018 10:29:39 GMT

Hi, Not a dumb question at all :) There are two ways you can capture CAN signals. 1- Connect to the "post CAN signals", that is, on the CAN high and CAN Low lines. In that case, ScanaQuad need to be configured to use 2 channels as differential channels. The result (the difference) will appear to ScanaStudio as only 1 channel. 2- Connect to single ended, CMOS level CAN signal, and here again, you are looking at only one channel. In other words, low level CAN signals are more "analog" state than a digital one, and logic analyzer only "sees" the digital signals, converted to single ended. Allowing you to connect directly to the differential signals is only a comodity in case you only have access to CAN H and CAN L, but at the end, it's all converted to digital single-ended signals. Hope my answers didn't make things even more complicated :)

Dave Comer
Tue, 06 Feb 2018 15:19:33 GMT

Cool. I will give the differential path a go. Thanks for the quick response. Dave

toumasu
Wed, 22 May 2019 05:33:50 GMT

Hi Ibrahim (or anyone), I am trying to decode CAN signals with the ScanaQuad SQ25 which doesn't supprt differential so I hooked it up to the can tx pin of the MCP2515 which i can read in loopback mode in linux. I tried using trigger on rising edge and trigger on logic change but in both cases it keeps waiting for trigger when I send can messages. Can you help me? Thanks

Ibrahim KAMAL
Wed, 22 May 2019 07:03:53 GMT

Hi toumasu, That's indeed strange. What is the (logic high) voltage level on the TX pin of the MCP2515? Are you ablse to capture some signals (even flat signals) and see if you get a flat logic high signal?

toumasu
Wed, 22 May 2019 07:39:18 GMT

Hi, thanks for your reply. well, if i connect the 'probe' to the MCP2515's Vdd i can measure 3V3 so i should also expect a signal varying between 0V and 3V3 on the TXCAN when i send a can message. FYI The MCP is part of a PiCAN2 HAT on a raspberry pi 3 which has the on-board termination resistor enabled and is connected to the can bus of an LPC11C24 devkit which also has an on-board Rt. I'm also unable to read the message sent from the LPC using the demo program so I'm pretty clueless. Unfortunately i don't have an oscilloscope here so i can't check the signals leaving the bus interface [IMG_20190517_005532 (1)](//muut.com/u/ikalogic/s3/:ikalogic:h0Rm:img_20190517_0055321.jpg.jpg)

Ibrahim KAMAL
Wed, 22 May 2019 11:23:37 GMT

I'm pretty sure the SQ25 should see toggeling signals on the TXCAN (if it's toggeling between 0 and 3V). So what do you get in ScanaStudio if you just run a capture without any trigger?

toumasu
Wed, 22 May 2019 14:07:25 GMT

Well, I am now able to capture something when i send a can message. I also notice that after sending, the bus goes to off state for some reason.. but here's an image of the captured signals, there are blocks with widths of 50.000us and 50.040us. bitrate should be 500000bps. Anyway i'm thinking theres something wrong with my hardware but i'm not sure what. It would also come in handy if i could generate CAN signals with the SQ25 but i haven't seen that script in the repo [Can](//muut.com/u/ikalogic/s3/:ikalogic:uz3e:can.png.jpg)

toumasu
Wed, 22 May 2019 14:39:51 GMT

the image appears to be broken in my reply [Can](//muut.com/u/ikalogic/s3/:ikalogic:5b71:can.png.jpg)

Ibrahim KAMAL
Wed, 22 May 2019 14:42:18 GMT

Can generator is comming soon :) I'm working on it as we speak...

toumasu
Wed, 22 May 2019 15:15:49 GMT

that's great, thanks and keep it up!