Hello,
I am very new to the CAN protocol and started exploring it using LPC1768 Dev. Kit.
While trying to analyze the sample code of CAN protocol just to send data from one LPC1768 to other LPC1768 board,i am unable to receive the data.
But when I evaluated the same program in keil simulator, I can view the expected results.
Kindly find below the block of CAN code which I have downloaded to the board.
CAN_TxMsg[1].id = 33; /* initialise message to send */ for (i = 0; i < 8; i++) CAN_TxMsg[1].data[i] = 0; CAN_TxMsg[1].len = 1; CAN_TxMsg[1].format = STANDARD_FORMAT; CAN_TxMsg[1].type = DATA_FRAME;
while (1) { val_Tx = adc_Get (); /* TX value changes in any case */ if (CAN_TxRdy[1]) { /* tx message on CAN Controller #2 */ CAN_TxRdy[1] = 0;
CAN_TxMsg[1].data[0] = val_Tx; /* data[0] field = ADC value */ CAN_wrMsg (2, &CAN_TxMsg[1]); /* transmit message */ }
delay (10000); /* Wait a while to receive the message */
if (CAN_RxRdy[0]) { /* rc message on CAN Controller #1 */ CAN_RxRdy[0] = 0;
val_Rx = CAN_RxMsg[0].data[0]; }
val_display (); /* display TX and RX values */
} }
Please advice me!!!
See This: http://www.keil.com/forum/21691/
Happy Lunar New Year.
Thank you for your kind reply...