https://github.com/andrewgabler/VolvoDI ... Logger.ino
Works to log from my OBD2 port at both speeds just fine
Edit: I did just update this old repo with the file I have been using so this isn't the EXACT code I've been using to test with, but I will go make sure it still works with my car and isn't buggy
Vida CEM swapping
-
andrewgabler
- Posts: 19
- Joined: 1 July 2019
- Year and Model: 2007 S60R
- Location: Minneapolis
- Has thanked: 1 time
-
andrewgabler
- Posts: 19
- Joined: 1 July 2019
- Year and Model: 2007 S60R
- Location: Minneapolis
- Has thanked: 1 time
I'm honestly not sure... how important is that? I just tested the code I shared and was able to log my OBD2 port with it just fine.
Yes it does https://store-usa.arduino.cc/products/a ... edStore=us
Yes it does https://store-usa.arduino.cc/products/a ... edStore=us
Last edited by andrewgabler on 27 Apr 2023, 20:51, edited 1 time in total.
-
vtl
- Posts: 4724
- Joined: 16 August 2012
- Year and Model: 2005 XC70
- Location: Boston
- Has thanked: 114 times
- Been thanked: 605 times
This one is 8 MHz.andrewgabler wrote: ↑27 Apr 2023, 20:47 I'm honestly not sure... how important is that? I just tested the code I shared and was able to log my OBD2 port with it just fine.
You still can use it, at least for 125Kbps bus, but initialize it properly, with MCP_8MHz. For 500 Kbps IIRC 16 MHz is needed.
-
andrewgabler
- Posts: 19
- Joined: 1 July 2019
- Year and Model: 2007 S60R
- Location: Minneapolis
- Has thanked: 1 time
Just edited my post above with the link, yes my CAN Shield for the MKR has the 16mhz oscillator as does my arduino uno can shield
-
andrewgabler
- Posts: 19
- Joined: 1 July 2019
- Year and Model: 2007 S60R
- Location: Minneapolis
- Has thanked: 1 time
I wish I did... an oscilloscope is my next electronics purchase.
I have 1 hypothesis after hooking up a DIM to the CEM.
My Arduino mkr wifi canbus shield has a switch to enable 120 ohm termination. The DIM powers up when I have it connected, but it still wont log. My arduino uno does not have 120 ohm termination and that is the device i have been testing with in the car. When it is hooked up the DIM will not power on.
Hypothesis - The MKR Can Shield has some issue with my code or the board itself. (I fried an mkr with a short a year or two ago and got a replacement. It still SENDS Can messages fine, but I haven' logged with it.)
The UNO doesn't currently work because I do not have 120 ohm termination.
Resolution: I have a number of different cheaper CAN adapters coming in the mail to test with, along with a large array of resistors (including 120 ohm). I will try again with the UNO can shield and termination and report back.
THANK YOU for the patience and quick responses tonight, I am glad I was able to work through this with someone else's guidance
I have 1 hypothesis after hooking up a DIM to the CEM.
My Arduino mkr wifi canbus shield has a switch to enable 120 ohm termination. The DIM powers up when I have it connected, but it still wont log. My arduino uno does not have 120 ohm termination and that is the device i have been testing with in the car. When it is hooked up the DIM will not power on.
Hypothesis - The MKR Can Shield has some issue with my code or the board itself. (I fried an mkr with a short a year or two ago and got a replacement. It still SENDS Can messages fine, but I haven' logged with it.)
The UNO doesn't currently work because I do not have 120 ohm termination.
Resolution: I have a number of different cheaper CAN adapters coming in the mail to test with, along with a large array of resistors (including 120 ohm). I will try again with the UNO can shield and termination and report back.
THANK YOU for the patience and quick responses tonight, I am glad I was able to work through this with someone else's guidance
-
vtl
- Posts: 4724
- Joined: 16 August 2012
- Year and Model: 2005 XC70
- Location: Boston
- Has thanked: 114 times
- Been thanked: 605 times
Get logic analyzer first. Chinese knock offs are as cheap as $10-15 on ebay. Of course, buying a real Saleae or DSLogic is better, both from morale and precision standpoints. I'm pretty happy with DSLogic Plus, but the cracker was initially debugged with a $9.99 knock offandrewgabler wrote: ↑27 Apr 2023, 21:23 I wish I did... an oscilloscope is my next electronics purchase.
-
T5Luke
- Posts: 142
- Joined: 11 November 2020
- Year and Model: S60 T5 2001
- Location: DE
- Has thanked: 11 times
- Been thanked: 130 times
When you connect the CEM like in the sample i provided before, it won't fall asleep, it stays on and send all the time. It just falls asleep if you don't connect the wire for ignition lock. You should hear something clicking if you power the cem.
You have connected this both big pins where the big green connector comes in?
You have connected this both big pins where the big green connector comes in?
-
dikidera
- Posts: 1304
- Joined: 15 August 2022
- Year and Model: S60 2005
- Location: Galaxy far far away
- Has thanked: 67 times
- Been thanked: 175 times
Perhaps the bit timing code is wrong in your Arduino code? There are quite a lot of configuration options for the CAN bus. Bit sampling, synchronization etc.andrewgabler wrote: ↑27 Apr 2023, 21:23 I wish I did... an oscilloscope is my next electronics purchase.
I have 1 hypothesis after hooking up a DIM to the CEM.
My Arduino mkr wifi canbus shield has a switch to enable 120 ohm termination. The DIM powers up when I have it connected, but it still wont log. My arduino uno does not have 120 ohm termination and that is the device i have been testing with in the car. When it is hooked up the DIM will not power on.
Hypothesis - The MKR Can Shield has some issue with my code or the board itself. (I fried an mkr with a short a year or two ago and got a replacement. It still SENDS Can messages fine, but I haven' logged with it.)
The UNO doesn't currently work because I do not have 120 ohm termination.
Resolution: I have a number of different cheaper CAN adapters coming in the mail to test with, along with a large array of resistors (including 120 ohm). I will try again with the UNO can shield and termination and report back.
THANK YOU for the patience and quick responses tonight, I am glad I was able to work through this with someone else's guidance
Btw, when I tested that little Chinese CAN board with 8mhz crystal, it worked okay with 500kbps bus. Not saying it wouldn't have caused issues, but it worked for me.
Now, my advice is to use a dual can hat for RPI or arduino. It's versatile and offers better bang for buck, cause you will eventually need to communicate to both buses, and having two of those flimsy Chinese single CAN channel boards is messy.
I used this CAN hat for RPI https://www.waveshare.com/2-ch-can-hat.htm and it's better in almost every single way, in that it's wired internally to the correct pins, so it's plug n play and has no messy wires.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 1 Replies
- 6431 Views
-
Last post by RickHaleParker
-
- 5 Replies
- 8699 Views
-
Last post by forumoto






