I think I CAN, I think I CAN... Topic is solved

RetroZero
Posts: 731
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 332 times
Been thanked: 44 times
Contact:

Re: I think I CAN, I think I CAN...

Post by RetroZero »

Well, three long days later, downloading SavvyCAN, STMCubeIDE and ArduinoIDE to convert STM to Arduino, and watching Damiens simple download video(vimeo), I hang up my gloves at 01 am. May there be a lightning bolt with divine intervention....

EDIT - after half a day more, I'll have to ask the stupid questions.
1: Can a STM32F33 Nucleo F334R8 be used to set up a CAN analyser?
If yes, HOW?
I have installed STMCubeIDE, ArduinoIDE, SavvyCAN, jonvolks GVRET files and I don't know what else.
I have attempted Damiens simple Command update via his vimeo video, but the device is not detected at the end (all the rest is as per his explanations)....
I tried to install the GVRET files into ArduinoIDE as per another website I fell onto in the early hours of the morning, but get message error at the end

Should I buy an Arduino Due and get on with it? There are examples of STM CAN programmes, but I assume they will not work without the magic GVRET files....
User avatar
Gregski
Posts: 2273
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 329 times
Been thanked: 451 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

RetroZero wrote: Sun Jul 30, 2023 10:44 pm Well, three long days later, downloading SavvyCAN, STMCubeIDE and ArduinoIDE to convert STM to Arduino, and watching Damiens simple download video(vimeo), I hang up my gloves at 01 am. May there be a lightning bolt with divine intervention....

EDIT - after half a day more, I'll have to ask the stupid questions.
1: Can a STM32F33 Nucleo F334R8 be used to set up a CAN analyser?
If yes, HOW?
I have installed STMCubeIDE, ArduinoIDE, SavvyCAN, jonvolks GVRET files and I don't know what else.
I have attempted Damiens simple Command update via his vimeo video, but the device is not detected at the end (all the rest is as per his explanations)....
I tried to install the GVRET files into ArduinoIDE as per another website I fell onto in the early hours of the morning, but get message error at the end

Should I buy an Arduino Due and get on with it? There are examples of STM CAN programmes, but I assume they will not work without the magic GVRET files....
sorry you have to go through all of that, but greatly appreciate the feedback and I would like to share / say this, this is the reason for this thread, we as EV builders / converters will face steep learning curves, in my opinion the best thing to do is throw some money at it and get the best tools for the job, since the OEM Arduino Due board has TWO Controller Area Network (CAN) controllers built into it - but no transceivers, and you already have SavvyCAN the software I highly recommend one of the modded Due boards from EVTV which they added a Texas Instruments CAN transceiver on the board to enable the CAN controller in the SAM3X microcontroller chip allowing direct CAN communications.


EVTVDue Microcontroller for $100 bucks, think of it as thanking them for SavvyCAN
EVTV DUE.jpg

OR, get their dual channel board


1 CANKIT - CANbus kit with Microcontroller and Cable for $150 bucks
CANDue2.2small_medium.jpg


cause you will spend that much to roll your own as this is the only decent shield like CAN adapter for the Due board COPPERHILL TECHNOLOGIES Dual CAN Bus Interface For Arduino Due With Extended Power Range and runs $50 bucks alone
apioiyr6z__39720.jpg
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
RetroZero
Posts: 731
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 332 times
Been thanked: 44 times
Contact:

Re: I think I CAN, I think I CAN...

Post by RetroZero »

OK, looks like it will be that way then. I felt like I was so close. I got the Nucleo board to communicate with my pc and I learnt how to upload examples like making an LED blink (need to find a LED to confirm it worked) but the comms LED was flashing during the download, and a positive confirmation was received at the end. That's a giant step for me!
I'll play with ArduinIDE to see if I can do the same, even if only for practising, but my aim is to get CANning asap. Would like to implement an onboard OEM charger....amongst other things. There's a certain ID4 battery that requires data packs from a host, would have liked to help out ,but my setup and (lack of) knowledge has set me back.
User avatar
Gregski
Posts: 2273
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 329 times
Been thanked: 451 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

