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
The Keil uVision2 Simulator accurately simulates most 8051-compatible devices. There are some devices that are not 100% simulated. The Cygnal C8051F125 is one of those (refer to http://www.keil.com/dd/chip/3474.htm). Unfortunately, it is impossible for us to simulate all the 8051 devices that are available. It currently takes anywhere from 1-4 weeks to add simulation for a part. However, with over 30 chip vendors, more than 5 new 8051 devices are invented each month. As such, it is simply impossible to keep up. Our strategy for simulation is to provide it first for devices with no alternative method of debug/testing. We currently do simulate some of the Cygnal devices and are working on simulation for others. All Cygnal parts support on-chip debug via JTAG. That's probably what you'll have to use for the 125. Jon