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

Trouble with AT89S8252 programming

Hi all,

I'm new to 8051, have written this simple program, please see if this is correct

#include <AT89S8252.h>

void wait (void)
{
;
}

void main( void )
{
unsigned int i;

P1 = 0;

while(1)
{
P1=1;
for (i=0;i<20000;i++)
{
wait();
}
P1=0;
}
}

After compiling I got this hex

:0300000002001CDF
:0C001C00787FE4F6D8FD75810702000330
:0100280022B5
:10000300C292D292E4FFFE1200280FBF00010EBE7F
:090013004EF5BF20F2C29280E913
:00000001FF

Unfortunately this is not working when I programmed it on AT89S8252. Please help me to figure out the problem.

Thanks

Parents
  • As I told you I'm newbie, right now I don't know I to use simulator. So I tried programming AT89S8252 itself. I would appreciate if you please help me

    you are already helped:

    If you look at the port with a scope, I'm sure you'll see that it's working. The port is zero for a very-very short time. You might want to insert wait() in between p1=0 and p1=1.

    Erik

Reply
  • As I told you I'm newbie, right now I don't know I to use simulator. So I tried programming AT89S8252 itself. I would appreciate if you please help me

    you are already helped:

    If you look at the port with a scope, I'm sure you'll see that it's working. The port is zero for a very-very short time. You might want to insert wait() in between p1=0 and p1=1.

    Erik

Children