The 8051 Microcontroller and Embedded

(lily) #1
Department of Computer Science and Information EngineeringNational Cheng Kung University

9

‰INTERFACING LCD TO 8051LCD Data Sheet HANEL
One can put data at any location in the LCD and the following shows address locations and how they are accessed ¾AAAAAAA=000_0000 to 010_0111 for line1¾AAAAAAA=100_0000 to 110_0111 for line2

DB0 0 1 0 1
DB5 0 1 0 1

DB3 0 0 0 0

DB1 0 1 0 1

DB7 1 1 1 1

DB2 0 1 0 1
0
1
Line2 (max)

0
1
Line2 (min)

0
0
Line1 (max)

0
0
Line1 (min)

DB4
DB6
LCD Addressing for the LCDs of 40

×2 size

AA
AA
AA
A 1

(^00)
DB0DB1
DB2DB3
DB4DB5
DB6DB7
R/WRS
The upper address range can go as high as 0100111 for the 40-character-wide LCD, which corresponds to locations 0 to 39
Department of Computer Science and Information EngineeringNational Cheng Kung University
10
LCD TimingINTERFACING LCD TO 8051LCD Data Sheet(cont’) HANEL
E R/W RS
Data
tAS
tHtDSWttPWHAH
t= Enable pulse width PWH= 450 ns (minimum)
t= Data set up time DSW= 195 ns (minimum)
t= Data hold time H= 10 ns (minimum)
t= Hold time after E has AHcome down for both RS and R/W = 10 ns (minimum)t= Set up time prior to E AS(going high) for both RS and R/W = 140 ns (minimum)
Department of Computer Science and Information EngineeringNational Cheng Kung University
11
‰INTERFACING TO ADC AND SENSORSADC Devices HANEL
ADCs (analog-to-digital converters) are among the most widely used devices for data acquisition¾A physical quantity, like temperature, pressure, humidity, and velocity, etc., is converted to electrical (voltage, current) signals using a device called a
transducer
,
or sensor‰We need an analog-to-digital converter to translate the analog signals to digital numbers, so microcontroller can read them
Department of Computer Science and Information EngineeringNational Cheng Kung University
12
‰INTERFACING TO ADC AND SENSORSADC804 Chip HANEL
ADC804 IC is an analog-to-digital converter¾It works with +5 volts and has a resolution of 8 bits¾Conversion time
is another major factor in
judging an ADCƒConversion time is defined as the time it takes the ADC to convert the analog input to a digital (binary) numberƒIn ADC804 conversion time varies depending on the clocking signals applied to CLK R and CLK IN pins, but it cannot be faster than 110
μs

Free download pdf