Electronics > Projects, Designs, and Technical Stuff
CAN-bus msg validate, how?
zzattack:
The shield he linked includes a CAN controller (2515).
But to reiterate what's been said a few times now: pick a microcontroller with built-in CAN controller. There's dozens and they're all more capable and easier to work with than a glue solution involving an SPI-CAN 'bridge'.
Logic analyser to look at CAN traffic is possible, but you'll always need at least 2 non-passive nodes on your bus.
DBecker:
Yes, that 2515-based CAN shield will be sufficient. And there are a bunch of sketches that will respond to OBD2 PIDs. I wrote similar code almost a decade ago, before switching to the STM32F103.
As everyone else says, but is easy to miss, you need both terminating resistors and a peer on the CAN bus to communicate. You cannot communicate into an empty bus. The transceiver needs a little bit of a load. The controller expects to see at least one peer pull the bus low just after it has finished transmitting (typically all active peers will do that).
One termination resistor is typically mounted on the ECU, with a second on the module at the far end of the bus. A single resistor works fine for a short bus. CAN bus is so robust you rarely need to be concerned about having one or two (or even three), but you do need at least one.
Even if you have better tools, buy a bluetooth ELM327 OBD2 reader. They are the cheapest CAN diagnostic tool out there, and have a huge amount of support. For $5 you can buy one and a OBD2 connector (or an extension cable). It takes only a few minutes to learn the 'AT' commands to manually send and receive individual CAN packets. Their down-side is a few bugs and dropping with a burst of back-to-back packets, but you'll be pretty far along before that's a limitation.
Another inexpensive diagnostic tool is Sigrok with one of the 8 channel USB logic analyzers. CANL typically has enough voltage swing to look like a single-ended logic signal, and Sigrok can decode it.
Chriss:
--- Quote ---Yes, that 2515-based CAN shield will be sufficient. And there are a bunch of sketches that will respond to OBD2 PIDs. I wrote similar code almost a decade ago, before switching to the STM32F103.
--- End quote ---
If I understand your writing correct, the mentioned CAN Bus shield + my Uno R3 + the sketch what I found would be enough to make a lets say fake ecu who will respond to my ELM327 diag tool if I use the AT commands?
--- Quote ---As everyone else says, but is easy to miss, you need both terminating resistors and a peer on the CAN bus to communicate. You cannot communicate into an empty bus. The transceiver needs a little bit of a load. The controller expects to see at least one peer pull the bus low just after it has finished transmitting (typically all active peers will do that).
--- End quote ---
Lets say, I have a car ecu on bench and connected the ELM327 to the ecu through the CAN bus.
I can read/clear DTC's etc...
Which one of my two devices are the peer?
--- Quote ---Even if you have better tools, buy a bluetooth ELM327 OBD2 reader. They are the cheapest CAN diagnostic tool out there, and have a huge amount of support. For $5 you can buy one and a OBD2 connector (or an extension cable). It takes only a few minutes to learn the 'AT' commands to manually send and receive individual CAN packets. Their down-side is a few bugs and dropping with a burst of back-to-back packets, but you'll be pretty far along before that's a limitation.
--- End quote ---
I have a good quality ELM327 OBD2 reader tool with BT. So, I don't have to buy one.
I was playing with my ELM327 diag tool on the car through HyperTerminal, sent and analyzed the RPM, Coolant Temp etc.
It was fun and worked well. But it bother me to sitting in the car for hours, drain down the battery etc.
It would be most convenient to have something on the bench, especial in the winter time. :D
--- Quote ---Another inexpensive diagnostic tool is Sigrok with one of the 8 channel USB logic analyzers. CANL typically has enough voltage swing to look like a single-ended logic signal, and Sigrok can decode it.
--- End quote ---
I have an original Saleae logic analyzer and a clone one too, both of them are working great but I never tested them on CAN bus.
I heard/read about the Sigrok but did not tried for now, I think the PulsView app from Sigrok is compatible with both of my tools.
Navigation
[0] Message Index
[*] Previous page
Go to full version