Hi all,
How to read or access a general register R1 in MPC5744P micro-controller?
Thanks
Hi,
I'm not sure what you mean, but R1 is general purpose register and can be normally used as any other register in assembly code.
Can you please share more details?
yes I meant that
but the question
Is there a memory mapped address for register R1 instead of using assembly code for accessing it?
Um, I'm not sure which compiler do you use. This is working only with gcc, not with diab or GHS.
Hi,
I see. Yes, you can assign register to a variable like this:
register int My_C_r1 asm ("r1");
I defined a variable like this but it raises the following error
expected '=', ',', ';', 'asm' or '__attribute__' before 'asm'
Can you please share the code snippet with variable definition? For me it is working normally (tested with MPC5744P).
this construction can be used with the S32DS default C standard, not with C99.
Anyway, this technique is almost unusable and deprecated because of optimization. Can you describe in more details what is your goal?
My goal is to implement a function to monitor the value of R1 register in run time, then import this function to be used in a simulink model.