Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Help Needed Keil and Atmel 89s8253

Status
Not open for further replies.

nrmlguru

Newbie level 4
Joined
Jan 25, 2009
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,310
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.
 

Increase the delay and check it... For 8051 series if u use 8 MHz crystal... Write a delay fuction like,
void Delay(unsigned int time)
{
while(time--);
}

then in main function call Delay(30000); Before making high and before making low.... This is approximately almost 1 sec delay... Or better u go with timer delay....
 

Hello kandhu26,

Thanks for the answer. But I am checking the location in debug mode and i am doing single stepping. Delay should not matter.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top