Trying to talk to J1850PWM canbus using Uno

Hello Forum. Has anyone got info on what is required please? I have all sorts of hardware, Uno, OBDLink SX, CANBUS Shield which I can talk to the high speed bus CAN_H and CAN_L but the low speed bus I am struggling with as its PWM. Thanks in advance. PeteEV

try their example and report back if you wish (rememeber to adjust the baudrate accordingly! :wink: ):

hope that helps....

1 Like

Thanks sherzaad. I will brew a strong coffee and have some aspirin ready for the challenge :slight_smile: All the best. Peter

Hi sherzaad. I wonder if you are able to help please. I tried uploading Advanced_Tx.ino but I get quite a few errors as below, any clues what I am doing wrong as it seems to be the PwmTransceiver.h which is causing me issues maybe ?? Thanks. PeteEV

Arduino: 1.8.19 (Windows 7), Board: "Arduino Uno"

C:\Users\Avancer\AppData\Local\Temp\ccKR86df.ltrans0.ltrans.o: In function `global constructors keyed to 65535_0_sketch_sep26c.ino.cpp.o.2023':

:(.text.startup+0x9a): undefined reference to `PwmTransceiver::PwmTransceiver(unsigned char, unsigned char)'

C:\Users\Avancer\AppData\Local\Temp\ccKR86df.ltrans0.ltrans.o: In function `setup':

C:\Users\Avancer\Documents\Arduino\sketch_sep26c/sketch_sep26c.ino:24: undefined reference to `PwmTransceiver::begin(unsigned long)'

C:\Users\Avancer\Documents\Arduino\sketch_sep26c/sketch_sep26c.ino:25: undefined reference to `PwmTransceiver::setTxRxModePin(unsigned char)'

C:\Users\Avancer\Documents\Arduino\sketch_sep26c/sketch_sep26c.ino:26: undefined reference to `PwmTransceiver::enableRxMode()'

C:\Users\Avancer\AppData\Local\Temp\ccKR86df.ltrans0.ltrans.o: In function `loop':

C:\Users\Avancer\Documents\Arduino\sketch_sep26c/sketch_sep26c.ino:34: undefined reference to `PwmTransceiver::enableTxMode()'

C:\Users\Avancer\Documents\Arduino\sketch_sep26c/sketch_sep26c.ino:39: undefined reference to `PwmTransceiver::println(String)'

C:\Users\Avancer\Documents\Arduino\sketch_sep26c/sketch_sep26c.ino:42: undefined reference to `PwmTransceiver::enableRxMode()'

collect2.exe: error: ld returned 1 exit status

exit status 1

Error compiling for board Arduino Uno.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

trying it myself and I'm getting other errors as well.

anyway... before we get to debugging it, could you share your hardware connections please?

Hi sherzaad. Thank you for your reply. Hopefully I am giving you the correct info to your question...
I am connecting PWMBus+ to pin 3 of the Uno and PWMBus- to pin 13 of the Uno. If that is not correct first try then I will swap the pins over. PeteEV

Hi sherzaad. Just been looking through the PwmTransceiver.h file and it has a good few #include it requires.
I have the following missing form my library so will endeavor to get them next..
stdint.h
Arduino.h
avr/io.h
avr/interrupt.h

hmmm.... I had not really looked at the library personally until my last post and the more I look at it the more skeptical I am about how well it would work...

for starters, J1850-PWM is differential ie you would require a suitable transceiver to make the differential into a single ended one!

Making a code from scratch for it should not too difficult IMHO but I am too busy to sit and write one myself atm not do have anyway of testing said code myself.

there are several libraries for J1850-VPW out there which in principle is the same IFF you are just doing reading the bus.
So if you intended to only READ the bus then maybe try using one of the VPW git already available :wink:

I found this mice article btw that give a good explanation of what its all about:

hope fully it you help you get where you need to go!

Thanks sherzaad. My project is to talk to the gauges on my cars dashboard. I can talk to the RPM and Engine Temp as they are on the CAN_H and CAN_L 29bit Extended bus, that code address is 0x0A18A001 with the 3rd, 4th, 7th and 8th affecting parts of the dashboard. But the other gauge I require is the Fuel gauge which seems to be on the PWM bus. The niggle I have is using MultiEcuScan and the OBDLinkSX I can talk to all three gauges etc etc using the PWM bus connections on the OBD connector. I even know the code to send 18DA60F1052F55XX03YY where XX is the address of the item and YY is the set value. I think MES is using AT commands but cant be sure for now. I tried sending the know code via CAN_H and CAN_L but that does not work. So frustrating. I think I will end up blanking out the Fuel gauge and resurrecting my Nextion screen for the Fuel function.
Anyway, many thanks you for your help and good luck with anything you do.
PeteEV

the ELM237 supports all the OBD protocols and quite cheap as well if I may say so!

searching the web there is an ELMduino library having had a quick look at it, it does allow you to setup comms over J1850-PWM though how far it you can going may involve some work (maybe the library author can help you there. he does seem to actively maintain his libraries :wink: )

Good Luck with your project and if you do have a breakthrough with this protocol please make sure to contribute your experiance here! :wink:

Thanks sherzaad. I will indeed check out the ELMduino library. Thats a good lead for me to follow this eve. All the best. PeteEV

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.