RetroZero wrote: Mon Jul 31, 2023 8:45 pm OK, looks like it will be that way then. I felt like I was so close. I got the Nucleo board to communicate with my pc and I learnt how to upload examples like making an LED blink (need to find a LED to confirm it worked) but the comms LED was flashing during the download, and a positive confirmation was received at the end. That's a giant step for me!
I'll play with ArduinIDE to see if I can do the same, even if only for practising, but my aim is to get CANning asap. Would like to implement an onboard OEM charger....amongst other things. There's a certain ID4 battery that requires data packs from a host, would have liked to help out ,but my setup and (lack of) knowledge has set me back.
you fought a good fight, this is why there are CAN Bus Support Groups, we meet at a Pub near you every Friday and Saturday nights, it is completely anonymous, join us !
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
RetroZero
Posts: 731
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 332 times
Been thanked: 44 times
Contact:

Re: I think I CAN, I think I CAN...

Post by RetroZero »

Cool, I'll look out for the guy on crutches then 😂
User avatar
Gregski
Posts: 2273
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 329 times
Been thanked: 451 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

so I plan to use this COPPERHILL TECHNOLOGIES Dual CAN Bus Interface For Arduino Due With Extended Power Range doodad to control my first gen Chevy Volt onboard charger (yes the VCU can run the code to charge it but for Phase I, I prefer to have some isolation)

Initial thoughts, I know this is a dual CAN piece of machinery so I was wondering what the third smaller green connector was for and it appears as though it is for power, ie 7-36 volts DC and ground, well why didn't they just pull the power from the Arduino Due "mother board" why do I have to supply separate power to this animal?

uno.jpg

Looks like they Uno reverse carded us:

"In order to more efficiently serve automotive and industrial applications, the JCOM.CAN.DUE-X board supports an extended input power range of 7 to 36 VDC to power the entire system, i.e. including the Arduino Due itself."


IMG_6282.JPG
IMG_6284.JPG
IMG_6286.JPG
IMG_6290.JPG
IMG_6288.JPG
IMG_6298.JPG
IMG_6300.JPG
"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
User avatar
uhi22
Posts: 601
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 91 times
Been thanked: 413 times

Re: I think I CAN, I think I CAN...

Post by uhi22 »

I had two surprises regarding CAN transceivers, and these are totally unexpected, so I will share here:
1. I ordered some SN65HVD234 CAN transceivers from Aliexpress, use them according to the data sheet with Enable pin connected to 3.3V. And what they are doing? They do not drive the CAN lines to a dominant level, they just mirror back on RXdata what the controller sends on TXdata. Means: Some kind of loopback mode. According to data sheet, this type should not have such a mode. The only explanation which I have, is, that they sell wrongly labeled parts. By pulling the EN pin to ground they work.
2. I ordered the cheap CAN transceiver boards from Aliexpress, they contain a SN65HVD230, and a 10k resistor between pin 5 pin 8 and ground. This looks good, it should enable the slope control. But what does the board? It routes the traffic from CAN to CANRX, the controller tries to send the ACK bit on CANTX, but the device does not send the dominant levels on CAN for the ACK. The device is in some kind of "listen only" mode. This is not according to the data sheet. I tried the "strong pull down" (grounded) on the pin5 pin8, and with this setup, the transceiver works as intended.

My conclusion: It is possible to spend a lot of time searching at the wrong place. Nothing works, and at the end it is just a wrong IC. Measuring the lines with an oscilloscope (two channels are sufficien) is from my PoV the only way to find such an issue.

Here I found the data sheets:
https://www.ti.com/lit/ds/symlink/sn65h ... 1742624106
User avatar
Gregski
Posts: 2273
Joined: Tue Sep 14, 2021 10:28 am
Location: Sacramento, California
Has thanked: 329 times
Been thanked: 451 times
Contact:

Re: I think I CAN, I think I CAN...

Post by Gregski »

So this wonderful CAN Logger 6000 Part 1 video was just recommended to me by the YOuTube Al Gore rhythm, I hope you find it informative:


"I don't need to understand how it works, I just need to understand how to make it work!" ~ EV Greg
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: I think I CAN, I think I CAN...

Post by arber333 »

uhi22 wrote: Fri Aug 11, 2023 1:05 pm I had two surprises regarding CAN transceivers, and these are totally unexpected, so I will share here:
....
Here I found the data sheets:
https://www.ti.com/lit/ds/symlink/sn65h ... 1742624106
That are some of the exact symptoms i have here with my boards. When i need to innitialize can bus i dont get any confirmation back and nothing moves. I will test now with enable pin to gnd and floating... will get back.
mario
Posts: 23
Joined: Fri Dec 14, 2018 10:20 pm
Has thanked: 69 times
Been thanked: 10 times

Re: I think I CAN, I think I CAN...

Post by mario »

2. few years back, I had problems with those ali boards too. Ended up replacing SN65HVD230 chip with SN65HVD234 and it worked OK.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: I think I CAN, I think I CAN...

Post by arber333 »

mario wrote: Mon Aug 14, 2023 11:19 am 2. few years back, I had problems with those ali boards too. Ended up replacing SN65HVD230 chip with SN65HVD234 and it worked OK.
Yes i specificaly made design for 234 but i managed to use 230 with it all the time. I guess i met those versions which have inverted logic...
RetroZero
Posts: 731
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 332 times
Been thanked: 44 times
Contact:

Re: I think I CAN, I think I CAN...

Post by RetroZero »

Gregski wrote: Mon Aug 14, 2023 4:08 am So this wonderful CAN Logger 6000 Part 1 video was just recommended to me by the YOuTube Al Gore rhythm, I hope you find it informative:

I saw this before going and getting into Mooc's on how to make a CAN logger etc. As I don't see it on Damiens webshop, and I am too stupid to get onto Discord, I assume it's not yet up to a plug-in and play status. I have made HUGE steps for mankind - I made the internal LED on my Nucleo board blink, and then coded and external LED to switch on. This is big stuff for me, so next will probably be reading CAN or something. And yes, I could just buy EVTV one, but that's too easy.
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: I think I CAN, I think I CAN...

Post by arber333 »

@uhi22: Did you test those faulty SN65HVD234 aliexpress chips on polarity of Enable pin? I am interested if they would work with Enable pin floating?
User avatar
uhi22
Posts: 601
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 91 times
Been thanked: 413 times

Re: I think I CAN, I think I CAN...

Post by uhi22 »

Just tested more deeply. With unconnected enable pin, the communication works. Then connected a multimeter between enable and ground. It shows zero voltage, and still the communication works. Third test, measure the resistence between enable and ground. It is 165kOhms, no matter whether the device is powered or not.
Conclusions: it has an internal pulldown resistor and works fine when leaving the pin open.

This is the strange device:
image.png
And this is the other from the transceiver boards:
image.png
User avatar
uhi22
Posts: 601
Joined: Mon Mar 14, 2022 3:20 pm
Location: Ingolstadt/Germany
Has thanked: 91 times
Been thanked: 413 times

Re: I think I CAN, I think I CAN...

Post by uhi22 »

I'm on the way of sorting out the possibilities to observe and to transmit CAN message from the notebook. Is there already a wiki page regarding this? Or other threads? So far I did not find a good starting point. Maybe we should create one.

This is what I found out so far, to reach a working setup for CAN communication on the notebook:
- SavvyCAN is an open-source application with a lot of features, like recording, replaying and graphing CAN traffic. The documentation is here: https://www.savvycan.com/docs/
- We need an interface hardware to connect the CAN to the notebook. There a many solutions, and for me the search criteria was: It needs to be cheap, in best case self-made, easy to modify. I found the ESP32RET project, which is an ESP32 using the internal CAN (and external, SPI connected additional CANs if wanted), and connects via Wifi to the notebook. This sounded great, I had an ESP32 flying around and attached a 3.3V CAN transceiver. But the results were "mixed", I was not able to create a stable setup. So I used to the ESP32RET software as a basis and created a simplified version, which runs on an ESP32s3. It is maximum simplified: only one CAN, no bluetooth, no LEDs, hard-coded to use one existing Wifi network.

The hardware is quite simple: An ESP32s3 dev board and a CAN transceiver, plus power supply. Well below 20 Euros.

The project is stored here: https://github.com/uhi22/wifican

Using the combination of SavvyCAN and wifican I was able to send and observe CAN traffic with the notebook.

The big surprise of SavvyCAN for me was, that it is able to use DBC files. These are defining names, scalings and units for the signals on CAN. And the best is, SavvyCAN does not only use DBCs for graphing, it also contains an editor to create your own DBC files. Quite impressive and helpful.
Post Reply