Professional Documents
Culture Documents
: 01
AIM
OBJECTIVES
APPARATUS
PROCEDURE
7. Then the AES 51 board was reset and the space bar was pressed.
8. Then typed “RX” and pressed enter.
9. Then alt+s was pressed.
10. Then the .HEX file was dropped onto the Terminal Emulator after the prompt was shown.
11. After that CALL 7000H was typed on the TE and pressed enter to run the program.
OBSERVATIONS
When we want to turn a LED connected to a output pin of the 8051 we have to make that pin
output 5 volts.
In the AES-51 board the LEDs are connected to the port 1. And they are connected through NOT
gates. Because of this difference in AES-51 development board we have to Make the bit value of
the corresponding pin to be 0 instead of 1.
To address the port 1 as P1 in our code we must first initialize the port 1 register
In order to do that we must write the code as P1 DATA 90H at the start of the program.
We can set bit value of each pin one by one to turn on the connected LED
As AES-51 is using NOT gates for output we have to clear the each bit
As a example when we want to turn on the LED connected to pin 0 of port one
we have to write the code as CLR P1.0
When we want to turn off the LED we must write SETB P1.0
But we have a easier way to set values for all the bits of the register by writing one line of code.
So for this experiment we use that method. Instead of writing code for each pin.
As a example when we want to turn on the LED connected to the first pin of the port 1,
we must write the code as MOV MOV P1,#01111111B
Then to animate the LED blinking We have to wait for some time before turning on the next LED so
for this purpose we use a software delay.
EXPERIMENT NO. : 02
DISPLAYNG CHARACTERS ON
LCD DISPLAY OF AES-51
DEVELOPMENT BOARD
AIM
OBJECTIVES
THEORY
AES-51 development board has a built in LCD display and it's capable of showing ASCII characters.
The address of the LCD is 0fff3h and it's controlled by 2 bits. Bit 90h (pin 0 of port 1) is
command/data where high = command and low = data. Bit 91h (pin 1 of port 1) is LCD enable.
Both data and command must be available at the LCD port for one millisecond before enable can
be pulled from low to high. The power up and initialization of the LCD is handled by the system
firmware.
APPARATUS
PROCEDURE
1. Program was written with the notepad according to the LAB sheet and saved as .ASM file
2. Then it was compiled using the ASM51.exe
3. Then the hex file for the program was written to the AES-51 board memory using the
terminal emulator.
4. Then it was executed by typing CALL 7000h in the terminal emulator
5. The character “A” was observed in the display.
6. Then the program was modified to show 3 characters.
7. After the program was executed and the result was observed.
8. Then the previous program was modified to show a given 3 digit number on the LCD
display.
9. Then the program was executed on the AES-51 development board and result was
observed.
OBSERVATIONS
• In the firs program given in the LAB sheet the characted “A” was displayed on the LCD
• After the program was modified to show “ABC” characters.
When the program was executed the characters were displayed correctly on the LCD
• In the third time the program was modified to show the given 3 digit number.
LST for Program 1: Display character “A” on LCD
2
7000 124100 3 CALL 4100H ;clear the LCD
7003 7441 4 MOV A, #65 ;ASCII value for “A”
7005 C290 5 CLR 90H ;select data write
7007 90FFF3 6 MOV DPTR, #0FFF3H ;LCD address
700A F0 7 MOVX @DPTR, A ;Send data to LCD
700B 7800 8 MOV R0, #0
9
700D D8FE 10 DJNZ R0, $ ;delay 1ms
700F D8FE 11 DJNZ R0, $ ;1020 machine cycles
7011 C291 12 CLR 91H ;strobe enable by clear
7013 D291 13 SETB 91H ;then set bit
7015 22 14 RET
15 END
VERSION 1.2h ASSEMBLY COMPLETE, 0 ERRORS FOUND
LST for Program 2 : Display characters “ABC” on LCD
AES-51 development board has a built-in LCD display. This display is configured by the firmware to
display the ASCII character for the value in the memory location 0fff3h.
This is 16 bit but the accumulator is 8 bit so we can't directly put the value in the accumulator to
this memory location so we have to use indirect addressing.
So we put the memory location for the LCD into the data pointer (DPTR) and after that we send the
value in the accumulator to the location of the address in the data pointer (DPTR)
the code for this is :
MOV DPTR, #0FFF3H
MOVX @DPTR, A
There is a enable pin in the LCD to trigger it. This pin requires a high→ low pulse to trigger the LCD
and print the character. To send that pulse we use the pin 1 of port 1.
It's done in the code by
CLR 91H
SETB 91H
But this is a low → high pulse; we have to use this pulse because the pin 1 of port 1 is connected
to the enable pin of the LCD through a NAND gate. So at the end it's sent to the LCD as a
high→ low pulse.
Before printing the character “A” there are characters on the LCD so the character “A” was printed
after those characters. Because of this we have to clear the LCD before sending data to the LCD
so for that we use the built-in method for clearing the LCD.
it's located at memory location 4100H so at the beginning of the program we use
“CALL 4100H” to clear the LCD
When printing multiple characters to the LCD it's done by printing one character at a time.
So in the program for printing “ABC” we have to use a delay to print one character at a time
When displaying a 3 digit character on the LCD we have to separate the digits because we can only
print one at a time.
So we use DIV command to do this.
When we use this command the value in the accumulator is dived by the value in the B register
and the accumulator is loaded with the quotient and B register with the remainder
as a example;
we have 147 in the accumulator and 100 in the B register
when we use the command DIV AB
accumulator is left with 1 and the B register has the 47
This B register is a special register in the 8051 microcontroller and it's used to division and
multiplication purposes.
EXPERIMENT NO. : 03
AIM
• Converting a analog voltage to it's corresponding digital output using A/D converter in
AES-51 development board.
OBJECTIVES
THEORY
A/D converter is used to output a digital value for a given analog voltage according to the
reference voltage set for the A/D converter.
In the AES-51 board ADC address is 0fff7h and the ADC control bit address is 93h (pin 3 of port 1).
ADC is started by writing anything to the address 0fff7h. And the 93h bit is kept high until the A/D
conversion is finished. After the conversion is finished 93h bit is set low to signal the completion of
the A/D conversion. At the end of this process the accumulator is loaded with the digital output
from the A/D conversion.
PROCEDURE
1. The program for the A/D conversion in the LAB sheet was examined.
2. Then it was combined with the previous program to display 3 digits on the LCD
3. Then a delay was used to update the LCD real-time with the ADC output.
4. This program was compiled using the AES51.exe and written to the AES-51 development
board using the terminal emulator.
5. Then the A/D input was connected to the ground and the LCD display was observed
6. After that A/D input was connected to the +5v and the LCD display was observed.
7. Then the fixed resistor and the variable resistor was connected as shown below.
+5v
ADC
8. Voltage across the variable resistor was measured using the multimeter while changing the
variable resistor.
9. A/D input of the AES-51 board was connected to the middle of the voltage divider and the
digital output was noted down for each multimeter reading.
10. Using the readings error percentage was calculated for each reading and the graph was
plotted.
OBSERVATIONS
• Digital output displayed on LCD when A/D was connected to ground = 000
• Digital output displayed on LCD when A/D was connected to +5V = 255
1) Sampling
This is the process of dividing the continuous analog signal to small steps.
The size of these steps varies with the resolution of the A/D IC and the reference voltage provided
to the IC. Resolution is the number of bits in the digital output of the IC
as a example the A/D IC in the AES-51 board has 8 bits resolution
2) Quantizing
The process of calculating the digital output according to the given analog signal is known as
Quantizing.
Digital out = V in
step size
3) Encoding
The process of recording the digital output for the given analog signal to memory is known as
encoding
In the AES-51 board we has the A/D converter IC ADC0804. It has 8 resolution bits and one analog
input. So it has digital output range of 0-255.
similar to the LCD on the AES-51 the A/D converter has it's own memory location it's addressed as
0fff7h. As this is 16 bit we have to use indirect addressing for transfer data between accumulator
and the 0fff7h memory location.
When we want to start the A/D conversion we have to put any value into this 0fff7h memory
location and set the 93h bit as high. Then the A/D conversion starts. At the end of the conversion
the 93h bit is set as low and the digital output from the A/D conversion is sent to the accumulator.
In this experiment we have used the program we designed for displaying the 3 digits on LCD in the
previous experiment. And it was combined with the A/D conversion program given in the LAB
sheet.
And after that we needed a way to update the digital output in real-time so we used a delay to
continuously refresh the ADC program and the output to the LCD.
While observing the digital output to each analog input we had to disconnect the A/D input pin to
keep the multimeter reading correct. Because when we connect the A/D input there builds a
parallel resistance to the variable resistor in the voltage divider.