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
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 to figure out the problem.
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
Ok fine, I some how managed to blink the LED. Now another problem, immediately after the reset it glows very brightly for a single time and after that it is so faint that it is hardly visible! What could be the problem?
Put a similar "for (i=0;i<20000;i++)" inside the wait function. Sam
"As I told you I'm newbie, right now I don't know I to use simulator." You need to start by reading the uVision Getting Started Guide, and working through the example projects in it. This will give you a proper introduction to the tools, how they work, and how to use them - rather than just jumping-in blindly at the deep end. (The uVision Getting Started Guide is available on the 'Books' tab in the 'Project' Window; The 'Books' window is also available via the 'Help' menu; failing all that, search for GS51.PDF in your Keil folder)
I'm totally stuck, my hardware is working fine. I verified it with this asm example http://www.iguanalabs.com/1stmicro.htm. It seems that there is some problem on software side, maybe I'm unable to configure it properly! I need your valuable help. Thanks again
I'm totally stuck, How aboiut showing your code after the suggestions have been implemented. Erik