AnsweredAssumed Answered

CAN BUS DATA RECEPTION PROBLEM

Question asked by lpcware Employee on Jun 15, 2016
Latest reply on Oct 18, 2016 by Ekkehard Bönisch
Content originally posted in LPCWare by nirav_bhatt007 on Wed Sep 24 22:06:06 MST 2014
hello, we are using lpc4357 for the application of data transfer between two CAN NODES, we have the demo code for the lpc4357 as below:\lpc43xx-2013-09-04\lpc43xx\Examples.
it is working fine for the transmitting the data bytes to the other node, but while receiving we have a problem that we are not receiving any kind of interrupt as well as data.
please anybody who have cleared this application please send us the demo working code...
thanks...regards...
i am attaching the file that i have tested for transmitting..

anybody please send me the runnig sample code for CAN bus application on lpc4357 board??

it is not the problem with overclocking of can peripheral , i have already tested this code for PCLK (peripheral clock) of CAN as 12 MHz.
here are the initializatin code of C_CAN0 PLEASE SEND me the suggestions if any??

void CAN_Init( uint32_t BitClk, CCAN_CLKDIV_Type ClkDiv , MSG_CB Tx_cb, MSG_CB Rx_cb)
{

//RX_cb = Rx_cb;
//TX_cb = Tx_cb;

if (!(LPC_C_CAN0->CNTL & CTRL_INIT))
{
/* If it's in normal operation already, stop it, reconfigure
everything first, then restart. */
LPC_C_CAN0->CNTL |= CTRL_INIT;/* Default state */
}

LPC_C_CAN0->CLKDIV = ClkDiv; /* Divider for CAN VPB3 clock */
LPC_C_CAN0->CNTL |= CTRL_CCE; /* Start configuring bit timing */
LPC_C_CAN0->BT = BitClk;
LPC_C_CAN0->BRPE = 0x0000;
LPC_C_CAN0->CNTL &= ~CTRL_CCE; /* Stop configuring bit timing */
LPC_C_CAN0->CNTL |= CTRL_IE; /* CAN interrupt enable */

Config_Rx_Mes_Obj();

LPC_C_CAN0->CNTL &= ~CTRL_INIT; /* Initialization finished, normal operation now. */
while ( LPC_C_CAN0->CNTL & CTRL_INIT );

// By default, auto TX is enabled, enable all related interrupts
LPC_C_CAN0->CNTL |= (CTRL_IE|CTRL_SIE|CTRL_EIE);

return;
}

here BitClk value is 0x00004501 for 500khz baudrate and 12 mhz as PCLK _C_CAN0...
and ClkDiv value is 0 maens devided by 1...

this works fine for transmitting the data bytes to other peripheral but i came across the problem while receiving the data.

SEND ME THE NEXT suggestion ....

Regards,..

Original Attachment has been moved to: can%20driver.rar

Outcomes