Hi, I use MPC5634M and I want to know how can set maximum of BUF[xx] ?
I use code below and i can set BUF[xx] up to BUF[31].
But, i want set BUF[xx] up to BUF[40].
Code ;
static void RecieveMsg(void) |
{
uint8_t j;
uint32_t dummy;
/* Use 1 of the next 2 lines: */
/*while (CAN_C.IFLAG1.B.BUF04I == 0) {};*//* MPC551x: Wait for CAN C MB 4 flag */
while (CAN_A.IFRL.B.BUF05I == 0) {}; /* MPC555x: Wait for CAN C MB 4 flag */
RxCODE = CAN_A.BUF[5].CS.B.CODE; /* Read CODE, ID, LENGTH, DATA, TIMESTAMP */
RxID = CAN_A.BUF[5].ID.B.STD_ID;
RxLENGTH = CAN_A.BUF[5].CS.B.LENGTH;
for (j=0; j<RxLENGTH; j++) {
RxDATA[j] = CAN_A.BUF[5].DATA.B[j];
}
RxTIMESTAMP = CAN_A.BUF[5].CS.B.TIMESTAMP;
dummy = CAN_A.TIMER.R; /* Read TIMER to unlock message buffers */
/* Use 1 of the next 2 lines: */
/*CAN_C.IFLAG1.R = 0x00000010; */ /* MPC551x: Clear CAN C MB 4 flag */
CAN_A.IFRL.R = 0x00000010; /* MPC555x: Clear CAN C MB 4 flag */
}
Thank you
Solved! Go to Solution.
Hi,
there is no problem with access to another MBs. You can write for example CAN_A.BUF[40].CS.B.CODE = some_value; MB flags for MBs 32-63 are placed in the IFRH register. So the access is CAN_A.IFRH.B.BUF40I.
But you have to set MAXMB bits in MCR register, which determines, how many MBs is available.
Regards,
Martin
Hi,
there is no problem with access to another MBs. You can write for example CAN_A.BUF[40].CS.B.CODE = some_value; MB flags for MBs 32-63 are placed in the IFRH register. So the access is CAN_A.IFRH.B.BUF40I.
But you have to set MAXMB bits in MCR register, which determines, how many MBs is available.
Regards,
Martin