Re: Fujitsu microcontroller (8-Bit) Clock Modes Problems



On Thu, 08 Jan 2009 01:29:23 -0800, Chris wrote:

I thought that I could use the PLLC_MPRDY to check if the MAIN-PLL
Clock has been stabilized or not...

From my reading of the data *** and the above, I would have thought that
too.

Even if I use _pllc.bit._MPRDY, as
suggest in the example, I don´t have the right value from memory...

So you're saying that PLLC_MPRDY (or _pllc.bit._MPRDY) doesn't match:

*((unsigned char *)6)>>4&1

?

Does "(int)&_pllc == 6" hold?

Does creating your own PLLCSTR instances behave as expected, e.g.:

PLLCSTR my_pllc;
my_pllc.byte = 0;
my_pllc.bit._MPRDY = 1;
printf("0x%02x", (unsigned int) my_pllc.byte);
?

[Note: the above needs to have all optimisations disabled, as using both
the .bit and .byte fields of the union violates ANSI C aliasing rules.]

Does testing _pllc.byte rather than an explicit memory location work?

.


Quantcast