CAN BUS DATA RECEPTION PROBLEM

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

CAN BUS DATA RECEPTION PROBLEM

1,371件の閲覧回数
lpcware
NXP Employee
NXP Employee
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

ラベル(1)
0 件の賞賛
返信
4 返答(返信)

1,145件の閲覧回数
ekki
Contributor III

What about the reception filters? Yor code does not tell anything about it.

0 件の賞賛
返信

1,145件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by LabRat on Fri Sep 26 21:18:13 MST 2014

Quote: nirav_bhatt007
...but i don't have any interrupt while receiving that is the main problem.



Then start to check your hardware...
0 件の賞賛
返信

1,145件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by nirav_bhatt007 on Fri Sep 26 20:52:08 MST 2014
yes i have enabled CAN interrupt in NVIC ...it is working fine for the transmit interrupt of the CAN interrupt handler, but i don't have any interrupt while receiving that is the main problem.
0 件の賞賛
返信

1,145件の閲覧回数
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by gnxp on Fri Sep 26 03:55:21 MST 2014
Just a quick suggestion without going through your code,
have you enabled appropriate CAN interrupt in NVIC?
0 件の賞賛
返信