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

Debug Memory watch Problem

As a Newbie to 8051_C I have a steep learning curve to climb.

I wrote the following simple program:

#include <REG320.H>
#include <stdio.h>

int xdata LED _at_ 0x0fd40; /*LED Mapped to External Memory Location FD40 via PAL */

sbit SW = P1^0; /*Switch connected to P1.0*/

void main (void)
{
SW = 1; /* Configure P1.0 as an input */

while (1) /* Forever Make LED lite if SWitch is on */
{
LED = SW; /* Copy P1.0 to Memory Location FD40 */
}
}

In the debugger I watch SW, LED and memory location FD40. If I toggle P1.0 (SW) varible LED toggles but Memory FD40 never changes.

What am I doing wrong?

Thanks
Brian

0