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

Writing to 8051(CY7C6461) registers in C language

How can I write to the CPU registers(PORTCCFG,PORTBCFG,etc) and the Input-Output Port Registers(OUTB,OUTC,OEB,OEC, etc) of the 8051 microcontroller of the Cypress CY7C64613 chip in 'C'(language).

I have the following lines in the header file:

EXTERN xdata volatile BYTE PORTBCFG _AT_ 0x7F94;
EXTERN xdata volatile BYTE PORTCCFG _AT_ 0x7F95;
EXTERN xdata volatile BYTE OUTB _AT_ 0x7F97;
EXTERN xdata volatile BYTE OUTC _AT_ 0x7F98;
EXTERN xdata volatile BYTE OEB _AT_ 0x7F9D;
EXTERN xdata volatile BYTE OEC _AT_ 0x7F9E;

Currently am writing in the following way:
PORTBCFG = 0x00;
but the Keil compiler gives a warning "UNRESOLVED EXTERNAL SYMBOL"

Actually what i want to do is get an quivalent of the following assembly code in C:

mov dptr,#0x7f95
clr a
movx @dptr,a

Any suggestions??

0