Support for j1850 VPW/PWM?


I was actually working on my own J1850 VPW implementation with my '99 Suburban, but am in the process of finding a PWM vehicle to use to consolidate the two into one library. I haven’t done any PWM work yet but I do have a lot of the SAE documents for the implementation, including the full 4 page writeup on the protocols. If I get any work done on the PWM side, I’ll let you know.

Edit: side note; I was considering using my Tech2 to possibly add some support for the extended PIDs I can access. That said, as far as I know the PIDs are/can be different for each different vehicle or model year. I’ll see once I get to that point. As of now I’ve been having trouble communicating with my trucks’ PCM due to some ground issues that I’m still hunting down. (darn project vehicles!)


I would be willing to do any testing. I can test with a macchina, but I also have an ELM327 and lists of commands and responces on the bus, and a ford star NGS tester for the ranger EV, which communicates to the modules.


Is your VPW code non blocking?

The current library is a blocking library which needs to be updated. If you have a non-blocking library I would be interested in seeing it. I Hope to be able to get back to working on the new firmware that I started a couple months ago once my current semester is done and I get back from vacation.

I also have a Lab that I can use to test the PWM stuff to and integrate it but that will be secondary to my getting new software up and running that will support CAN/VPW. My lab can do pretty much all of the protocols the M2 is capable of so I should be able to get it working with all the protocols once I have time to work on it.



It’s been a while since I did any work on it, but I believe it’s blocking currently. I was looking into a non-blocking context but I haven’t gotten one of my part-truck PCMs up and running on a bench to do all the testing with the limited time before I go back to work. A collaboration doesn’t sound like a bad idea, as I’d certainly benefit from it with my project truck being a VPW PCM. :slight_smile:


I have an '03 avalanche that uses the VPW and a 2012 CTS which uses CANBUS.

I also have the brain and a couple other modules mounted on a board from an '02 Bravada which should be the same as your 99 and I have a simulation board that has all of the protocols on it for testing and developing. I just haven’t had a chance to do much with it as I have had to deal with other stuff going on.

To make the VPW code should be pretty straight forward but I need to do a little more reading on the codebase to understand how Colin actually implemented the CANBUS stuff using the mailboxes. Basically to make it non blocking you take advantage of the fact any pin can throw an interrupt. You make an interrupt handler that reads in the stuff from the port then when the mail box is full you send it and start filling the next one. The normal code just watches for a mailbox to be ready to read and does so. To send the main code puts the send information into a mail box and marks it as send and sends it. So really the read part is the only part that needs to be interrupt driven. I just haven’t, as I already said, read Collins’ code well enough to understand how they are used.


I was reading up on some of the Arduino non-blocking methods, but I didn’t think about actually checking out the M2 code. As soon as I can I’ll look it over and see if I can get something started. I like the idea you mentioned about creating a more modular library where protocols can be added like plugins, as well.

Also, I’m going to be ripping the PCM and other modules from one of my part trucks, either a '96 or '99 Tahoe (or both) to set up a bench testing method in the near future whenever I strip the trucks. That only offers me VPW testing but it helps for my plans of making an information display for my Suburban.


If you are pulling modules I would suggest at a minimum the PCM and the BCM. You can communicate with them then via a standard ODBII program if you need to and track the communications with your M2. Thats how I tested that it worked in the first place. I actually have a PCM, BCM and cluster from a 2001 Trailblazer mounted on a board. The PCM case is pulled off because I wanted to look in it for another project.