Generate delay | Microcontroller › 8051 › Generate delay This topic has 1 reply, 2 voices, and was last updated 11 years, 4 months ago by alekhya. Viewing 2 posts - 1 through 2 (of 2 total) Author Posts April 22, 2013 at 5:12 pm #2299 Jason JordonParticipant how to generate delay of one second in a 8051 microcontroller?? April 23, 2013 at 5:14 am #9571 alekhyaParticipant u can generate the 1sec delay like this….check this i think so itz helpful to u #include<REG51.H> sbit led1 = P1^1; sbit led2 = P1^2; sbit led3 = P1^3; void delay (unsigned int k); void main() { led1 = 1; led2 = 0; led3 = 0; delay(1s); led1 = 0; led2 = 1; led3 = 1; delay(1s); } void delay(unsigned int k) { unsigned int i,j; for(i=0;i<k;i++) for(j=0;j<100;j++); } Author Posts Viewing 2 posts - 1 through 2 (of 2 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In