View previous topic :: View next topic |
Author |
Message |
Bill24
Joined: 30 Jun 2012 Posts: 45
|
18F46K80 CAN bus examples |
Posted: Thu Aug 16, 2012 2:09 am |
|
|
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
|
|
Posted: Thu Aug 16, 2012 7:16 am |
|
|
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
|
|
Posted: Fri Aug 17, 2012 7:55 am |
|
|
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
|
|
Posted: Tue Aug 28, 2012 3:23 am |
|
|
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
|
|
Posted: Wed Aug 29, 2012 2:09 am |
|
|
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
|
|
Posted: Wed Aug 29, 2012 5:09 am |
|
|
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 |
|
|
|