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

Keil and MetaLink-XF ICE difficulties

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;

In the section of code where I load the latest PWM value (T1 interrupt if it matters), I have:

*bufptr++ = CCAP2H;

With this code in hand, I setup my Metalink-XF emulator to map XRAM to emulator memory and told it not to access the target. As I understand it, this leaves P0 and P2 as port pins and all should be well.

Things seem to work correctly about 90% of the time, but I find that there are chunks of emulator XRAM that are left at 0x00 (or whatever value I filled it with beforehand) and never get updated with the actual value in CCAP2H. Further, these locations that don't update aren't constant from run to run.

I worked with MetaLink a bit and they sent me a simple ASM example that writes to and reads from the whole XRAM space. That test passes with the emulator both in and out of my system.

As such, I'm wondering if there's some (completely understandable) assumption that C51 is making when I tell it I have an 87C51FB. Could I change this to another processor type to make this test work, or am I just out of luck?

If anyone could shed some light on this, it would be most appreciated. Thanks.

0