I am working with a LPC2292/01 Rev. C and use the CAN interface 1 of
The RBS and the DOS bit in the CAN1GSR are never set.
I checked the address of the Register definition of CAN1GSR twice.
Transmitting works. Receiving works, when I ignore the RBS-Bit.
I looked at the code from the AN10438 and RBS and DOS were never
checked. Are these Bits broken? There is nothing in the errata. How can
you determine when there is a new message without the RBS-bit.
Has anyone an idea?
Here is my Code (initialisation and receive-function)
C1MOD = (1 << 0);
//Bus-Timing 25kBit (60MHz PCLK)
//Prescaler: 300, SJW: 1, TESG1: 5, TESG2: 2
C1BTR = 299 | (4 << 16) | (1 << 20);
PINSEL1 |= (0x01 << 18);
C1MOD &= ~(1 << 0);
int8_t can_read_msg(CAN_MSG * msg)
if(C1GSR & 0x01)
msg->len = (C1RFS >> 16) & 0x0F; //read length
msg->id = C1RID & 0x3FF; //read ID
if(C1RFS & (1 << 30)) //RTR?
msg->status = CAN_STATUS_RTR; //RTR Flag
//no RTR, read databytes, ignore length
msg->data = C1RDA & 0xFF;
msg->data = (C1RDA >> 8) & 0xFF;
msg->data = (C1RDA >> 16) & 0xFF;
msg->data = (C1RDA >> 24) & 0xFF;
msg->data = C1RDB & 0xFF;
msg->data = (C1RDB >> 8) & 0xFF;
msg->data = (C1RDB >> 16) & 0xFF;
msg->data = (C1RDB >> 24) & 0xFF;
//next time, next message
C1CMR = (1 << 2);