This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

There's got to be a simple explaination.....

I just started writing a C application for the Cygnal C8051F125 and am having difficulty setting/viewing the paged SFR's

Here's a simple example in C code:

SCON0=0x50;
SCON1=0x40;

Compiles fine, but when I open the disassembly window, these 2 statements get translated to:

MOV SCON0(0x98),#0x50
MOV SCON0(0x98),#0x40

i.e., both statements modify SCON0. This is confirmed by opening the peripheral window and examining Serial port 1 and 2 --- SCON1 never changes (?????)

Then I realized there was an SFR called "SFRPAGE". Eureka! So I modified the code to:

SCON0=0x50;
SFRPAGE = 0x01;
SCON1=0x40;

And recompiled .....Behavior is exactly like before - only SCON0 gets modifed!

I assume that if I execute this on a target (which I don't have), it will work as expected but doesn't C51/uV2 support viewing/examining SFRs in other than the "base" page???

This CAN'T be a bug...or is it??

Thanks,

Joe

0