0% found this document useful (0 votes)
198 views8 pages

Embedded Lab 8051 PPT (5!7!16)

This document provides an overview of embedded C programming for the 8051 microcontroller using Keil. It describes the 8051 architecture including its features such as 4K bytes of ROM, 128 bytes of RAM, 2 timers, 32 I/O pins, 1 serial port, and 6 interrupt sources. It also covers registers in the 8051, RAM allocation, and the program status word. Examples are given of 8051 C programs to send values from 00-FF to port 1 and to continuously toggle the bits of port 1 with a 250ms delay.

Uploaded by

prakash_neo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
198 views8 pages

Embedded Lab 8051 PPT (5!7!16)

This document provides an overview of embedded C programming for the 8051 microcontroller using Keil. It describes the 8051 architecture including its features such as 4K bytes of ROM, 128 bytes of RAM, 2 timers, 32 I/O pins, 1 serial port, and 6 interrupt sources. It also covers registers in the 8051, RAM allocation, and the program status word. Examples are given of 8051 C programs to send values from 00-FF to port 1 and to continuously toggle the bits of port 1 with a 250ms delay.

Uploaded by

prakash_neo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

EMBEDDED LAB

Embedded C in 8051 using


Keil

8051 ARCHITECTURE

FEATURES OF 8051
FEATURES

QUANTITY

ROM

4K bytes

RAM

128 bytes

Timer

I/O pins

32

Serial Port

Interrupt sources

REGISTERS IN 8051

RAM ALLOCATION IN 8051

PRGRAM STATUS WORD

Example program
Write an 8051 C program to send values 00-FF
to Port 1
#include <reg51.h>
void main(void)
{
unsigned char z;
for (z=0;z<=255;z++)
P1=z;
}

Example program
Write an 8051 C program to toggle
bits of P1 ports continuously with a
250 ms delay
#include <reg51.h>
void MSDelay(unsigned int);
void main(void)
{
while (1) //repeat forever
{
P1=0x55;
MSDelay(250);
P1=0xAA;
MSDelay(250);
}

void MSDelay(unsigned int


itime)
{
unsigned int i,j;
for (i=0;i<itime;i++)
for (j=0;j<1275;j++);
}

You might also like