CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

18F57Q84 - which CAN driver to use ?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
pet007



Joined: 25 Jan 2023
Posts: 21

View user's profile Send private message

18F57Q84 - which CAN driver to use ?
PostPosted: Sat Dec 23, 2023 10:32 am     Reply with quote

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

View user's profile Send private message

PostPosted: Wed Dec 27, 2023 3:24 am     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Jan 16, 2024 4:55 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group