I'm having a hard time doing some debugging with my MetaLink ICE and a piece of code I've written in Keil and I wonder if someone on the board here might have run into a similar problem. My target hardware is a dc motor drive board and we're using an 87C51FB in the actual product. We use PCA module 2 as a PWM to control the motor speed and have no external memory or memory-mapped I/O. As such, we use all P0 pins as GPIO for other purposes. I'm trying to get a picture of the values we're loading in to the PWM register to get a feel for how the control is doing. What I did was this: Generate a normal 87C51FB project in Keil, just like I always would, but with these modification: I told Keil that external XRAM existed from 0x0000 - 0xFFFF. Next, I defined a pointer as
unsigned char xdata *bufptr = 0x0000;
*bufptr++ = CCAP2H;
Erik, Thanks for the tip. MetaLink is fairly similar to your setup, but they divide things into a few settings. The first is the memory map, and I have location 0x0000 - 0xFFFF mapped to emulator memory. Next, in their setup they have a "MOVX accesses target" checkbox which I have unselected. Upon deselecting the movx accesses target option, it pops some text up that says "P0 / P2 are ports" which suggests to me that that's what I want. Also, my I/O seems to work correctly when I'm doing this, it's just the XRAM accesses that don't behave as I'd expect.