Triode
Well-Known Member
My supervisor at the lab where I work wants to look into using CAN in some of our automated systems. So I got some PIC18F46K80 chips, a MCP2551 tranceiver, and got to work on it. We would like to use CANOpen higher layer protocol. I've looked at the application notes, but none of the code I can find compiles without modification and it's hard to debug the code when the device wiring and hardware are also new, and to try it out I need two working nodes.
The lab had an old PICDem can lin 2 board, so I set that up and the CAN king software, it works, but I have yet to get a device to interface with it.
With the PIC18F46K80, the MCP2551 tranceiver, and the CANOpen example code in AN945 do I have what I need?
Update:
I have so far found that the AN945 code, which is written for the 18F8680, needs the following changes to compile for the 18F46K80
Replace PIR3bits.RXB1IF with PIR5bits.RXB1IF
Replace REQOP2 with REQOP
And of course replace #include "P18F8660.H" with "p18f46k80.h"
So now I'm working on finding where I set the frequency and baud rate and what function I call to transmit a message.
The lab had an old PICDem can lin 2 board, so I set that up and the CAN king software, it works, but I have yet to get a device to interface with it.
With the PIC18F46K80, the MCP2551 tranceiver, and the CANOpen example code in AN945 do I have what I need?
Update:
I have so far found that the AN945 code, which is written for the 18F8680, needs the following changes to compile for the 18F46K80
Replace PIR3bits.RXB1IF with PIR5bits.RXB1IF
Replace REQOP2 with REQOP
And of course replace #include "P18F8660.H" with "p18f46k80.h"
So now I'm working on finding where I set the frequency and baud rate and what function I call to transmit a message.
Last edited: