nrmlguru
Newbie level 4
Hello,
I wrote the following code to toggle the PORT0 of AT89S8253. I dont want to use the header files available for AT89S8253.
#define PORT0 (*((volatile unsigned char*)(0x80))) /* P0 @ 0x80 */
void main()
{
unsigned int i;
while(1)
{
for(i=1000; i>0; i--);
PORT0 = 0xFF;
for(i=1000; i>0; i--);
PORT0 = 0x00;
}
}
I dont see the toggling. I see 0xFF all the time at address 0x80.
I wrote the following code to toggle the PORT0 of AT89S8253. I dont want to use the header files available for AT89S8253.
#define PORT0 (*((volatile unsigned char*)(0x80))) /* P0 @ 0x80 */
void main()
{
unsigned int i;
while(1)
{
for(i=1000; i>0; i--);
PORT0 = 0xFF;
for(i=1000; i>0; i--);
PORT0 = 0x00;
}
}
I dont see the toggling. I see 0xFF all the time at address 0x80.