Hello,
when I'm reading manual for CCS (5.116), I can see there these CAN drivers based on MCU type:
Code:
Relevant Include Files:
can-mcp2515.c - Driver for the MCP2515 external CAN controller.
can-mcp2517.c - Driver for the MCP2517 external CAN FD controller.
can-pic18f_ecan.c - Driver for PIC18 devices with a built-in ECAN module.
can-pic24_dspic33.c - Driver for PIC24 and dsPIC33 devices with a built-in ECAN module.
can-dspic30f.c - Driver for dsPIC30 devices with a built-in CAN module.
can-dspic33_fd.c - Driver for dsPIC33 devices with a built-in CANFD module.
But when I've tried to use "can-pic18f_ecan.c" it doesn't compile. Intead of this, I've found in drivers directory "can-pic18_fd.c" one, which seems to be ok. Is this the correct one for that MCU type ? Thanks.
(I'm not able to test it with real target now....)
Ttelmah
Joined: 11 Mar 2010 Posts: 19539
Posted: Wed Dec 27, 2023 3:24 am
Look at your chip's data sheet.
What CAN peripheral does it say it has?. Section 38. "CAN FD".
Guess what driver you should use......
The drivers are _not_ 'based on MCU type'. They are based on the
peripheral type. So external MCP2515 chip, you use the mcp2515 driver.
PIC18 with the ecan module you use the pic18f_ecan driver. Chips with
the CAN FD module you use the pic18_fd driver. The point about the FD
module is it allows flexible data rates instead of the fixed ones supported
by the standard peripheral. Obviously extra settings involved to cope with
this.
Gabriel
Joined: 03 Aug 2009 Posts: 1067 Location: Panama
Posted: Tue Jan 16, 2024 4:55 pm
im using a
PIC18F47Q84 with
#include "can-pic18_fd.c"
and a SN65HVD235DR driver with great success...
configuring is a bit tricky but i think it was more a learning curve than it being Actually tricky.
other than that, works great! PCH 5.109.
G. _________________ CCS PCM 5.078 & CCS PCH 5.093
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum