![]() ![]() Now if you took the tutorial you are thinking what’s going on in delay() function. ![]() How to use internal timers of 8051 microcontroller for generating fixed delays.Also you will be able to know about the TMOD(Timer Mode) register bits. If you don’t go through the lesson then hurry up and take it You can calculate the values for TH and TL registers by using the formula given in the tutorial. The main thing in the code is delay() function & how is it working? To understand it you should know about the internal timer registers and i hope you take the tutorial mentioned above. Whole of this part is placed in while(1) loop making the Statements to execute for ever. This means led will glow for 1 second and then turn off for 1 second. led=0 is switching off our led after 1 second. delay() function is something that is the topic of this tutorial. Statement P1=0x00 is initializing Port-1 as Output. Then the statement sbit led=P1^0 is assigning Port-1 bit#0 a variable led.Ĭoming to main function. reg51.h is the header file necessary to be included in every project which is using keil(software) for writing and compiling code. First in code i included the header file. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |