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 support@ccsinfo.com

Can_init() with the MCP2515 of the CAN Development Kit

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







Can_init() with the MCP2515 of the CAN Development Kit
PostPosted: Tue May 30, 2006 9:45 am     Reply with quote

Hi everybody,

I'm working with the CAN Development Kit and when I enter in the can_init() function, the PIC 16F877 can't go out of this function. In fact, it can't change from normal mode to config mode...so it blocks when entering in CAN_set_baud() !
This is disturbing Smile

I need some help because I can't work...Thanks
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue May 30, 2006 11:57 am     Reply with quote

What driver files are you using ? I have vs. 3.249 of the compiler,
and it doesn't have files specifically for the MCP2515. It has
"can-mcp2510.c" and "can-mcp2510.h" files. These should be
compatible with the MCP2515. Does your CCS kit come with MCP2515
files ?

My guess is that the driver may not be configured to use the correct
PIC pins for your development board. The can-mcp2510.c has the
following pin definitions at the top of the file.
Code:

//IO pins connected to MCP2510
#ifndef EXT_CAN_CS
   #define EXT_CAN_CS   PIN_B1
   #define EXT_CAN_SI   PIN_C1
   #define EXT_CAN_SO   PIN_C0
   #define EXT_CAN_SCK  PIN_C3
//   #define EXT_CAN_RESET   PIN_B5
//   #define EXT_CAN_TX0RTS  PIN_C4
//   #define EXT_CAN_TX1RTS  PIN_B4
//   #define EXT_CAN_TX2RTS  PIN_C2
#endif

So if program which #includes the can-mcp2510.c file doesn't have
the EXT_CAN_CS defined, the driver will use the default pins as
shown above. These are pin B1 for CS, pin C1 for SI, etc.

Do these pins match your board ? Look in the documentation, at the
schematic. See what PIC pins are used for these four signals, which
are used to talk to the MCP2515 chip.
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