Steps For WRITING PROGRAM in Keil For 8051 Microcontroller
Steps For WRITING PROGRAM in Keil For 8051 Microcontroller
uVision 5
Target tab to configure microcontroller.
From the ‘’Option for target ‘target 1” Select
Change the crystal value from 24 MHz to 12 MHz and go to output tab.
Check the location of the folder. Provide a filename .C & ADD Close.
9. Enter the source code.
#include<reg51.h>
sbit led=P2^0; // led at PORT 2 pin 0
void Delay(void); // Delay function declaration
void main () // main function
{
led=0; //output PORT pin
while(1) // infinite loop
{
led = 1; // LED ON
Delay();
led = 0; // LED OFF
Delay();
}
}
void Delay(void) // delay function
{
int j;
int i;
for(i=0;i<10;i++)
{
for(j=0;j<10000;j++)
{
}
}
}
Save it
Click ok
Click on Play