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

This should be easy.....

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 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 (?????)

I understand the SFRs on the chip are spread over 5 pages, sharing common "base addresses" (0x98 in this case), but how do I access a specific page? And how do I view the different pages in the memory window?

This CAN'T be a bug, so what am I doing wrong?

Thanks,

Joe

0