AnsweredAssumed Answered

Some Questions about mpc5746c

Question asked by flight q on May 25, 2019
Latest reply on Jun 3, 2019 by flight q

The first question is about the built-in assembly of S32DS library functions. I have checked some information, but I still don't understand it. So I would like to ask you to explain: For example

#define stringify(s) tostring(s)
#define tostring(s) #s
#define mfspr(rn) ({unsigned int rval; __asm__ volatile("mfspr %0," stringify(rn) : "=r" (rval)); rval;})

 

Let me start with my understanding: Define mfspr (rn) instead of transferring strings to SPR (rn) registers。but how do I get the ID of the core MCU?

 

The second problem is that in Chapter 4.1.1 of MPC5746C, NOTE has a sentence: "Implemented SIUL2 Multiplexed Single Configuration Register" are from SIUL2_MSCR0 to SIUL2_MSCR263 and SIUL2_IMCR0 to SIUL2_IMCR511. Please note that MSCR 513 in this column corresponds to IMCR 0 and so on. " Is MSCR 513 correct? Have you introduced the corresponding relationship between MSCR registers and IMCR registers?

 

The following examples are illustrated in the manual:

 

Example:
If user wants to configure CAN0RX and CAN0TX, then the following configuration can
be used in SIUL2 registers:

SIUL2.MSCR[16].R = 0x03000001; /* PB[0] -&gt OBE = 1, ODE = 1 and MSCR16_SSS = 1 */
SIUL2.MSCR[17].R = 0x00080000; /* PB[1] -&gt IBE = 1 */
SIUL2.IMCR[188].R = 0x00080002; /* PB[1] -&gt MSCR17_SSS = 2, notice that
“IO_Signal_Description_and_Input_multiplexing_tables.xls” shows 700 for the MSCR/IMCR see
note above, thus 188 must be used to properly configure the pin signal connected to it */

 

How does IMCR [188] relate to MSCR [17]? Please explain, thank you!

Outcomes