Power Supply for 8051 Microcontroller
December 29, 2016 | Author: Ashok Kalange | Category: N/A
Short Description
Download Power Supply for 8051 Microcontroller...
Description
c | || | || || ||| || | | | | | | | | | | ||||| ||| | ||| | | | || ||| |!|"#$""|!| || | || | | ||| || ||||| |$| %| | | | | | | | | | | || ||| || ||!|||| |! | ||| |&'|| |
||&|| ||()"| | | | | | | | | | |
Analog signals are very common inputs to embedded systems .Most transducers and sensors such as temperature ,pressure ,velocity ,humidity are analog. Therefore we need to convert these analog signals in to digital so that 8051 can read it.|
|| |ANALOG DIGITAL TO CONVERTER - ADC | ëommonly used ADë device ± ADë804
| ABOUT IC| PinOut ë
± ëhip
elect , active low
RD ± Read Digital data from ADë, H-L edge triggered WR --
tart conversion, L-H pulse edge triggered
INTR -- end of conversion, Goes low to indicate conversion done Data bits -- D0-D7| ëLK IN & ëLK R ± ëLK IN is an input pin connected to an external clock source when an external clock is used for timing. However, ADë804 has an internal clock
|
generator. To use the internal clock generator of the ADë804, the ëLK IN and ëLK R pins are connected to a capacitor and a resistor. In that case, the
|
clock frequency is determined by the equation.
| f = 1/1.1Rë R=10K and ë=150pF f=606Hz the conversion time is 110us.
|
|| |Input Voltage range| Default 0-5V. ëan be changed by setting different value for Vref/2 pin. Vin=Vin(+) ± Vin (-)| Range = 0 to 2x Vref/2. for Vin = 2x Vref/2. we get 256 as a digital output on
O |
O |
O | º |
O | |
|
|
|
|
|
|
|
|
|
O| |
D0-D7. (Refer Table)| tep
ize a
mallest change
± (2 x Vref/2)/ 256 for ADë804| for eg for step size 10mv ,digital output on D0-D7 changes by one count for every 10mv change of the input analog voltage.|
|Data Out Dout = Vin /
tep
ize|
for input vtg. of 2.56 volts (Vref=1.28 volts) and stepsize of 10mv Dout =2560/10 =256 or FF that is full scale output.|
Conversion Time Greater than 110us for ADë804
|
Resolution 8 bits for ADë804||
INTERFACING ADC804 TO 8051|
ignals to be interfaced (on the ADë804) ± D0-D7, RD, WR, INTR, ë ëan do both Memory mapping and IO mapping
| ± ëonnect D0-D7 of ADë804 to the data bus of the 8051 system ± ëonnect RD, WR of the ADë804 to the 8051 system (ensure polarity) ± ëonnect ë
of ADë804 to an appropriate address decoder output
± ëonnect INTR of ADë804 to an external interrupt Pin on the 8051 (INT0 or INT1)
|
± ëonnect D0-D7, RD, WR, ë , INTR to some port bits on the 8051 (12 in all).
| || Algorithm Make ë =0 and send a low-to-high to pin WR to start the conversion. Keep monitoring INTR ± If INTR =0, the conversion is finished and we can go to the next step. ± If INTR=1, keep polling until it goes low. After INTR=0, we make ë =0 and send a high-to-low pulse to RD to get the data out of the ADë804 chip.|
|| | |
|
| mov P1, #0xff ; To configure as input| ||
clr p3.7 ;ëhip select setb P3.6 ;RD=1 clr P3.5 ;WR=0 setb P3.5 ;WR=1- low to high transition ||
Ä jb P3.4, WAIT ;wait for INTR clr p3.7 ;generate cs to ADë clr P3.6 ;RD=0 -High to low transition mov A, P1 ;read digital o/p sjmp AGAIN
| | |
View more...
Comments