| Electronics > Projects, Designs, and Technical Stuff |
| CAN-bus msg validate, how? |
| << < (3/5) > >> |
| max_torque:
BTW, it sounds like you are effectively trying to reverse engineer the CAN reflash protocol, and if so, the best thing to do is to buy a cheap s/h ecu and power it up on the bench from a power supply, so you an play around trying to gets coms working to that unit without either having to be sat in an actual car, and without other risks (such as bricking the ecu, or setting off the airbags un-expectidly......) |
| HwAoRrDk:
Yes, if all OP really wants to do is capture and inspect the CAN bus traffic generated by diagnostic software or standalone tool, then it's not worth going to the effort of messing around building custom hardware. OP mentions that they have a logic analyser. Does it have capability to do CAN decoding? If so, just hook one of its channels up to the CAN_L line and capture the traffic. I also second the very cheap option of using an ELM327-based USB/Bluetooth OBD adapter (even the $5 clones). No special software needed, just use a serial terminal to connect to the COM port and issue AT commands to have the ELM327 monitor CAN bus messages. You can even use one outside of a vehicle by just supplying 12V power to the appropriate pins, plus the CAN lines from the diagnostic tool. But as Rerouter said, can be difficult trying to log a busy bus with limited serial bandwidth between the ELM327 and PC - it won't be able to spit out the messages it captures fast enough. P.S. do not try to directly connect a PC's RS232 port to a CAN transceiver chip. RS232 signal voltage levels can be up to +/-15V, although I would expect a PC's RS232 port to be somewhere between +/-5V and +/-12V. Because of the voltage levels it will potentially damage the transceiver, as they commonly expect signal levels on the RX/TX pins of 0-5V. And, in fact, those CJMCU-230 breakout boards using an SN65HVD230 operate at 3.3V, so are not suitable full-stop if the RS232 signal levels are at any voltage above that. |
| Jeroen3:
Why does everyone want to reinvent this! :palm: Just go buy a CAN to USB interface that is supported in Busmaster. https://github.com/rbei-etas/busmaster/wiki/Hardware-support Kvaser is easy to use with their driver, and you can run multiple programs on one interface via their shared driver. I think PEAK made something similar via some server type app recently as well. |
| Chriss:
The major task of my project is to learn something, something new to me, about the CAN-bus. I don't wish to reversengeneer anything, don't want to make any commercial device or similar. I wish to setup a CAN "playground" for me on the bench and study it, programming it, playing with it during the winter time. As I described before, I wish to build up the stuff from what I have in my pocket right now, but ok, I learned something new again. My transreceiver is not a version which I should have. Maybe a better option will be a MCP2515 CAN Bus Module TJA1050 receiver. I'm familiar to write programs for uC ( my optionis AVR ) in C language. I played around with Arduino and have one Arduino UNO R3 boar laying around, but I don't like Arduino too much. I'm not an Arduino hater. Yes, I have a logic analyzer where I can easy hook up the CAN bus ad select CAN bus package analyzing option in the logic analyzer, but it is, again, more fun to make something from what I can learn. :) Anyway, what hardware would I need to setup my project for CAN similarly described on my pic? Even if you say I should go to arduino, ok I will do it with it. Many thanks for every words, I really appreciate it. My best regards. |
| Jeroen3:
To get your own interface you need the layer 1 tranceiver (eg: MCP2551) to get from a differential shared line to single ended split lines TX and RX. These go into a CAN controller which is often embedded in the microcontroller. It is difficult to do in software due to the CRC and arbitration timings, don't try. Then from your CAN controller you can send and receive messages by software. Often trough some form of "mailboxes" of fifo architecture. as well as reading the error counters and such. This is your layer 2. There are no more layers in "CAN bus" strictly ISO 11898. Further layers are J1939, CANopen or DeviceNET. These give meaning to the data inside the CAN frame. But a vendor can also use something entirely proprietary! Even when using one of above protocols the actual implementation will vary widely between vendors and devices. To get started with CAN bus just get any ST-NUCLEO, I think all ST chips have a CAN controller. You only need to add the transceiver. Or an MBED, many also include a CAN controller. Off-chip CAN controller like the MCP2515 might work as well, but is software-architecturally more difficult to get running. And quickly limited in messages per seconds due to the SPI link. |
| Navigation |
| Message Index |
| Next page |
| Previous page |