We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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;
Thanks in advance
Adi
Whatever you do you will need to find a file that has the definitions you expect to be there. The compilers says they aren't, so you could inspect it yourself, or look to what was being used in the example your code came from.
If you have multiple examples of a particular .H file you'll want to check the include paths used by the compiler to determine/adjust which is used first.