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

18F46K80 CAN bus examples

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



Joined: 30 Jun 2012
Posts: 45

View user's profile Send private message

18F46K80 CAN bus examples
PostPosted: Thu Aug 16, 2012 2:09 am     Reply with quote

I am using a 18F46K80 for a new project using CAN bus. All the code examples I have include can-18xxx8.c and .h


Please could some one verify if this is the correct file to use and not for example can-18F4580.c and .h
newguy



Joined: 24 Jun 2004
Posts: 1909

View user's profile Send private message

PostPosted: Thu Aug 16, 2012 7:16 am     Reply with quote

I just did a project with an 18F26K80 and the can files I used were the can-18xxx8.c and .h.
Douglas Kennedy



Joined: 07 Sep 2003
Posts: 755
Location: Florida

View user's profile Send private message AIM Address

PostPosted: Fri Aug 17, 2012 7:55 am     Reply with quote

newguy is correct. The CCS drivers come in two types drivers for external CAN chips and drivers for built in CAN support. can-18xxx8.c is for the internal CAN enabled chips.
Kroko87



Joined: 20 Jan 2011
Posts: 4

View user's profile Send private message

PostPosted: Tue Aug 28, 2012 3:23 am     Reply with quote

Douglas Kennedy wrote:
newguy is correct. The CCS drivers come in two types drivers for external CAN chips and drivers for built in CAN support. can-18xxx8.c is for the internal CAN enabled chips.


For internal and external CAN chips, there are different drivers!


Quote:
I am using a 18F46K80 for a new project using CAN bus. All the code examples I have include can-18xxx8.c and .h


Please could some one verify if this is the correct file to use and not for example can-18F4580.c and .h


You should use the can-18F4580 driver files.

I wrote that in another post, why do you use that old driver files (can-18xxx8 for CAN module) for your PIC with ECAN module?
turhan



Joined: 24 Aug 2012
Posts: 9

View user's profile Send private message MSN Messenger

PostPosted: Wed Aug 29, 2012 2:09 am     Reply with quote

can-18F4580 is irrelevant. K family is different. Look at datasheet which is 18FXXKXX you will understand what i say.
For Example:


can-18F4580

#byte RXM0EIDH=0xF1A
#byte RXM0EIDL=0xF1B
#byte RXM1EIDH=0xF1E
#byte RXM1EIDL=0xF1F

K family registers

#byte RXM0EIDH=0xEFA
#byte RXM0EIDL=0xEFB
#byte RXM1EIDH=0xEFE
#byte RXM1EIDL=0xEFF

They are not same ...

I changed all register by following its datasheet . However, i could not solve this problem....
CCS Please help us...
Kroko87



Joined: 20 Jan 2011
Posts: 4

View user's profile Send private message

PostPosted: Wed Aug 29, 2012 5:09 am     Reply with quote

Quote:
can-18F4580 is irrelevant. K family is different. Look at datasheet which is 18FXXKXX you will understand what i say.


Ah, ok.
Sry...
I made all register definitions with getenv.
But i haven't tested it with any PIC of the K family yet. Except for the different register locations i only know one difference of the families:
the K family has the CANMX bit in the config registers for pin assignment of the CAN TX and RX pin (which could be false configured)


Please excuse my bad English Embarassed
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