8051 basic programming tutorial: In the following 8051 tutorial i used books to learn fundamental knowledge about Embedded system. After that i install Kiel compiler and Proteus simulator tool to implement following basic 8051 programming tutorial:
Interfacing of LED with 8051: In this tutorial LED is blink after 1 sec using 8051(AT89C51) controller. If you want to learn more kindly see tutorial on youtube as well.
>> Led Blink C Code: #include<reg51.h> // included 8051 header file sbit LED=P2^0; // assigned macro "LED" to pin P2.0
void delay(int t) // function to provide delay { int i,j; for(i=0;i<t;i++) { for(j=0;j<1275;j++); } }
void main() { LED=0; // making P2.0 output pin while(1) // infinite loop to blink continously { LED=1; // LED On delay(100); // delay LED=0; // LED Off delay(100); // delay }