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

CAN 18F6680

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







CAN 18F6680
PostPosted: Tue Dec 30, 2008 9:08 am     Reply with quote

Which CAN header is best for the 18F6680 ?
...and do I need to do anything for them to use the CANTX/RX on port G ?
Both header look like they use pins in port B.
Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Dec 30, 2008 2:45 pm     Reply with quote

The ECAN modules look similar between the 18F4580 and the 18F6680.
The block diagrams and register maps look similar. I don't have the time
to compare them in detail.

Here's the line that refers to Port B (the TRISB register) in can-18F4580.c:
Quote:
void can_init(void) {
set_tris_b((*0xF93 & 0xFB ) | 0x08); //b3 is out, b2 is in


In the 18F6680, CANTX1 is on pin G0 (CANTX2 is not normally used) and
CANRX is on G2, so change it to this:
Code:
set_tris_g((*0xF98 & 0xFE ) | 0x04);  // Pin G0 is out, G2 is input   

Create copies of the can-18F4580.c and .h files and rename them to
can-18F6680.c and can-18F6680.h and do any edits in those files.
rstny
Guest







PostPosted: Wed Dec 31, 2008 9:12 am     Reply with quote

Works like a charm...Thanks.
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