Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/04/09 16:44
Read: times


 
#169394 - A doubt about programming the P89v51RD2.
I'm learning to program the NXP P89V51RD2 on a development board I designed. I'm using Keil to program the chip and Flash Magic to burn it. I started today by writing the following LED blinking program:
------------------------------------------------------
#include<reg51.h>
#include<stdio.h>

sbit LED=P1^0; //LED is connected to pin P1.0.

void main()
{
LED=0;
for(x=0;x<1275;x++)
for(y=0;y<1000;y++);
LED=1;
for(x=0;x<1275;x++)
for(y=0;y<1000;y++);
}
-------------------------------------------------------

What should be the ideal response to the above program?
In the case of my board, the LED blinks continually.Shouldn't the LED just blink once and then die out?
Since I'm programming in C for the first time, I really don't know what to do.
Thank you!
Yash.

List of 13 messages in thread
TopicAuthorDate
A doubt about programming the P89v51RD2.            01/01/70 00:00      
   I'm programming in C for the first time            01/01/70 00:00      
      I take it that you are programming for the first time..            01/01/70 00:00      
         FAQ            01/01/70 00:00      
            Another Problem!            01/01/70 00:00      
               Large number            01/01/70 00:00      
                  How to post legible source code            01/01/70 00:00      
               Delay loops in 'C'...            01/01/70 00:00      
                  Thank you.            01/01/70 00:00      
                     Did you not notice?            01/01/70 00:00      
                        I did notice the indentation.            01/01/70 00:00      
                           skim through the FAQ's (edited)            01/01/70 00:00      
   what your (missing) comments state            01/01/70 00:00      

Back to Subject List