mcp2515 is not reponding

Status
Not open for further replies.

Jinzpaul4u

Full Member level 4
Joined
Feb 1, 2012
Messages
231
Helped
59
Reputation
118
Reaction score
60
Trophy points
1,328
Location
India
Visit site
Activity points
2,822
Hi there,
Good wishes !!
My team is working on the MCP2515 to establish a CAN network for the upcoming project . We use pic24fj128 to communicate with mcp.Problem is the mcp2515 ain't responding to the processor or that isn't initialized whatsoever !! . We are terribly stuck over here and do not have a path ahead.Our spi works pretty fine (running at 1mhz) so that we only gotta dig MCP infact .
We use a 20mhz crystal and the hardware sounds clean. We checked and verified it is working well.Here is my initialization routine ..


void mode___confi__(void)
{
Start_out_transceive = 0 ; // CS low
writeSPI1(DEV_res); // mcp reset
Start_out_transceive = 1 ; // CS high

__delay_ms(5);

SPI_mcp_trans___t(reg__InstW_,CAN_CTRL,0x80); // start out configuration mode
__delay_ms(5); // delay

SPI_mcp_trans___t(reg__InstW_,RXFnSIDH,0x00); // standard id zero
SPI_mcp_trans___t(reg__InstW_,RXFnSIDL,0x08); // filter applies to extended ids
SPI_mcp_trans___t(reg__InstW_,RXFnEID8,0xff); // filter value
SPI_mcp_trans___t(reg__InstW_,RXFnEID0,0xff); // filter value

SPI_mcp_trans___t(reg__InstW_,RXM0SIDH,0x00); // no mask
SPI_mcp_trans___t(reg__InstW_,RXM0SIDL,0x00); // no mask
SPI_mcp_trans___t(reg__InstW_,RXMnEID8,0x00); // no mask
SPI_mcp_trans___t(reg__InstW_,RXMnEID0,0x00); // no mask

// SPI_mcp_trans___t(reg__InstW_,_CNF1___,0x03); //// tried both commented and uncommented Bit timings..
SPI_mcp_trans___t(reg__InstW_,_CNF1___,0x01);
// SPI_mcp_trans___t(reg__InstW_,_CNF2___,0x89);
SPI_mcp_trans___t(reg__InstW_,_CNF2___,0X98);
// SPI_mcp_trans___t(reg__InstW_,_CNF3___,0x04);
SPI_mcp_trans___t(reg__InstW_,_CNF3___,0X03);
SPI_mcp_trans___t(reg__InstW_,CANINTE ,0x00); // no interrupt

SPI_mcp_trans___t(reg__InstW_,CAN_CTRL,0x00); // switch back to normal mode
__delay_ms(5); // delay
}


Please help if you can figure something from this ..

thanks..
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…