Thanks Richard, that was what I was hoping to hear! I'll get back to work on the CAN program now!
Paul
Thanks Richard, that was what I was hoping to hear! I'll get back to work on the CAN program now!
Paul
Be interested to see what you were working on.
I've done quite a bit on CAN with PBP.
I have been working on a CAN interface file where you pass a few initial set up parameters, speed etc. and it selects and sets the appropriate registers. When you want to send a frame, you load a buffer and pass it off to the routine which finds the first available transmit buffer and sends it. I have the DT interrupts so I can enable the ones for the CAN if needed, although in my application, I don't. I only handle mode 1 and mode 2 of the CAN bus. What have you been doing with CAN?
-Paul
Paul. Can we see that?
I have used pics with the internal CAN module and a can line driver and ones without but with an external microchip mini CAN board and line driver.
I built a Honda CR-Z/Insight Hybrid car MITM control device.
It intercepts and modifies motor control signals allowing the driver to manually control the IMA motor.
It sits in the IMACAN line relaying thousands of OEM messages back and forth and also listens on a separate FCAN line to more messages and control commands.
It uses a 18F26K80 at 64mhz and 3 el-cheapo aliexpress $5 SPI CAN boards.
My code is attached.
IMAC&C is the IMA control MITM device. This uses the cheap CAN boards.
OBDIIC&C is an FCAN device to talk to the car like an OBDII diagnostic tool. This uses the internal pic CAN module.
Last edited by retepsnikrep; - 4th May 2025 at 06:33.
Interface board with SPI controlled MCP 2515 and line driver to use with non CAN enabled PIC's
https://www.aliexpress.com/item/1005006850683509.html
Line driver to use with CAN enabled PIC's.
https://www.aliexpress.com/item/1005006209071522.html
You get the idea.. Cheap as chips..
My YT channel has a lot of PIC CAN tinkering stuff. @retepsnikrep
On Insightcentral.net and the CRZforum.com is tons of stuff from over the years.
Last edited by retepsnikrep; - 5th May 2025 at 09:36.
Earlier CAN MITM prototypes.
One using 16F1825 at 32mhz and one using 18F26K80 at 64mhz.
It was possible to drive one of those serial data to RCA video gadgets as well.
This made a nice little very cheap dash mounted text display for info and debugging.
![]()
Watch out for the slew rate control bit in PICS.
It defaults to on in the PIC18F26K80!
This screwed me for hours as the SPI just kept falling over above 1mhz.
Not enough drive power for the circuit capacitance etc.
Once I found the SLRCON register and cleared it the SPI bus would run happily at 10mhz with the PIC overclocked to 80mhz.
In the end I dropped back to 8mhz and 64mhz for the bus and pic respectively.
IIRC 10mhz SPI is the maximum for the MCP2515 running with an 8mhz crystal.
Bookmarks