Hi, Donovan,
as you know, the MCG_C1 register has only 8 bits length, it is a byte register, if you want to access it, you should use a byte variable and define the address of MCG_C1 register as a Byte address.
Pls modify in this way:
#define MCG_C1 (*(volatile unsigned long *)(0x40064000)) // MCG Register
TO
#define MCGG_C1 (*(volatile unsigned char*)(0x40064000)) // MCG Register
in your main code, you can declare a global variable as:
unsigned char c0;
main()
{
c0=MCGG_C1;
asm("nop");
//the above code is okay
}
I do not know the tools you are using, I use CodeWarrior for mcu ver10.5 tools, the MCG_C1 name has been defined, you can use the name directly. So I use another name MCGG_C1.
If you declare as #define MCG_C1 (*(volatile unsigned long *)(0x40064000)) // MCG Register, you will get four bytes data from the following address:
0x40064000, 0x40064001,0x40064002,0x40064003.