CAN

CAN

(Note – Nerdy stuff)
So after a bit of noodling on the conversation last week, I have decided that a hybrid approach will be the best way to build the CAN master device/recorder/display driver. The goal is to have this device be something that is installed in the car and have it connect to the car’s CAN bus and capture data from the other Open-CANDAQ devices (Analog inputs, Thermocouples, Speed, etc), as well as anything on the factory CAN bus. I’d like it to also support some interfaces to some displays, as well as support auto log uploads over wifi, bluetooth, or perhaps telemetry over a cell modem.

I mentioned last week that many of the Pi based CAN boards use the MCP2515 CAN controller, which has no FIFO. I had considered using the new MCP2517fd which has a FIFO, but after a bit of experimenting it could still lead to some timing problems. (there are worst cases where interrupt latency could slower than a full rate bus and a 32 frame FIFO).

Since I already have a great working firmware for the dsPIC33, I am going to make a board with that microcontroller and a socket for a Raspberry PI Zero W. That will fit into the same kind of case as the other devices, and the dsPIC33 has an excellent onboard ECAN interface with very low latency support, lots of RAM for buffers, plus support for both simple and complex filtering. I’ll connect the dsPIC33 to the Pi over 10MHz SPI, and since I am writing the firmware on the dsPIC33 I can implement my own low latency caching protocol.

This gives me the best of both worlds, since I’ll have a complete Linux environment for doing networking, upgrades, math functions, conversions, display driving, etc. The dsPIC33 microcontroller has plenty of power at 80MHz to do sub microsecond frame turnarounds, lots of ram for buffers, and of course it has some on board ADCs that I can use for a few extra inputs (knobs and switches perhaps ) as well as to monitor the 12V and 5V power rails.

It will be an easy board to design since I already have the parts and layout for the connectors, so I should be able to get this to OSHPark this week. Cost wise this will still be a pretty cheap setup, as the Pi Zero is about $15, and that dsPIC is about $5.

Comments are closed.