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

MAC0_PAGE problem

Hi all,

I'm quite new at using uVision. Currently I'm using C8051F120-TB board. I want to make a Multiply and Accumulate project. My problem is when I build my project, it doesn't recognize MAC0_PAGE. Do I need to do something before caling MAC0_PAGE?

Anyway, here's my program

#include <c8051f120.h>
// try 9*14 + 12*5

void try (void);
void INIT (void);

void main (void)
{ WDTCN = 0xDE; WDTCN = 0xAD;

INIT(); try();

while(1);
}

void INIT (void)
{ char SFRPAGE_SAVE = SFRPAGE;

SFRPAGE = MAC0_PAGE;

MAC0CF = 0x00;

SFRPAGE = SFRPAGE_SAVE;
}

void try (void)
{ char SFRPAGE_SAVE = SFRPAGE; SFRPAGE = MAC0_PAGE;

MAC0AH = 0x00; MAC0AL = 0x09; MAC0BH = 0x00; MAC0BL = 0x0E;

MAC0AH = 0x00; MAC0AL = 0x0C; MAC0BH = 0x00; MAC0BL = 0x05;

SFRPAGE = SFRPAGE_SAVE;
}

Thanks in advance

Adi

0