Content originally posted in LPCWare by cseb on Fri Jan 11 10:53:11 MST 2013
I can now send data but i can not receive data. At the receiver part on the GLCD the incoming data is always zero. For receiving I am using the following routine:
if (CAN_RxRdy[1]) { /* rc message on CAN Controller #2 */
CAN_RxRdy[1] = 0;
val_Rx = CAN_RxMsg[1].data[0];
sprintf(f1,"%d",val_Rx);
ks0108_text(30,30,f1,1,1);
}
By the way I am using CAN2 controller ( P0.4 & P0.5 ), so I am using the following definitions for CAN2 block in can.c can_setup() function:
LPC_SC->PCONP |= (1 << 14); /* Enable power to CAN2 block */
LPC_PINCON->PINSEL0 |= (1 << 9); /* Pin P0.4 used as RD2 (CAN2) */
LPC_PINCON->PINSEL0 |= (1 << 11); /* Pin P0.5 used as TD2 (CAN2) */
Please help me. :(