Hello,
I've been able to read the MS-CAN (95kbps) in my GM car using the next hardware combinations powered from a laptop's USB port:
-ESP32 devkitc V4 module + SN65HVD230 transceiver
-Arduino Uno + CAN board with controller MCP2515 (+TJA1050 transceiver)
I was also successful reading the LS-CAN (33.3kbps) with the Arduino Uno, by connecting CAN_L to ground and CAN_H to the single-wire bus.
However, when using the ESP32, no data is received, and what's worse, when CAN_L is connected to ground, the speedometer and headunit display (GID screen) get turned off! Why? Edit: I found out disconnecting the TX connection between uC and transceiver stops the problem.
I'm using Sandeep Mistry's Arduino-CAN library, but since it's unmaintained, I have mister0wl's fork which has support for the newer ESP32 chips, that allow configuring lower baud rates (<50kbps)
I was thinking about using the MCP2515 + SN65HVD230, but I'm not sure there are libraries out there that accept this combo along with low baud rates.
Has anyone been lucky doing this with the ESP32?
EDIT: I would like to use the TWAI driver and no 3rd party libraries. Can somebody help me setup the driver for this custom baudrate?
Thanks
Need help reading GMLAN (SW-CAN 33.3kbps)
-
- Posts: 168
- Joined: Sun May 22, 2022 2:42 pm
Re: Need help reading GMLAN (SW-CAN 33.3kbps)
Perhaps I'm oversimplifying, but isn't it "just" augmenting with another timing configuration? Valid values for brp, tseg_1, test_2, sjw, and triple_sampling for the bitrates you're after should be documented somewhere.
Code: Select all
hal/include/hal/twai_types.h
-
- Posts: 4
- Joined: Mon Oct 02, 2023 10:41 pm
Re: Need help reading GMLAN (SW-CAN 33.3kbps)
I have also accessed the GM low speed bus.. .33.3kbps? I believe I did this with same library as you on ESP32, however my other main project uses the 500kbps CAN bus and I am having big problems finding ESP32 Devkit V1's that work... the older ones I have work fine but the newer ones.. only 1 out of 9 work on GM CAN.
They will work if I wire them together and send messages, but only 1 works on the GM CAN network. Wonder if your problem is related. All of my other ESP32 versions work fine *Devkit v4, NodeMCU, etc).
They will work if I wire them together and send messages, but only 1 works on the GM CAN network. Wonder if your problem is related. All of my other ESP32 versions work fine *Devkit v4, NodeMCU, etc).
-
- Posts: 168
- Joined: Sun May 22, 2022 2:42 pm
Re: Need help reading GMLAN (SW-CAN 33.3kbps)
I wonder whether it's possible at all to use the standard CAN controller together with a single-wire CAN transceiver…
-
- Posts: 4
- Joined: Mon Oct 02, 2023 10:41 pm
Re: Need help reading GMLAN (SW-CAN 33.3kbps)
Not sure how to do that.. the ESP32 uses RX and TX to the external CAN transceiver.DrMickeyLauer wrote: ↑Tue Nov 07, 2023 9:33 amI wonder whether it's possible at all to use the standard CAN controller together with a single-wire CAN transceiver…
-
- Posts: 168
- Joined: Sun May 22, 2022 2:42 pm
Re: Need help reading GMLAN (SW-CAN 33.3kbps)
I guess this is no problem. I have checked data sheets of some single wire CAN transceivers and it looks like it's only the physical layer that's different. From the controller side, it's still RXD/TXD.
Who is online
Users browsing this forum: No registered users and 138 guests