MPC5634M, how can set maximum of BUF[xx] ?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

MPC5634M, how can set maximum of BUF[xx] ?

Jump to solution
718 Views
kritsanasakwutt
Contributor II

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

Labels (1)
0 Kudos
1 Solution
562 Views
martin_kovar
NXP Employee
NXP Employee

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

View solution in original post

0 Kudos
1 Reply
563 Views
martin_kovar
NXP Employee
NXP Employee

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

0 Kudos