Hardware Kit:: LAB-6 Date: 12/03/18
Hardware Kit:: LAB-6 Date: 12/03/18
Hardware Kit:: LAB-6 Date: 12/03/18
LAB-6
Date: 12/03/18
Hardware kit :
Sockets for placing microcontrollers in (14, 16, 20 and 40- pin packages)
Connector for external power supply (DC 12V)
USB programmer
Power Supply Selector (external or via USB cable)
8 Mhz Quartz Crystal Oscillator
32 LEDs for output pin state indication
32 push buttons for input pin activation
Four 7-segment LED displays in multiplex mode
Graphic LCD display
Alphanumeric LCD display (4- or 8- bit mode)
Connector and driver for serial communication RS232
Digital thermometer DS1820
12- bit A/D converter (MCP3204)
12- bit D/A converter (MCP4921)
Reference voltage source 4.096V (MCP1541)
Multiple-pin connectors for direct access to I/O ports
EMBEDDED SYSTEMS
Programmer :
8MHz Oscillator :
The EASY8051A development system has built-in oscillator used as a clock signal
generator. The frequency of this oscillator is stabilized by 8Hz quartz crystal.
Besides, it is also possible to select internal RC oscillator during chip
programming,.
EMBEDDED SYSTEMS
LCD displays :
The EASY8051A development system provides connection to eather graphic or
alphanumeric LCD display. Both types of displays are connected by being placed
into appropriate connector and by switching position of the jumper J8. If displays
are not in use, all pins used for their operation are available for other applications.
Apart from connectors, there is also a potentiometer for contrast regulation on the
board.
EMBEDDED SYSTEMS
Q1) Write 8051 c and assembly code to blink the LED on port p1.0 with some
delay
C-Code :
#include<reg51.h>
sbit kir=P1^0;
for(j=0;j<=x;j++)
{ for(i=0;i<1257;i++)
int main(void)
{
EMBEDDED SYSTEMS
while(1)
kir = 1;
msdelay(500);
kir = 0;
msdelay(500);
Assembly code :
org 0h
k : mov r3,#0fh
setb p1.0
mov r2,#0fh
clr p1.0
h:djnz r2,h
jmp k
End
Port 1.0 is used as a output pin to blink the led after every 0.5 seconds
Microcontroller P1.0 is connected internally to a resistor and then to a LED .
So when this pin goes high led lights and after some delay it gets off.
Led in off state : Led in on state :
EMBEDDED SYSTEMS
Q2) Write 8051 c and assembly code to display number 2 on 7 segment display.
C-Code :
#include<reg51.h>
for(j=0;j<=x;j++)
{ for(i=0;i<1257;i++)
int main(void)
{
EMBEDDED SYSTEMS
P1= 0x00;
while(1)
P1 = 0x6b;
msdelay(500);
P1 = 0x00;
msdelay(500);
}}
Assembly code :
org 0h
k : mov r3,#0fh
mov 90h,#00h
mov r2,#0fh
mov 90h,#6bh
h:djnz r2,h
jmp k
end
All 7 segments displays on hardware kit are connected to port p1. So when number
equivalent to 0-9 is given to p1 , it displays on 7 segment display.
Number 2 on display :
EMBEDDED SYSTEMS