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 initialization problems

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







can initialization problems
PostPosted: Tue Jul 11, 2006 6:28 am     Reply with quote

I work with pic 18f4580 can library
I would like to know if I must use
can_set_functional mode
before or after can_init

I need also to know RXFILTER0 called "simple filter name" which pic register or registers point

Thank you
iso9001



Joined: 02 Dec 2003
Posts: 262

View user's profile Send private message

PostPosted: Tue Jul 11, 2006 12:09 pm     Reply with quote

Look at the file.

You can see what init() does... Does init() call set_mode inside it? I don't have my ccs seat here so I can't tell you but its pretty easy to figure out.

RXFILTER0 's register is clearly defined in the datasheet as well as in the CCS driver, look for the #define RXFILTER part, near its structure.

Btw, from experience I can tell you to DUMP the ccs can driver! Its made for learning. It is not even close to efficient (even for C). It is very very easy to code your own driver and you will benifit from learning all the registers, controls, timing, and filtering on your own. It took me ~2 days to write the driver (and about a week for fully optimize it for what I'm doing). Time extremely well spent!
Luig
Guest







Thank you
PostPosted: Tue Jul 11, 2006 2:10 pm     Reply with quote

I have not understood which driver You say to me it is better to use
Luig
Guest







PostPosted: Wed Jul 12, 2006 1:41 am     Reply with quote

In your reply You said nothing:
- You do not know what can_init contains
- there is no structure about RXFILTER0 only an address
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jul 12, 2006 2:19 am     Reply with quote

Look in the can-18F450.h file. Look at the address of RXFILTER0
in the "simple filter names" list. Then find the same address in
the "Receive acceptance filter" list.

Quote:

// simple filter names
#define RXFILTER0 0xF03
#define RXFILTER1 0xF07
#define RXFILTER2 0xF0B
#define RXFILTER3 0xF0F
#define RXFILTER4 0xF13


These are the PIC register names:
Quote:
// Receive acceptance filter n extended identifier
#byte RXF0EIDH=0xF02
#byte RXF0EIDL=0xF03
#byte RXF1EIDH=0xF06
#byte RXF1EIDL=0xF07
#byte RXF2EIDH=0xF0A
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