BiPOM Forum
General => Microcontroller Development Systems => 8051 Development Tools => Topic started by: enliteneer on December 11, 2005, 11:56:58 pm
-
The Atmel AT89C51 comes in a bigger package (which includes 2 extra ports) that I would like to use.
However, the Micro-C 8051 compiler doesnt recognize the \'P4\' and \'P5\' declartions, so Id like to add these to the proper general compiler files. Is there a chance that the addresses used by P4 (0xC0) and P5 (0xD8) are already assigned to something else.
Which files should these new declarations go in?
-
asm
{
P4 EQU $C0
P5 EQU $C7
}
extern register unsigned char P4,P5;
void main()
{
int val;
val = P4;
P5 = 0
P5 |=1;
.....
}
-
Thanks!
Just as a note, if someone plans on bit addressing port 5 (i.e. CLR P5.3), then the D8 address should be used instead of the C7... P5 EQU $D8.
BTW, can this be included in an existing library file so that it can be used across any future projects?