1. Message ID 23f should mean 0x023F. Least significant bit is ID0 bit. And location of ID0 bit depends on message format. If message is standard then ID0 is bit5 of register xxxIDR1. If message is extended, then ID0 is bit1 of register xxxIDR3. The id of received message, messageID is something like this:
unsigned long tmp;
tmp = *(unsigned long*)&CANRIDR1;
// is it extended message ?
// (IDE bit is bit3 of IDR1)
if(CANRIDR1 & (1<<3))
{
messageID = (tmp >> 2) & 0x3FF80000ul;
messageID |= tmp & 0x0007FFFEul;
messageID >>=1;
}
else
{
// no, it's standard ID
messageID = (tmp >> (5+16) ) & 0x7FF;
}
2. So it depends where the first bit is. Search MSCAN docs for "Standard identifier mapping" and "Extended identifier mapping".
But when talking about id's, the numerical value of message id is just the numerical value of message id. For example message id of 0x124 means ID8=1, ID5=1, ID2=1 and all other IDx bits are 0.
3. 1) Acceptance registers have the same ID mapping like receive and transmit buffers.
2) CANIDAC register setup should tell how many acceptance filters you have and how many bits each filter is.
Since you are asking about 4 acceptance registers, I assume you are using 32bit acceptance filters and extended identifiers. If so then
CANIDAR0=0x23F >> 21;
CANIDAR1=((0x23F >> (15-2)) & 0xE0) | 0x18 | ((0x23F >> 15)&7);
CANIDAR2=0x23F >> 7;
CANIDAR3 = 0x23F << 1;
for RTR message please set CANIDAR3 bit 0.
And IDMR mask registers mapping is also the same.
CANIDMR0=CANIDMR1=CANIDMR2=CANIDMR3=0xFF; // this instructs to accept all messages
CANIDMR0=CANIDMR1=CANIDMR2=CANIDMR3=0; // this instructs to accept only message with ID, IDE and RTR bits matching IDAR0-3 registers
Hope it helps and doesn't confuse you further :smileyhappy: