|
|
View previous topic :: View next topic |
Author |
Message |
Nilgiro Guest
|
Can_init() with the MCP2515 of the CAN Development Kit |
Posted: Tue May 30, 2006 9:45 am |
|
|
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
I need some help because I can't work...Thanks |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue May 30, 2006 11:57 am |
|
|
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. |
|
|
|
|
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
|