Date post: | 11-Jun-2018 |
Category: |
Documents |
Upload: | dinhnguyet |
View: | 217 times |
Download: | 0 times |
LAMPIRAN
Daftar Komponen
NO. KOMPONEN TYPE JUMLAH
1. IC Lm741 1
2. IC Lm35 1
3. IC ADC 0804 1
4. IC Mikrokontroler at89s51 1
5. IC REGULATOR 7805 1
6. IC REGULATOR 7905 1
7. IC REGULATOR 7812 1
8. IC REGULATOR 7912 1
9. SEVEN SEGMENT Common Anoda 3
10. RESISTOR 10K 2
11. RESISTOR 20K 1
12. RESISTOR 2.2K 3
13. CAPASITOR 150pF 1
14. CAPASITOR 30pF 2
15. CAPASITOR 100nF 2
16. CAPASITOR 100µF 2
17. POTENSIOMETER 10K 1
18. TRAFO CT 3 Ampere 1
19. DIODA BRIDGE 2 Ampere 1
20. TRANSISTOR C9012 3
21. CRYSTAL 12 Mhz 1
8-bit Microcontroller with 4K Bytes In-System Programmable Flash
AT89S51
Preliminary
Rev. 2487A–10/01
Features• Compatible with MCS-51® Products• 4K Bytes of In-System Programmable (ISP) Flash Memory
– Endurance: 1000 Write/Erase Cycles• 4.0V to 5.5V Operating Range• Fully Static Operation: 0 Hz to 33 MHz• Three-level Program Memory Lock• 128 x 8-bit Internal RAM• 32 Programmable I/O Lines• Two 16-bit Timer/Counters• Six Interrupt Sources• Full Duplex UART Serial Channel• Low-power Idle and Power-down Modes• Interrupt Recovery from Power-down Mode• Watchdog Timer• Dual Data Pointer• Power-off Flag• Fast Programming Time• Flexible ISP Programming (Byte and Page Mode)
DescriptionThe AT89S51 is a low-power, high-performance CMOS 8-bit microcontroller with 4Kbytes of in-system programmable Flash memory. The device is manufactured usingAtmel’s high-density nonvolatile memory technology and is compatible with the indus-try-standard 80C51 instruction set and pinout. The on-chip Flash allows the programmemory to be reprogrammed in-system or by a conventional nonvolatile memory pro-grammer. By combining a versatile 8-bit CPU with in-system programmable Flash on amonolithic chip, the Atmel AT89S51 is a powerful microcontroller which provides ahighly-flexible and cost-effective solution to many embedded control applications.
The AT89S51 provides the following standard features: 4K bytes of Flash, 128 bytes ofRAM, 32 I/O lines, Watchdog timer, two data pointers, two 16-bit timer/counters, a five-vector two-level interrupt architecture, a full duplex serial port, on-chip oscillator, andclock circuitry. In addition, the AT89S51 is designed with static logic for operationdown to zero frequency and supports two software selectable power saving modes.The Idle Mode stops the CPU while allowing the RAM, timer/counters, serial port, andinterrupt system to continue functioning. The Power-down mode saves the RAM con-tents but freezes the oscillator, disabling all other chip functions until the next externalinterrupt or hardware reset.
1
Pin ConfigurationsPDIP
TQFP
1234567891011121314151617181920
4039383736353433323130292827262524232221
P1.0 P1.1P1.2P1.3P1.4
(MOSI) P1.5(MISO) P1.6(SCK) P1.7
RST(RXD) P3.0(TXD) P3.1(INT0) P3.2(INT1) P3.3
(T0) P3.4(T1) P3.5
(WR) P3.6(RD) P3.7
XTAL2XTAL1
GND
VCCP0.0 (AD0)P0.1 (AD1)P0.2 (AD2)P0.3 (AD3)P0.4 (AD4)P0.5 (AD5)P0.6 (AD6)P0.7 (AD7)EA/VPPALE/PROGPSENP2.7 (A15)P2.6 (A14)P2.5 (A13)P2.4 (A12)P2.3 (A11)P2.2 (A10)P2.1 (A9)P2.0 (A8)
1234567891011
3332313029282726252423
44 43 42 41 40 39 38 37 36 35 34
12 13 14 15 16 17 18 19 20 21 22
(MOSI) P1.5(MISO) P1.6(SCK) P1.7
RST(RXD) P3.0
NC(TXD) P3.1(INT0) P3.2(INT1) P3.3
(T0) P3.4(T1) P3.5
P0.4 (AD4)P0.5 (AD5)P0.6 (AD6)P0.7 (AD7)EA/VPPNCALE/PROGPSENP2.7 (A15)P2.6 (A14)P2.5 (A13)
P1.
4P
1.3
P1.
2P
1.1
P1.
0 N
CV
CC
P0.
0 (A
D0)
P0.
1 (A
D1)
P0.
2 (A
D2)
P0.
3 (A
D3)
(WR
) P
3.6
(RD
) P
3.7
XT
AL2
XT
AL1
GN
DG
ND
(A8)
P2.
0(A
9) P
2.1
(A10
) P
2.2
(A11
) P
2.3
(A12
) P
2.4
2 AT89S51
PLCC
7891011121314151617
3938373635343332313029
(MOSI) P1.5(MISO) P1.6(SCK) P1.7
RST(RXD) P3.0
NC(TXD) P3.1(INT0) P3.2(INT1) P3.3
(T0) P3.4(T1) P3.5
P0.4 (AD4)P0.5 (AD5)P0.6 (AD6)P0.7 (AD7)EA/VPPNCALE/PROGPSENP2.7 (A15)P2.6 (A14)P2.5 (A13)
6 5 4 3 2 1 44 43 42 41 40
18 19 20 21 22 23 24 25 26 27 28
(WR
) P
3.6
(RD
) P
3.7
XT
AL2
XT
AL1
GN
DN
C(A
8) P
2.0
(A9)
P2.
1(A
10)
P2.
2(A
11)
P2.
3(A
12)
P2.
4
P1.
4 P
1.3
P1.
2P
1.1
P1.
0 N
CV
CC
P0.
0 (A
D0)
P0.
1 (A
D1)
P0.
2 (A
D2)
P0.
3 (A
D3)
2487A–10/01
AT89S51
Block Diagram
PORT 2 DRIVERS
PORT 2LATCH
P2.0 - P2.7
FLASHPORT 0LATCHRAM
PROGRAMADDRESSREGISTER
BUFFER
PCINCREMENTER
PROGRAMCOUNTER
DUAL DPTRINSTRUCTIONREGISTER
BREGISTER
INTERRUPT, SERIAL PORT,AND TIMER BLOCKS
STACKPOINTERACC
TMP2 TMP1
ALU
PSW
TIMINGAND
CONTROL
PORT 1 DRIVERS
P1.0 - P1.7
PORT 3LATCH
PORT 3 DRIVERS
P3.0 - P3.7
OSC
GND
VCC
PSEN
ALE/PROG
EA / VPP
RST
RAM ADDR.
REGISTER
PORT 0 DRIVERS
P0.0 - P0.7
PORT 1LATCH
WATCHDOG
ISPPORT
PROGRAM
LOGIC
32487A–10/01
Pin Description
VCC Supply voltage.
GND Ground.
Port 0 Port 0 is an 8-bit open drain bidirectional I/O port. As an output port, each pin can sink eightTTL inputs. When 1s are written to port 0 pins, the pins can be used as high-impedanceinputs.
Port 0 can also be configured to be the multiplexed low-order address/data bus duringaccesses to external program and data memory. In this mode, P0 has internal pull-ups.
Port 0 also receives the code bytes during Flash programming and outputs the code bytesduring program verification. External pull-ups are required during program verification.
Port 1 Port 1 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 1 output buffers cansink/source four TTL inputs. When 1s are written to Port 1 pins, they are pulled high by theinternal pull-ups and can be used as inputs. As inputs, Port 1 pins that are externally beingpulled low will source current (IIL) because of the internal pull-ups.
Port 1 also receives the low-order address bytes during Flash programming and verification.
Port 2 Port 2 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 2 output buffers cansink/source four TTL inputs. When 1s are written to Port 2 pins, they are pulled high by theinternal pull-ups and can be used as inputs. As inputs, Port 2 pins that are externally beingpulled low will source current (IIL) because of the internal pull-ups.
Port 2 emits the high-order address byte during fetches from external program memory andduring accesses to external data memory that use 16-bit addresses (MOVX @ DPTR). In thisapplication, Port 2 uses strong internal pull-ups when emitting 1s. During accesses to externaldata memory that use 8-bit addresses (MOVX @ RI), Port 2 emits the contents of the P2 Spe-cial Function Register.
Port 2 also receives the high-order address bits and some control signals during Flash pro-gramming and verification.
Port 3 Port 3 is an 8-bit bidirectional I/O port with internal pull-ups. The Port 3 output buffers cansink/source four TTL inputs. When 1s are written to Port 3 pins, they are pulled high by theinternal pull-ups and can be used as inputs. As inputs, Port 3 pins that are externally beingpulled low will source current (IIL) because of the pull-ups.
Port 3 receives some control signals for Flash programming and verification.
Port 3 also serves the functions of various special features of the AT89S51, as shown in thefollowing table.
Port Pin Alternate Functions
P1.5 MOSI (used for In-System Programming)
P1.6 MISO (used for In-System Programming)
P1.7 SCK (used for In-System Programming)
4 AT89S512487A–10/01
AT89S51
RST Reset input. A high on this pin for two machine cycles while the oscillator is running resets thedevice. This pin drives High for 98 oscillator periods after the Watchdog times out. The DIS-RTO bit in SFR AUXR (address 8EH) can be used to disable this feature. In the default stateof bit DISRTO, the RESET HIGH out feature is enabled.
ALE/PROG Address Latch Enable (ALE) is an output pulse for latching the low byte of the address duringaccesses to external memory. This pin is also the program pulse input (PROG) during Flashprogramming.
In normal operation, ALE is emitted at a constant rate of 1/6 the oscillator frequency and maybe used for external timing or clocking purposes. Note, however, that one ALE pulse isskipped during each access to external data memory.
If desired, ALE operation can be disabled by setting bit 0 of SFR location 8EH. With the bit set,ALE is active only during a MOVX or MOVC instruction. Otherwise, the pin is weakly pulledhigh. Setting the ALE-disable bit has no effect if the microcontroller is in external executionmode.
PSEN Program Store Enable (PSEN) is the read strobe to external program memory.
When the AT89S51 is executing code from external program memory, PSEN is activatedtwice each machine cycle, except that two PSEN activations are skipped during each accessto external data memory.
EA/VPP External Access Enable. EA must be strapped to GND in order to enable the device to fetchcode from external program memory locations starting at 0000H up to FFFFH. Note, however,that if lock bit 1 is programmed, EA will be internally latched on reset.
EA should be strapped to VCC for internal program executions.
This pin also receives the 12-volt programming enable voltage (VPP) during Flashprogramming.
XTAL1 Input to the inverting oscillator amplifier and input to the internal clock operating circuit.
XTAL2 Output from the inverting oscillator amplifier
Port Pin Alternate Functions
P3.0 RXD (serial input port)
P3.1 TXD (serial output port)
P3.2 INT0 (external interrupt 0)
P3.3 INT1 (external interrupt 1)
P3.4 T0 (timer 0 external input)
P3.5 T1 (timer 1 external input)
P3.6 WR (external data memory write strobe)
P3.7 RD (external data memory read strobe)
52487A–10/01
Special Function Registers
A map of the on-chip memory area called the Special Function Register (SFR) space is shownin Table 1.
Note that not all of the addresses are occupied, and unoccupied addresses may not be imple-mented on the chip. Read accesses to these addresses will in general return random data,and write accesses will have an indeterminate effect.
Table 1. AT89S51 SFR Map and Reset Values
0F8H 0FFH
0F0HB
000000000F7H
0E8H 0EFH
0E0HACC
000000000E7H
0D8H 0DFH
0D0HPSW
000000000D7H
0C8H 0CFH
0C0H 0C7H
0B8HIP
XX0000000BFH
0B0HP3
111111110B7H
0A8HIE
0X0000000AFH
0A0HP2
11111111AUXR1
XXXXXXX0WDTRST
XXXXXXXX0A7H
98HSCON
00000000SBUF
XXXXXXXX9FH
90HP1
1111111197H
88HTCON
00000000TMOD
00000000TL0
00000000TL1
00000000TH0
00000000TH1
00000000AUXR
XXX00XX08FH
80HP0
11111111SP
00000111DP0L
00000000DP0H
00000000DP1L
00000000DP1H
00000000PCON
0XXX000087H
6 AT89S512487A–10/01
AT89S51
User software should not write 1s to these unlisted locations, since they may be used in futureproducts to invoke new features. In that case, the reset or inactive values of the new bits willalways be 0.
Interrupt Registers: The individual interrupt enable bits are in the IE register. Two prioritiescan be set for each of the five interrupt sources in the IP register.
Dual Data Pointer Registers: To facilitate accessing both internal and external data memory,two banks of 16-bit Data Pointer Registers are provided: DP0 at SFR address locations 82H-83H and DP1 at 84H-85H. Bit DPS = 0 in SFR AUXR1 selects DP0 and DPS = 1 selects DP1.The user should always initialize the DPS bit to the appropriate value before accessing therespective Data Pointer Register.
Table 2. AUXR: Auxiliary Register
AUXR Address = 8EH Reset Value = XXX00XX0B
Not Bit Addressable
– – – WDIDLE DISRTO – – DISALE
Bit 7 6 5 4 3 2 1 0
– Reserved for future expansion
DISALE Disable/Enable ALE
DISALEOperating Mode
0 ALE is emitted at a constant rate of 1/6 the oscillator frequency
1 ALE is active only during a MOVX or MOVC instruction
DISRTO Disable/Enable Reset out
DISRTO
0 Reset pin is driven High after WDT times out
1 Reset pin is input only
WDIDLE Disable/Enable WDT in IDLE mode
WDIDLE
0 WDT continues to count in IDLE mode
1 WDT halts counting in IDLE mode
72487A–10/01
Power Off Flag: The Power Off Flag (POF) is located at bit 4 (PCON.4) in the PCON SFR.POF is set to “1” during power up. It can be set and rest under software control and is notaffected by reset.
Memory Organization
MCS-51 devices have a separate address space for Program and Data Memory. Up to 64Kbytes each of external Program and Data Memory can be addressed.
Program Memory If the EA pin is connected to GND, all program fetches are directed to external memory.
On the AT89S51, if EA is connected to VCC, program fetches to addresses 0000H throughFFFH are directed to internal memory and fetches to addresses 1000H through FFFFH aredirected to external memory.
Data Memory The AT89S51 implements 128 bytes of on-chip RAM. The 128 bytes are accessible via directand indirect addressing modes. Stack operations are examples of indirect addressing, so the128 bytes of data RAM are available as stack space.
Watchdog Timer (One-time Enabled with Reset-out)
The WDT is intended as a recovery method in situations where the CPU may be subjected tosoftware upsets. The WDT consists of a 14-bit counter and the Watchdog Timer Reset(WDTRST) SFR. The WDT is defaulted to disable from exiting reset. To enable the WDT, auser must write 01EH and 0E1H in sequence to the WDTRST register (SFR location 0A6H).When the WDT is enabled, it will increment every machine cycle while the oscillator is running.The WDT timeout period is dependent on the external clock frequency. There is no way to dis-able the WDT except through reset (either hardware reset or WDT overflow reset). WhenWDT overflows, it will drive an output RESET HIGH pulse at the RST pin.
Using the WDT To enable the WDT, a user must write 01EH and 0E1H in sequence to the WDTRST register(SFR location 0A6H). When the WDT is enabled, the user needs to service it by writing 01EHand 0E1H to WDTRST to avoid a WDT overflow. The 14-bit counter overflows when it reaches16383 (3FFFH), and this will reset the device. When the WDT is enabled, it will incrementevery machine cycle while the oscillator is running. This means the user must reset the WDTat least every 16383 machine cycles. To reset the WDT the user must write 01EH and 0E1Hto WDTRST. WDTRST is a write-only register. The WDT counter cannot be read or written.When WDT overflows, it will generate an output RESET pulse at the RST pin. The RESETpulse duration is 98xTOSC, where TOSC=1/FOSC. To make the best use of the WDT, it
Table 3. AUXR1: Auxiliary Register 1
AUXR1Address = A2H
Reset Value = XXXXXXX0B
Not Bit Addressable
– – – – – – – DPS
Bit 7 6 5 4 3 2 1 0
– Reserved for future expansion
DPS Data Pointer Register Select
DPS
0 Selects DPTR Registers DP0L, DP0H
1 Selects DPTR Registers DP1L, DP1H
8 AT89S512487A–10/01
AT89S51
should be serviced in those sections of code that will periodically be executed within the timerequired to prevent a WDT reset.
WDT During Power-down and Idle
In Power-down mode the oscillator stops, which means the WDT also stops. While in Power-down mode, the user does not need to service the WDT. There are two methods of exitingPower-down mode: by a hardware reset or via a level-activated external interrupt, which isenabled prior to entering Power-down mode. When Power-down is exited with hardware reset,servicing the WDT should occur as it normally does whenever the AT89S51 is reset. ExitingPower-down with an interrupt is significantly different. The interrupt is held low long enough forthe oscillator to stabilize. When the interrupt is brought high, the interrupt is serviced. To pre-vent the WDT from resetting the device while the interrupt pin is held low, the WDT is notstarted until the interrupt is pulled high. It is suggested that the WDT be reset during the inter-rupt service for the interrupt used to exit Power-down mode.
To ensure that the WDT does not overflow within a few states of exiting Power-down, it is bestto reset the WDT just before entering Power-down mode.
Before going into the IDLE mode, the WDIDLE bit in SFR AUXR is used to determine whetherthe WDT continues to count if enabled. The WDT keeps counting during IDLE (WDIDLE bit =0) as the default state. To prevent the WDT from resetting the AT89S51 while in IDLE mode,the user should always set up a timer that will periodically exit IDLE, service the WDT, andreenter IDLE mode.
With WDIDLE bit enabled, the WDT will stop to count in IDLE mode and resumes the countupon exit from IDLE.
UART The UART in the AT89S51 operates the same way as the UART in the AT89C51. For furtherinformation on the UART operation, refer to the ATMEL Web site (http://www.atmel.com).From the home page, select ‘Products’, then ‘8051-Architecture Flash Microcontroller’, then‘Product Overview’.
Timer 0 and 1 Timer 0 and Timer 1 in the AT89S51 operate the same way as Timer 0 and Timer 1 in theAT89C51. For further information on the timers’ operation, refer to the ATMEL Web site(http://www.atmel.com). From the home page, select ‘Products’, then ‘8051-Architecture FlashMicrocontroller’, then ‘Product Overview’.
Interrupts The AT89S51 has a total of five interrupt vectors: two external interrupts (INT0 and INT1), twotimer interrupts (Timers 0 and 1), and the serial port interrupt. These interrupts are all shown inFigure 1.
Each of these interrupt sources can be individually enabled or disabled by setting or clearing abit in Special Function Register IE. IE also contains a global disable bit, EA, which disables allinterrupts at once.
Note that Table 4 shows that bit position IE.6 is unimplemented. In the AT89S51, bit positionIE.5 is also unimplemented. User software should not write 1s to these bit positions, since theymay be used in future AT89 products.
The Timer 0 and Timer 1 flags, TF0 and TF1, are set at S5P2 of the cycle in which the timersoverflow. The values are then polled by the circuitry in the next cycle
92487A–10/01
.
Figure 1. Interrupt Sources
Table 4. Interrupt Enable (IE) Register
(MSB) (LSB)
EA – – ES ET1 EX1 ET0 EX0
Enable Bit = 1 enables the interrupt.
Enable Bit = 0 disables the interrupt.
Symbol Position Function
EA IE.7 Disables all interrupts. If EA = 0, no interrupt is acknowledged. If EA = 1, each interrupt source is individually enabled or disabled by setting or clearing its enable bit.
– IE.6 Reserved
– IE.5 Reserved
ES IE.4 Serial Port interrupt enable bit
ET1 IE.3 Timer 1 interrupt enable bit
EX1 IE.2 External interrupt 1 enable bit
ET0 IE.1 Timer 0 interrupt enable bit
EX0 IE.0 External interrupt 0 enable bit
User software should never write 1s to reserved bits, because they may be used in future AT89 products.
IE1
IE0
1
1
0
0
TF1
TF0
INT1
INT0
TIRI
10 AT89S512487A–10/01
AT89S51
11
Oscillator Characteristics
XTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifier that can beconfigured for use as an on-chip oscillator, as shown in Figure 2. Either a quartz crystal orceramic resonator may be used. To drive the device from an external clock source, XTAL2should be left unconnected while XTAL1 is driven, as shown in Figure 3. There are no require-ments on the duty cycle of the external clock signal, since the input to the internal clockingcircuitry is through a divide-by-two flip-flop, but minimum and maximum voltage high and lowtime specifications must be observed.
Figure 2. Oscillator Connections
Note: C1, C2 = 30 pF ± 10 pF for Crystals = 40 pF ± 10 pF for Ceramic Resonators
Figure 3. External Clock Drive Configuration
Idle Mode In idle mode, the CPU puts itself to sleep while all the on-chip peripherals remain active. Themode is invoked by software. The content of the on-chip RAM and all the special functionregisters remain unchanged during this mode. The idle mode can be terminated by anyenabled interrupt or by a hardware reset.
Note that when idle mode is terminated by a hardware reset, the device normally resumes pro-gram execution from where it left off, up to two machine cycles before the internal resetalgorithm takes control. On-chip hardware inhibits access to internal RAM in this event, butaccess to the port pins is not inhibited. To eliminate the possibility of an unexpected write to aport pin when idle mode is terminated by a reset, the instruction following the one that invokesidle mode should not write to a port pin or to external memory.
Power-down Mode
In the Power-down mode, the oscillator is stopped, and the instruction that invokes Power-down is the last instruction executed. The on-chip RAM and Special Function Registers retaintheir values until the Power-down mode is terminated. Exit from Power-down mode can be ini-tiated either by a hardware reset or by activation of an enabled external interrupt into INT0 orINT1. Reset redefines the SFRs but does not change the on-chip RAM. The reset should notbe activated before VCC is restored to its normal operating level and must be held active longenough to allow the oscillator to restart and stabilize.
C2XTAL2
GND
XTAL1C1
XTAL2
XTAL1
GND
NC
EXTERNALOSCILLATOR
SIGNAL
2487A–10/01
Program Memory Lock Bits
The AT89S51 has three lock bits that can be left unprogrammed (U) or can be programmed(P) to obtain the additional features listed in the following table.
When lock bit 1 is programmed, the logic level at the EA pin is sampled and latched duringreset. If the device is powered up without a reset, the latch initializes to a random value andholds that value until reset is activated. The latched value of EA must agree with the currentlogic level at that pin in order for the device to function properly.
Programming the Flash – Parallel Mode
The AT89S51 is shipped with the on-chip Flash memory array ready to be programmed. Theprogramming interface needs a high-voltage (12-volt) program enable signal and is compati-ble with conventional third-party Flash or EPROM programmers.
The AT89S51 code memory array is programmed byte-by-byte.
Programming Algorithm: Before programming the AT89S51, the address, data, and controlsignals should be set up according to the Flash programming mode table and Figures 13 and14. To program the AT89S51, take the following steps:
1. Input the desired memory location on the address lines.
2. Input the appropriate data byte on the data lines.
3. Activate the correct combination of control signals.
4. Raise EA/VPP to 12V.
5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-write cycle is self-timed and typically takes no more than 50 µs. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached.
Data Polling: The AT89S51 features Data Polling to indicate the end of a byte write cycle.During a write cycle, an attempted read of the last byte written will result in the complement ofthe written data on P0.7. Once the write cycle has been completed, true data is valid on all out-puts, and the next cycle may begin. Data Polling may begin any time after a write cycle hasbeen initiated.
Table 5. Status of External Pins During Idle and Power-down Modes
Mode Program Memory ALE PSEN PORT0 PORT1 PORT2 PORT3
Idle Internal 1 1 Data Data Data Data
Idle External 1 1 Float Data Address Data
Power-down Internal 0 0 Data Data Data Data
Power-down External 0 0 Float Data Data Data
Table 6. Lock Bit Protection Modes
Program Lock Bits
LB1 LB2 LB3 Protection Type
1 U U U No program lock features
2 P U U MOVC instructions executed from external program memory are disabled from fetching code bytes from internal memory, EA is sampled and latched on reset, and further programming of the Flash memory is disabled
3 P P U Same as mode 2, but verify is also disabled
4 P P P Same as mode 3, but external execution is also disabled
12 AT89S512487A–10/01
AT89S51
Ready/Busy: The progress of byte programming can also be monitored by the RDY/BSY out-put signal. P3.0 is pulled low after ALE goes high during programming to indicate BUSY. P3.0is pulled high again when programming is done to indicate READY.
Program Verify: If lock bits LB1 and LB2 have not been programmed, the programmed codedata can be read back via the address and data lines for verification. The status of the individ-ual lock bits can be verified directly by reading them back.
Reading the Signature Bytes: The signature bytes are read by the same procedure as a nor-mal verification of locations 000H, 100H, and 200H, except that P3.6 and P3.7 must be pulledto a logic low. The values returned are as follows.
(000H) = 1EH indicates manufactured by Atmel(100H) = 51H indicates 89S51(200H) = 06H
Chip Erase: In the parallel programming mode, a chip erase operation is initiated by using theproper combination of control signals and by pulsing ALE/PROG low for a duration of 200 ns -500 ns.
In the serial programming mode, a chip erase operation is initiated by issuing the Chip Eraseinstruction. In this mode, chip erase is self-timed and takes about 500 ms.
During chip erase, a serial read from any address location will return 00H at the data output.
Programming the Flash – Serial Mode
The Code memory array can be programmed using the serial ISP interface while RST ispulled to VCC. The serial interface consists of pins SCK, MOSI (input) and MISO (output). AfterRST is set high, the Programming Enable instruction needs to be executed first before otheroperations can be executed. Before a reprogramming sequence can occur, a Chip Eraseoperation is required.
The Chip Erase operation turns the content of every memory location in the Code array intoFFH.
Either an external system clock can be supplied at pin XTAL1 or a crystal needs to be con-nected across pins XTAL1 and XTAL2. The maximum serial clock (SCK) frequency should beless than 1/16 of the crystal frequency. With a 33 MHz oscillator clock, the maximum SCK fre-quency is 2 MHz.
Serial Programming Algorithm
To program and verify the AT89S51 in the serial programming mode, the following sequenceis recommended:
1. Power-up sequence:
Apply power between VCC and GND pins.
Set RST pin to “H”.
If a crystal is not connected across pins XTAL1 and XTAL2, apply a 3 MHz to 33 MHzclock to XTAL1 pin and wait for at least 10 milliseconds.
2. Enable serial programming by sending the Programming Enable serial instruction to pin MOSI/P1.5. The frequency of the shift clock supplied at pin SCK/P1.7 needs to be less than the CPU clock at XTAL1 divided by 16.
3. The Code array is programmed one byte at a time in either the Byte or Page mode. The write cycle is self-timed and typically takes less than 0.5 ms at 5V.
4. Any memory location can be verified by using the Read instruction that returns the con-tent at the selected address at serial output MISO/P1.6.
5. At the end of a programming session, RST can be set low to commence normal device operation.
132487A–10/01
Power-off sequence (if needed):
Set XTAL1 to “L” (if a crystal is not used).
Set RST to “L”.
Turn VCC power off.
Data Polling: The Data Polling feature is also available in the serial mode. In this mode, dur-ing a write cycle an attempted read of the last byte written will result in the complement of theMSB of the serial output byte on MISO.
Serial Programming Instruction Set
The Instruction Set for Serial Programming follows a 4-byte protocol and is shown in Table 8on page 18.
Programming Interface – Parallel Mode
Every code byte in the Flash array can be programmed by using the appropriate combinationof control signals. The write operation cycle is self-timed and once initiated, will automaticallytime itself to completion.
All major programming vendors offer worldwide support for the Atmel microcontroller series.Please contact your local programming vendor for the appropriate software revision.
Notes: 1. Each PROG pulse is 200 ns - 500 ns for Chip Erase.2. Each PROG pulse is 200 ns - 500 ns for Write Code Data.3. Each PROG pulse is 200 ns - 500 ns for Write Lock Bits.4. RDY/BSY signal is output on P3.0 during programming.5. X = don’t care.
Table 7. Flash Programming Modes
Mode VCC RST PSEN
ALE/
PROG
EA/
VPP P2.6 P2.7 P3.3 P3.6 P3.7
P0.7-0
Data
P2.3-0 P1.7-0
Address
Write Code Data 5V H L(2)
12V L H H H H DIN A11-8 A7-0
Read Code Data 5V H L H H L L L H H DOUT A11-8 A7-0
Write Lock Bit 1 5V H L(3)
12V H H H H H X X X
Write Lock Bit 2 5V H L(3)
12V H H H L L X X X
Write Lock Bit 3 5V H L(3)
12V H L H H L X X X
Read Lock Bits
1, 2, 35V H L H H H H L H L
P0.2,P0.3,P0.4
X X
Chip Erase 5V H L(1)
12V H L H L L X X X
Read Atmel ID 5V H L H H L L L L L 1EH 0000 00H
Read Device ID 5V H L H H L L L L L 51H 0001 00H
Read Device ID 5V H L H H L L L L L 06H 0010 00H
14 AT89S512487A–10/01
AT89S51
Figure 4. Programming the Flash Memory (Parallel Mode)
Figure 5. Verifying the Flash Memory (Parallel Mode)
P1.0-P1.7
P2.6
P3.6
P2.0 - P2.3
A0 - A7ADDR.
0000H/FFFH
SEE FLASHPROGRAMMINGMODES TABLE
3-33 MHz
P0
V
P2.7
PGMDATA
PROG
V /VIH PP
VIH
ALE
P3.7
XTAL2 EA
RST
PSEN
XTAL1
GND
VCC
AT89S51
P3.3
P3.0RDY/BSY
A8 - A11
CC
P1.0-P1.7
P2.6
P3.6
P2.0 - P2.3
A0 - A7ADDR.
0000H/FFFH
SEE FLASHPROGRAMMINGMODES TABLE
3-33 MHz
P0
P2.7
PGM DATA(USE 10KPULLUPS)
VIH
VIH
ALE
P3.7
XTAL2 EA
RST
PSEN
XTAL1
GND
VCC
AT89S51
P3.3
A8 - A11
VCC
152487A–10/01
Figure 6. Flash Programming and Verification Waveforms – Parallel Mode
Flash Programming and Verification Characteristics (Parallel Mode)TA = 20°C to 30°C, VCC = 4.5 to 5.5V
Symbol Parameter Min Max Units
VPP Programming Supply Voltage 11.5 12.5 V
IPP Programming Supply Current 10 mA
ICC VCC Supply Current 30 mA
1/tCLCL Oscillator Frequency 3 33 MHz
tAVGL Address Setup to PROG Low 48tCLCL
tGHAX Address Hold After PROG 48tCLCL
tDVGL Data Setup to PROG Low 48tCLCL
tGHDX Data Hold After PROG 48tCLCL
tEHSH P2.7 (ENABLE) High to VPP 48tCLCL
tSHGL VPP Setup to PROG Low 10 µs
tGHSL VPP Hold After PROG 10 µs
tGLGH PROG Width 0.2 1 µs
tAVQV Address to Data Valid 48tCLCL
tELQV ENABLE Low to Data Valid 48tCLCL
tEHQZ Data Float After ENABLE 0 48tCLCL
tGHBL PROG High to BUSY Low 1.0 µs
tWC Byte Write Cycle Time 50 µs
tGLGHtGHSL
tAVGL
tSHGL
tDVGLtGHAX
tAVQV
tGHDX
tEHSH tELQV
tWC
BUSY READY
tGHBL
tEHQZ
P1.0 - P1.7P2.0 - P2.3
ALE/PROG
PORT 0
LOGIC 1LOGIC 0EA/VPP
VPP
P2.7(ENABLE)
P3.0(RDY/BSY)
PROGRAMMINGADDRESS
VERIFICATIONADDRESS
DATA IN DATA OUT
16 AT89S512487A–10/01
AT89S51
Figure 7. Flash Memory Serial Downloading
Flash Programming and Verification Waveforms – Serial Mode
Figure 8. Serial Programming Waveforms
P1.7/SCK
DATA OUTPUT
INSTRUCTIONINPUT
CLOCK IN
3-33 MHz
P1.5/MOSI
VIH
XTAL2
RSTXTAL1
GND
VCC
AT89S51
P1.6/MISO
VCC
7 6 5 4 3 2 1 0
172487A–10/01
Notes: 1. The signature bytes are not readable in Lock Bit Modes 3 and 4.2. B1 = 0, B2 = 0 → Mode 1, no lock protection
B1 = 0, B2 = 1 → Mode 2, lock bit 1 activatedB1 = 1, B2 = 0 → Mode 3, lock bit 2 activatedB1 = 1, B1 = 1 → Mode 4, lock bit 3 activated
After Reset signal is high, SCK should be low for at least 64 system clocks before it goes high to clock in the enable databytes. No pulsing of Reset signal is necessary. SCK should be no faster than 1/16 of the system clock at XTAL1.
For Page Read/Write, the data always starts from byte 0 to 255. After the command byte and upper address byte arelatched, each byte thereafter is treated as data until all 256 bytes are shifted in/out. Then the next instruction will be ready tobe decoded.
Table 8. Serial Programming Instruction Set
Instruction
Instruction Format
OperationByte 1 Byte 2 Byte 3 Byte 4
Programming Enable 1010 1100 0101 0011 xxxx xxxx xxxx xxxx0110 1001 (Output)
Enable Serial Programming while RST is high
Chip Erase 1010 1100 100x xxxx xxxx xxxx xxxx xxxx Chip Erase Flash memory array
Read Program Memory(Byte Mode)
0010 0000 xxxx Read data from Program memory in the byte mode
Write Program Memory(Byte Mode)
0100 0000 xxxx Write data to Program memory in the byte mode
Write Lock Bits(2) 1010 1100 1110 00 xxxx xxxx xxxx xxxx Write Lock bits. See Note (2).
Read Lock Bits 0010 0100 xxxx xxxx xxxx xxxx xx xx Read back current status of the lock bits (a programmed lock bit reads back as a “1”)
Read Signature Bytes(1) 0010 1000 xxx xxx xxxx Signature Byte Read Signature Byte
Read Program Memory(Page Mode)
0011 0000 xxxx Byte 0 Byte 1... Byte 255
Read data from Program memory in the Page Mode (256 bytes)
Write Program Memory(Page Mode)
0101 0000 xxxx Byte 0 Byte 1... Byte 255
Write data to Program memory in the Page Mode (256 bytes)
Each of the lock bits needs to be activated sequentially before Mode 4 can be executed.
D7
D6
D5
D4
D3
D2
D1
D0
A7
A6
A5
A4
A3
A2 A1
A0
A11
A10 A
9A
8B
2B
1
A11
A10 A
9A
8
A7
A6
A5
A4
A3
A2 A1
A0
D7
D6
D5
D4
D3
D2
D1
D0
LB3
LB2
LB1
A5
A4
A3
A2
A1
A11
A10 A
9A
8
A11
A10 A
9A
8
A0
18 AT89S512487A–10/01
AT89S51
192487A–10/01
Serial Programming Characteristics
Figure 9. Serial Programming Timing
MOSI
MISO
SCK
tOVSH
tSHSL
tSLSHtSHOX
tSLIV
Table 9. Serial Programming Characteristics, TA = -40°C to 85°C, VCC = 4.0 - 5.5V (Unless Otherwise Noted)
Symbol Parameter Min Typ Max Units
1/tCLCL Oscillator Frequency 0 33 MHz
tCLCL Oscillator Period 30 ns
tSHSL SCK Pulse Width High 8 tCLCL ns
tSLSH SCK Pulse Width Low 8 tCLCL ns
tOVSH MOSI Setup to SCK High tCLCL ns
tSHOX MOSI Hold after SCK High 2 tCLCL ns
tSLIV SCK Low to MISO Valid 10 16 32 ns
tERASE Chip Erase Instruction Cycle Time 500 ms
tSWC Serial Byte Write Cycle Time 64 tCLCL + 400 µs
Notes: 1. Under steady state (non-transient) conditions, IOL must be externally limited as follows:Maximum IOL per port pin: 10 mAMaximum IOL per 8-bit port:Port 0: 26 mA Ports 1, 2, 3: 15 mAMaximum total IOL for all output pins: 71 mAIf IOL exceeds the test condition, VOL may exceed the related specification. Pins are not guaranteed to sink current greaterthan the listed test conditions.
2. Minimum VCC for Power-down is 2V.
Absolute Maximum Ratings*Operating Temperature.................................. -55°C to +125°C *NOTICE: Stresses beyond those listed under “Absolute
Maximum Ratings” may cause permanent dam-age to the device. This is a stress rating only and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.
Storage Temperature ..................................... -65°C to +150°C
Voltage on Any Pinwith Respect to Ground .....................................-1.0V to +7.0V
Maximum Operating Voltage ............................................ 6.6V
DC Output Current...................................................... 15.0 mA
DC CharacteristicsThe values shown in this table are valid for TA = -40°C to 85°C and VCC = 4.0V to 5.5V, unless otherwise noted.
Symbol Parameter Condition Min Max Units
VIL Input Low Voltage (Except EA) -0.5 0.2 VCC-0.1 V
VIL1 Input Low Voltage (EA) -0.5 0.2 VCC-0.3 V
VIH Input High Voltage (Except XTAL1, RST) 0.2 VCC+0.9 VCC+0.5 V
VIH1 Input High Voltage (XTAL1, RST) 0.7 VCC VCC+0.5 V
VOL
Output Low Voltage(1) (Ports 1,2,3) IOL = 1.6 mA
0.45 V
VOL1
Output Low Voltage(1)
(Port 0, ALE, PSEN) IOL = 3.2 mA0.45 V
VOH
Output High Voltage(Ports 1,2,3, ALE, PSEN)
IOH = -60 µA, VCC = 5V ± 10% 2.4 V
IOH = -25 µA 0.75 VCC V
IOH = -10 µA 0.9 VCC V
VOH1
Output High Voltage(Port 0 in External Bus Mode)
IOH = -800 µA, VCC = 5V ± 10% 2.4 V
IOH = -300 µA 0.75 VCC V
IOH = -80 µA 0.9 VCC V
IIL
Logical 0 Input Current (Ports 1,2,3) VIN = 0.45V
-50 µA
ITL
Logical 1 to 0 Transition Current (Ports 1,2,3) VIN = 2V, VCC = 5V ± 10%
-650 µA
ILI
Input Leakage Current (Port 0, EA) 0.45 < VIN < VCC
±10 µA
RRST Reset Pulldown Resistor 50 300 KΩ
CIO Pin Capacitance Test Freq. = 1 MHz, TA = 25°C 10 pF
ICC
Power Supply Current
Active Mode, 12 MHz 25 mA
Idle Mode, 12 MHz 6.5 mA
Power-down Mode(2) VCC = 5.5V 50 µA
20 AT89S512487A–10/01
AT89S51
AC Characteristics Under operating conditions, load capacitance for Port 0, ALE/PROG, and PSEN = 100 pF; load capacitance for all otheroutputs = 80 pF.
External Program and Data Memory Characteristics
Symbol Parameter
12 MHz Oscillator Variable Oscillator
UnitsMin Max Min Max
1/tCLCL Oscillator Frequency 0 33 MHz
tLHLL ALE Pulse Width 127 2tCLCL-40 ns
tAVLL Address Valid to ALE Low 43 tCLCL-25 ns
tLLAX Address Hold After ALE Low 48 tCLCL-25 ns
tLLIV ALE Low to Valid Instruction In 233 4tCLCL-65 ns
tLLPL ALE Low to PSEN Low 43 tCLCL-25 ns
tPLPH PSEN Pulse Width 205 3tCLCL-45 ns
tPLIV PSEN Low to Valid Instruction In 145 3tCLCL-60 ns
tPXIX Input Instruction Hold After PSEN 0 0 ns
tPXIZ Input Instruction Float After PSEN 59 tCLCL-25 ns
tPXAV PSEN to Address Valid 75 tCLCL-8 ns
tAVIV Address to Valid Instruction In 312 5tCLCL-80 ns
tPLAZ PSEN Low to Address Float 10 10 ns
tRLRH RD Pulse Width 400 6tCLCL-100 ns
tWLWH WR Pulse Width 400 6tCLCL-100 ns
tRLDV RD Low to Valid Data In 252 5tCLCL-90 ns
tRHDX Data Hold After RD 0 0 ns
tRHDZ Data Float After RD 97 2tCLCL-28 ns
tLLDV ALE Low to Valid Data In 517 8tCLCL-150 ns
tAVDV Address to Valid Data In 585 9tCLCL-165 ns
tLLWL ALE Low to RD or WR Low 200 300 3tCLCL-50 3tCLCL+50 ns
tAVWL Address to RD or WR Low 203 4tCLCL-75 ns
tQVWX Data Valid to WR Transition 23 tCLCL-30 ns
tQVWH Data Valid to WR High 433 7tCLCL-130 ns
tWHQX Data Hold After WR 33 tCLCL-25 ns
tRLAZ RD Low to Address Float 0 0 ns
tWHLH RD or WR High to ALE High 43 123 tCLCL-25 tCLCL+25 ns
212487A–10/01
External Program Memory Read Cycle
External Data Memory Read Cycle
tLHLL
tLLIV
tPLIV
tLLAXtPXIZ
tPLPH
tPLAZtPXAV
tAVLL tLLPL
tAVIV
tPXIX
ALE
PSEN
PORT 0
PORT 2 A8 - A15
A0 - A7 A0 - A7
A8 - A15
INSTR IN
tLHLL
tLLDV
tLLWL
tLLAX
tWHLH
tAVLL
tRLRH
tAVDV
tAVWL
tRLAZ tRHDX
tRLDV tRHDZ
A0 - A7 FROM RI OR DPL
ALE
PSEN
RD
PORT 0
PORT 2 P2.0 - P2.7 OR A8 - A15 FROM DPH
A0 - A7 FROM PCL
A8 - A15 FROM PCH
DATA IN INSTR IN
22 AT89S512487A–10/01
AT89S51
External Data Memory Write Cycle
External Clock Drive Waveforms
tLHLL
tLLWL
tLLAX
tWHLH
tAVLL
tWLWH
tAVWL
tQVWXtQVWH
tWHQX
A0 - A7 FROM RI OR DPL
ALE
PSEN
WR
PORT 0
PORT 2 P2.0 - P2.7 OR A8 - A15 FROM DPH
A0 - A7 FROM PCL
A8 - A15 FROM PCH
DATA OUT INSTR IN
tCHCX
tCHCX
tCLCX
tCLCL
tCHCLtCLCHV - 0.5VCC
0.45V0.2 V - 0.1VCC
0.7 VCC
External Clock DriveSymbol Parameter Min Max Units
1/tCLCL Oscillator Frequency 0 33 MHz
tCLCL Clock Period 30 ns
tCHCX High Time 12 ns
tCLCX Low Time 12 ns
tCLCH Rise Time 5 ns
tCHCL Fall Time 5 ns
232487A–10/01
Shift Register Mode Timing Waveforms
AC Testing Input/Output Waveforms(1)
Note: 1. AC Inputs during testing are driven at VCC - 0.5V for a logic 1 and 0.45V for a logic 0. Timing measurements are made at VIHmin. for a logic 1 and VIL max. for a logic 0.
Float Waveforms(1)
Note: 1. For timing purposes, a port pin is no longer floating when a 100 mV change from load voltage occurs. A port pin begins tofloat when a 100 mV change from the loaded VOH/VOL level occurs.
Serial Port Timing: Shift Register Mode Test ConditionsThe values in this table are valid for VCC = 4.0V to 5.5V and Load Capacitance = 80 pF.
Symbol Parameter
12 MHz Osc Variable Oscillator
UnitsMin Max Min Max
tXLXL Serial Port Clock Cycle Time 1.0 12tCLCL µs
tQVXH Output Data Setup to Clock Rising Edge 700 10tCLCL-133 ns
tXHQX Output Data Hold After Clock Rising Edge 50 2tCLCL-80 ns
tXHDX Input Data Hold After Clock Rising Edge 0 0 ns
tXHDV Clock Rising Edge to Input Data Valid 700 10tCLCL-133 ns
tXHDV
tQVXH
tXLXL
tXHDX
tXHQX
ALE
INPUT DATA
CLEAR RI
OUTPUT DATA
WRITE TO SBUF
INSTRUCTION
CLOCK
0
0
1
1
2
2
3
3
4
4
5
5
6
6
7
7
SET TI
SET RI
8
VALID VALIDVALID VALIDVALID VALIDVALID VALID
0.45V
TEST POINTS
V - 0.5VCC 0.2 V + 0.9VCC
0.2 V - 0.1VCC
VLOAD+ 0.1V
Timing ReferencePoints
V
LOAD- 0.1V
LOAD
V VOL+ 0.1V
VOL- 0.1V
24 AT89S512487A–10/01
AT89S51
Ordering InformationSpeed(MHz)
PowerSupply Ordering Code Package Operation Range
24 4.0V to 5.5V AT89S51-24ACAT89S51-24JC
AT89S51-24PC
44A44J
40P6
Commercial(0°C to 70°C)
AT89S51-24AIAT89S51-24JIAT89S51-24PI
44A44J40P6
Industrial(-40°C to 85°C)
33 4.5V to 5.5V AT89S51-33AC
AT89S51-33JCAT89S51-33PC
44A
44J40P6
Commercial
(0°C to 70°C)
= Preliminary Availability
Package Type
44A 44-lead, Thin Plastic Gull Wing Quad Flatpack (TQFP)
44J 44-lead, Plastic J-leaded Chip Carrier (PLCC)
40P6 40-pin, 0.600" Wide, Plastic Dual Inline Package (PDIP)
252487A–10/01
Packaging Information
*Controlling dimension: millimeters
1.20(0.047) MAX
10.10(0.394)9.90(0.386)
SQ
12.21(0.478)11.75(0.458)
SQ
0.75(0.030)0.45(0.018)
0.15(0.006)0.05(0.002)
0.20(.008)0.09(.003)
07
0.80(0.031) BSC
PIN 1 ID
0.45(0.018)0.30(0.012)
26 AT89S51
.045(1.14) X 45° PIN NO. 1IDENTIFY
.045(1.14) X 30° - 45° .012(.305).008(.203)
.021(.533)
.013(.330)
.630(16.0)
.590(15.0)
.043(1.09)
.020(.508)
.120(3.05)
.090(2.29).180(4.57).165(4.19)
.500(12.7) REF SQ
.032(.813)
.026(.660)
.050(1.27) TYP
.022(.559) X 45° MAX (3X)
.656(16.7)
.650(16.5)
.695(17.7)
.685(17.4)SQ
SQ
2.07(52.6)2.04(51.8) PIN
1
.566(14.4)
.530(13.5)
.090(2.29)MAX
.005(.127)MIN
.065(1.65)
.015(.381)
.022(.559)
.014(.356).065(1.65).041(1.04)
015
REF
.690(17.5)
.610(15.5)
.630(16.0)
.590(15.0)
.012(.305)
.008(.203)
.110(2.79)
.090(2.29)
.161(4.09)
.125(3.18)
SEATINGPLANE
.220(5.59)MAX
1.900(48.26) REF
JEDEC STANDARD MS-011 AC
44A, 44-lead, Thin (1.0 mm) Plastic Gull Wing Quad Flat Package (TQFP)Dimensions in Millimeters and (Inches)*
44J, 44-lead, Plastic J-leaded Chip Carrier (PLCC)Dimensions in Inches and (Millimeters)
40P6, 40-pin, 0.600" Wide, Plastic Dual Inline Package (PDIP)Dimensions in Inches and (Millimeters)
2487A–10/01
© Atmel Corporation 2001.Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company’s standard warrantywhich is detailed in Atmel’s Terms and Conditions located on the Company’s web site. The Company assumes no responsibility for any errorswhich may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and doesnot make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are grantedby the Company in connection with the sale of Atmel products, expressly or by implication. Atmel’s products are not authorized for use as criticalcomponents in life support devices or systems.
Atmel Headquarters Atmel Product Operations
Corporate Headquarters2325 Orchard ParkwaySan Jose, CA 95131TEL (408) 441-0311FAX (408) 487-2600
EuropeAtmel SarLRoute des Arsenaux 41Casa Postale 80CH-1705 FribourgSwitzerlandTEL (41) 26-426-5555FAX (41) 26-426-5500
AsiaAtmel Asia, Ltd.Room 1219Chinachem Golden Plaza77 Mody Road TsimhatsuiEast KowloonHong KongTEL (852) 2721-9778FAX (852) 2722-1369
JapanAtmel Japan K.K.9F, Tonetsu Shinkawa Bldg.1-24-8 ShinkawaChuo-ku, Tokyo 104-0033JapanTEL (81) 3-3523-3551FAX (81) 3-3523-7581
Atmel Colorado Springs1150 E. Cheyenne Mtn. Blvd.Colorado Springs, CO 80906TEL (719) 576-3300FAX (719) 540-1759
Atmel GrenobleAvenue de RochepleineBP 12338521 Saint-Egreve Cedex, FranceTEL (33) 4-7658-3000FAX (33) 4-7658-3480
Atmel HeilbronnTheresienstrasse 2POB 3535D-74025 Heilbronn, GermanyTEL (49) 71 31 67 25 94FAX (49) 71 31 67 24 23
Atmel NantesLa ChantrerieBP 7060244306 Nantes Cedex 3, FranceTEL (33) 0 2 40 18 18 18FAX (33) 0 2 40 18 19 60
Atmel RoussetZone Industrielle13106 Rousset Cedex, FranceTEL (33) 4-4253-6000FAX (33) 4-4253-6001
Atmel Smart Card ICsScottish Enterprise Technology ParkEast Kilbride, Scotland G75 0QRTEL (44) 1355-357-000FAX (44) 1355-242-743
Web Sitehttp://www.atmel.com
Printed on recycled paper.
ATMEL® is the registered trademark of Atmel.
MCS-51® is the registered trademark of Intel Corporation. Terms and product names in this document may betrademarks of others.
2487A–10/01/xM
LM35Precision Centigrade Temperature SensorsGeneral DescriptionThe LM35 series are precision integrated-circuit temperaturesensors, whose output voltage is linearly proportional to theCelsius (Centigrade) temperature. The LM35 thus has anadvantage over linear temperature sensors calibrated in˚ Kelvin, as the user is not required to subtract a largeconstant voltage from its output to obtain convenient Centi-grade scaling. The LM35 does not require any externalcalibration or trimming to provide typical accuracies of ±1⁄4˚Cat room temperature and ±3⁄4˚C over a full −55 to +150˚Ctemperature range. Low cost is assured by trimming andcalibration at the wafer level. The LM35’s low output imped-ance, linear output, and precise inherent calibration makeinterfacing to readout or control circuitry especially easy. Itcan be used with single power supplies, or with plus andminus supplies. As it draws only 60 µA from its supply, it hasvery low self-heating, less than 0.1˚C in still air. The LM35 israted to operate over a −55˚ to +150˚C temperature range,while the LM35C is rated for a −40˚ to +110˚C range (−10˚with improved accuracy). The LM35 series is available pack-
aged in hermetic TO-46 transistor packages, while theLM35C, LM35CA, and LM35D are also available in theplastic TO-92 transistor package. The LM35D is also avail-able in an 8-lead surface mount small outline package and aplastic TO-220 package.
Featuresn Calibrated directly in ˚ Celsius (Centigrade)n Linear + 10.0 mV/˚C scale factorn 0.5˚C accuracy guaranteeable (at +25˚C)n Rated for full −55˚ to +150˚C rangen Suitable for remote applicationsn Low cost due to wafer-level trimmingn Operates from 4 to 30 voltsn Less than 60 µA current drainn Low self-heating, 0.08˚C in still airn Nonlinearity only ±1⁄4˚C typicaln Low impedance output, 0.1 Ω for 1 mA load
Typical Applications
DS005516-3
FIGURE 1. Basic Centigrade Temperature Sensor(+2˚C to +150˚C)
DS005516-4
Choose R1 = −VS/50 µAV OUT=+1,500 mV at +150˚C
= +250 mV at +25˚C= −550 mV at −55˚C
FIGURE 2. Full-Range Centigrade Temperature Sensor
November 2000LM
35P
recisionC
entigradeTem
peratureS
ensors
© 2000 National Semiconductor Corporation DS005516 www.national.com
Connection Diagrams
TO-46Metal Can Package*
DS005516-1
*Case is connected to negative pin (GND)
Order Number LM35H, LM35AH, LM35CH, LM35CAH orLM35DH
See NS Package Number H03H
TO-92Plastic Package
DS005516-2
Order Number LM35CZ,LM35CAZ or LM35DZ
See NS Package Number Z03A
SO-8Small Outline Molded Package
DS005516-21
N.C. = No Connection
Top ViewOrder Number LM35DM
See NS Package Number M08A
TO-220Plastic Package*
DS005516-24
*Tab is connected to the negative pin (GND).Note: The LM35DT pinout is different than the discontinued LM35DP.
Order Number LM35DTSee NS Package Number TA03F
LM35
www.national.com 2
Absolute Maximum Ratings (Note 10)
If Military/Aerospace specified devices are required,please contact the National Semiconductor Sales Office/Distributors for availability and specifications.
Supply Voltage +35V to −0.2VOutput Voltage +6V to −1.0VOutput Current 10 mAStorage Temp.;
TO-46 Package, −60˚C to +180˚CTO-92 Package, −60˚C to +150˚CSO-8 Package, −65˚C to +150˚CTO-220 Package, −65˚C to +150˚C
Lead Temp.:TO-46 Package,
(Soldering, 10 seconds) 300˚C
TO-92 and TO-220 Package,(Soldering, 10 seconds) 260˚C
SO Package (Note 12)Vapor Phase (60 seconds) 215˚CInfrared (15 seconds) 220˚C
ESD Susceptibility (Note 11) 2500VSpecified Operating Temperature Range: TMIN to T MAX(Note 2)
LM35, LM35A −55˚C to +150˚CLM35C, LM35CA −40˚C to +110˚CLM35D 0˚C to +100˚C
Electrical Characteristics(Notes 1, 6)
LM35A LM35CA
Parameter Conditions Tested Design Tested Design Units
Typical Limit Limit Typical Limit Limit (Max.)
(Note 4) (Note 5) (Note 4) (Note 5)
Accuracy T A=+25˚C ±0.2 ±0.5 ±0.2 ±0.5 ˚C
(Note 7) T A=−10˚C ±0.3 ±0.3 ±1.0 ˚C
T A=TMAX ±0.4 ±1.0 ±0.4 ±1.0 ˚C
T A=TMIN ±0.4 ±1.0 ±0.4 ±1.5 ˚C
Nonlinearity T MIN≤TA≤TMAX ±0.18 ±0.35 ±0.15 ±0.3 ˚C
(Note 8)
Sensor Gain T MIN≤TA≤TMAX +10.0 +9.9, +10.0 +9.9, mV/˚C
(Average Slope) +10.1 +10.1
Load Regulation T A=+25˚C ±0.4 ±1.0 ±0.4 ±1.0 mV/mA
(Note 3) 0≤IL≤1 mA T MIN≤TA≤TMAX ±0.5 ±3.0 ±0.5 ±3.0 mV/mA
Line Regulation T A=+25˚C ±0.01 ±0.05 ±0.01 ±0.05 mV/V
(Note 3) 4V≤V S≤30V ±0.02 ±0.1 ±0.02 ±0.1 mV/V
Quiescent Current V S=+5V, +25˚C 56 67 56 67 µA
(Note 9) V S=+5V 105 131 91 114 µA
V S=+30V, +25˚C 56.2 68 56.2 68 µA
V S=+30V 105.5 133 91.5 116 µA
Change of 4V≤VS≤30V, +25˚C 0.2 1.0 0.2 1.0 µA
Quiescent Current 4V≤V S≤30V 0.5 2.0 0.5 2.0 µA
(Note 3)
Temperature +0.39 +0.5 +0.39 +0.5 µA/˚C
Coefficient of
Quiescent Current
Minimum Temperature In circuit of +1.5 +2.0 +1.5 +2.0 ˚C
for Rated Accuracy Figure 1, IL=0
Long Term Stability T J=TMAX, for ±0.08 ±0.08 ˚C
1000 hours
LM35
www.national.com3
Electrical Characteristics(Notes 1, 6)
LM35 LM35C, LM35D
Parameter Conditions Tested Design Tested Design Units
Typical Limit Limit Typical Limit Limit (Max.)
(Note 4) (Note 5) (Note 4) (Note 5)
Accuracy, T A=+25˚C ±0.4 ±1.0 ±0.4 ±1.0 ˚C
LM35, LM35C T A=−10˚C ±0.5 ±0.5 ±1.5 ˚C
(Note 7) T A=TMAX ±0.8 ±1.5 ±0.8 ±1.5 ˚C
T A=TMIN ±0.8 ±1.5 ±0.8 ±2.0 ˚C
Accuracy, LM35D(Note 7)
T A=+25˚C ±0.6 ±1.5 ˚C
TA=TMAX ±0.9 ±2.0 ˚C
TA=TMIN ±0.9 ±2.0 ˚C
Nonlinearity T MIN≤TA≤TMAX ±0.3 ±0.5 ±0.2 ±0.5 ˚C
(Note 8)
Sensor Gain T MIN≤TA≤TMAX +10.0 +9.8, +10.0 +9.8, mV/˚C
(Average Slope) +10.2 +10.2
Load Regulation T A=+25˚C ±0.4 ±2.0 ±0.4 ±2.0 mV/mA
(Note 3) 0≤IL≤1 mA T MIN≤TA≤TMAX ±0.5 ±5.0 ±0.5 ±5.0 mV/mA
Line Regulation T A=+25˚C ±0.01 ±0.1 ±0.01 ±0.1 mV/V
(Note 3) 4V≤V S≤30V ±0.02 ±0.2 ±0.02 ±0.2 mV/V
Quiescent Current V S=+5V, +25˚C 56 80 56 80 µA
(Note 9) V S=+5V 105 158 91 138 µA
V S=+30V, +25˚C 56.2 82 56.2 82 µA
V S=+30V 105.5 161 91.5 141 µA
Change of 4V≤VS≤30V, +25˚C 0.2 2.0 0.2 2.0 µA
Quiescent Current 4V≤V S≤30V 0.5 3.0 0.5 3.0 µA
(Note 3)
Temperature +0.39 +0.7 +0.39 +0.7 µA/˚C
Coefficient of
Quiescent Current
Minimum Temperature In circuit of +1.5 +2.0 +1.5 +2.0 ˚C
for Rated Accuracy Figure 1, IL=0
Long Term Stability T J=TMAX, for ±0.08 ±0.08 ˚C
1000 hours
Note 1: Unless otherwise noted, these specifications apply: −55˚C≤TJ≤+150˚C for the LM35 and LM35A; −40˚≤TJ≤+110˚C for the LM35C and LM35CA; and0˚≤TJ≤+100˚C for the LM35D. VS=+5Vdc and ILOAD=50 µA, in the circuit of Figure 2. These specifications also apply from +2˚C to TMAX in the circuit of Figure 1.Specifications in boldface apply over the full rated temperature range.
Note 2: Thermal resistance of the TO-46 package is 400˚C/W, junction to ambient, and 24˚C/W junction to case. Thermal resistance of the TO-92 package is180˚C/W junction to ambient. Thermal resistance of the small outline molded package is 220˚C/W junction to ambient. Thermal resistance of the TO-220 packageis 90˚C/W junction to ambient. For additional thermal resistance information see table in the Applications section.
Note 3: Regulation is measured at constant junction temperature, using pulse testing with a low duty cycle. Changes in output due to heating effects can becomputed by multiplying the internal dissipation by the thermal resistance.
Note 4: Tested Limits are guaranteed and 100% tested in production.
Note 5: Design Limits are guaranteed (but not 100% production tested) over the indicated temperature and supply voltage ranges. These limits are not used tocalculate outgoing quality levels.
Note 6: Specifications in boldface apply over the full rated temperature range.
Note 7: Accuracy is defined as the error between the output voltage and 10mv/˚C times the device’s case temperature, at specified conditions of voltage, current,and temperature (expressed in ˚C).
Note 8: Nonlinearity is defined as the deviation of the output-voltage-versus-temperature curve from the best-fit straight line, over the device’s rated temperaturerange.
Note 9: Quiescent current is defined in the circuit of Figure 1.
Note 10: Absolute Maximum Ratings indicate limits beyond which damage to the device may occur. DC and AC electrical specifications do not apply when operatingthe device beyond its rated operating conditions. See Note 1.
Note 11: Human body model, 100 pF discharged through a 1.5 kΩ resistor.
Note 12: See AN-450 “Surface Mounting Methods and Their Effect on Product Reliability” or the section titled “Surface Mount” found in a current NationalSemiconductor Linear Data Book for other methods of soldering surface mount devices.
LM35
www.national.com 4
Typical Performance Characteristics
Thermal ResistanceJunction to Air
DS005516-25
Thermal Time Constant
DS005516-26
Thermal Responsein Still Air
DS005516-27
Thermal Response inStirred Oil Bath
DS005516-28
Minimum SupplyVoltage vs. Temperature
DS005516-29
Quiescent Currentvs. Temperature(In Circuit of Figure 1.)
DS005516-30
Quiescent Currentvs. Temperature(In Circuit of Figure 2.)
DS005516-31
Accuracy vs. Temperature(Guaranteed)
DS005516-32
Accuracy vs. Temperature(Guaranteed)
DS005516-33
LM35
www.national.com5
Typical Performance Characteristics (Continued)
ApplicationsThe LM35 can be applied easily in the same way as otherintegrated-circuit temperature sensors. It can be glued orcemented to a surface and its temperature will be withinabout 0.01˚C of the surface temperature.
This presumes that the ambient air temperature is almost thesame as the surface temperature; if the air temperature weremuch higher or lower than the surface temperature, theactual temperature of the LM35 die would be at an interme-diate temperature between the surface temperature and theair temperature. This is expecially true for the TO-92 plasticpackage, where the copper leads are the principal thermalpath to carry heat into the device, so its temperature mightbe closer to the air temperature than to the surface tempera-ture.
To minimize this problem, be sure that the wiring to theLM35, as it leaves the device, is held at the same tempera-ture as the surface of interest. The easiest way to do this isto cover up these wires with a bead of epoxy which willinsure that the leads and wires are all at the same tempera-ture as the surface, and that the LM35 die’s temperature willnot be affected by the air temperature.
The TO-46 metal package can also be soldered to a metalsurface or pipe without damage. Of course, in that case theV− terminal of the circuit will be grounded to that metal.Alternatively, the LM35 can be mounted inside a sealed-endmetal tube, and can then be dipped into a bath or screwedinto a threaded hole in a tank. As with any IC, the LM35 andaccompanying wiring and circuits must be kept insulated anddry, to avoid leakage and corrosion. This is especially true ifthe circuit may operate at cold temperatures where conden-sation can occur. Printed-circuit coatings and varnishes suchas Humiseal and epoxy paints or dips are often used toinsure that moisture cannot corrode the LM35 or its connec-tions.
These devices are sometimes soldered to a smalllight-weight heat fin, to decrease the thermal time constantand speed up the response in slowly-moving air. On theother hand, a small thermal mass may be added to thesensor, to give the steadiest reading despite small deviationsin the air temperature.
Temperature Rise of LM35 Due To Self-heating (Thermal Resistance, θJA)TO-46, TO-46*, TO-92, TO-92**, SO-8 SO-8** TO-220
no heatsink
small heat fin no heatsink
small heat fin no heatsink
small heat fin no heatsink
Still air 400˚C/W 100˚C/W 180˚C/W 140˚C/W 220˚C/W 110˚C/W 90˚C/W
Moving air 100˚C/W 40˚C/W 90˚C/W 70˚C/W 105˚C/W 90˚C/W 26˚C/W
Still oil 100˚C/W 40˚C/W 90˚C/W 70˚C/W
Stirred oil 50˚C/W 30˚C/W 45˚C/W 40˚C/W
(Clamped to metal,
Infinite heat sink) (24˚C/W) (55˚C/W)
*Wakefield type 201, or 1" disc of 0.020" sheet brass, soldered to case, or similar.**TO-92 and SO-8 packages glued and leads soldered to 1" square of 1/16" printed circuit board with 2 oz. foil or similar.
Noise Voltage
DS005516-34
Start-Up Response
DS005516-35
LM35
www.national.com 6
Typical Applications
CAPACITIVE LOADS
Like most micropower circuits, the LM35 has a limited abilityto drive heavy capacitive loads. The LM35 by itself is able todrive 50 pf without special precautions. If heavier loads areanticipated, it is easy to isolate or decouple the load with aresistor; see Figure 3. Or you can improve the tolerance ofcapacitance with a series R-C damper from output toground; see Figure 4.
When the LM35 is applied with a 200Ω load resistor asshown in Figure 5, Figure 6 or Figure 8 it is relatively immuneto wiring capacitance because the capacitance forms a by-pass from ground to input, not on the output. However, aswith any linear circuit connected to wires in a hostile envi-ronment, its performance can be affected adversely by in-tense electromagnetic sources such as relays, radio trans-mitters, motors with arcing brushes, SCR transients, etc, asits wiring can act as a receiving antenna and its internaljunctions can act as rectifiers. For best results in such cases,a bypass capacitor from VIN to ground and a series R-Cdamper such as 75Ω in series with 0.2 or 1 µF from output toground are often useful. These are shown in Figure 13,Figure 14, and Figure 16.
DS005516-19
FIGURE 3. LM35 with Decoupling from Capacitive Load
DS005516-20
FIGURE 4. LM35 with R-C Damper
DS005516-5
FIGURE 5. Two-Wire Remote Temperature Sensor(Grounded Sensor)
DS005516-6
FIGURE 6. Two-Wire Remote Temperature Sensor(Output Referred to Ground)
DS005516-7
FIGURE 7. Temperature Sensor, Single Supply, −55˚ to+150˚C
DS005516-8
FIGURE 8. Two-Wire Remote Temperature Sensor(Output Referred to Ground)
DS005516-9
FIGURE 9. 4-To-20 mA Current Source (0˚C to +100˚C)
LM35
www.national.com7
Typical Applications (Continued)
DS005516-10
FIGURE 10. Fahrenheit Thermometer
DS005516-11
FIGURE 11. Centigrade Thermometer (Analog Meter)
DS005516-12
FIGURE 12. Fahrenheit ThermometerExpanded ScaleThermometer
(50˚ to 80˚ Fahrenheit, for Example Shown)
DS005516-13
FIGURE 13. Temperature To Digital Converter (Serial Output) (+128˚C Full Scale)
DS005516-14
FIGURE 14. Temperature To Digital Converter (Parallel TRI-STATE ™ Outputs forStandard Data Bus to µP Interface) (128˚C Full Scale)
LM35
www.national.com 8
Typical Applications (Continued)
DS005516-16
*=1% or 2% film resistorTrim RB for VB=3.075VTrim RC for VC=1.955VTrim RA for VA=0.075V + 100mV/˚C x TambientExample, VA=2.275V at 22˚C
FIGURE 15. Bar-Graph Temperature Display (Dot Mode)
DS005516-15
FIGURE 16. LM35 With Voltage-To-Frequency Converter And Isolated Output(2˚C to +150˚C; 20 Hz to 1500 Hz)
LM35
www.national.com9
Block Diagram
DS005516-23
LM35
www.national.com 10
Physical Dimensions inches (millimeters) unless otherwise noted
TO-46 Metal Can Package (H)Order Number LM35H, LM35AH, LM35CH,
LM35CAH, or LM35DHNS Package Number H03H
SO-8 Molded Small Outline Package (M)Order Number LM35DM
NS Package Number M08A
LM35
www.national.com11
Physical Dimensions inches (millimeters) unless otherwise noted (Continued)
Power Package TO-220 (T)Order Number LM35DT
NS Package Number TA03F
LM35
www.national.com 12
Physical Dimensions inches (millimeters) unless otherwise noted (Continued)
LIFE SUPPORT POLICY
NATIONAL’S PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE SUPPORTDEVICES OR SYSTEMS WITHOUT THE EXPRESS WRITTEN APPROVAL OF THE PRESIDENT AND GENERALCOUNSEL OF NATIONAL SEMICONDUCTOR CORPORATION. As used herein:
1. Life support devices or systems are devices orsystems which, (a) are intended for surgical implantinto the body, or (b) support or sustain life, andwhose failure to perform when properly used inaccordance with instructions for use provided in thelabeling, can be reasonably expected to result in asignificant injury to the user.
2. A critical component is any component of a lifesupport device or system whose failure to performcan be reasonably expected to cause the failure ofthe life support device or system, or to affect itssafety or effectiveness.
National SemiconductorCorporationAmericasTel: 1-800-272-9959Fax: 1-800-737-7018Email: [email protected]
National SemiconductorEurope
Fax: +49 (0) 180-530 85 86Email: [email protected]
Deutsch Tel: +49 (0) 69 9508 6208English Tel: +44 (0) 870 24 0 2171Français Tel: +33 (0) 1 41 91 8790
National SemiconductorAsia Pacific CustomerResponse GroupTel: 65-2544466Fax: 65-2504466Email: [email protected]
National SemiconductorJapan Ltd.Tel: 81-3-5639-7560Fax: 81-3-5639-7507
www.national.com
TO-92 Plastic Package (Z)Order Number LM35CZ, LM35CAZ or LM35DZ
NS Package Number Z03A
LM35
Precision
Centigrade
Temperature
Sensors
National does not assume any responsibility for use of any circuitry described, no circuit patent licenses are implied and National reserves the right at any time without notice to change said circuitry and specifications.
TL/H/5671
AD
C0801/A
DC
0802/A
DC
0803/A
DC
0804/A
DC
0805
8-B
itm
PC
om
patib
leA
/D
Converte
rs
December 1994
ADC0801/ADC0802/ADC0803/ADC0804/ADC08058-Bit mP Compatible A/D Converters
General DescriptionThe ADC0801, ADC0802, ADC0803, ADC0804 and
ADC0805 are CMOS 8-bit successive approximation A/D
converters that use a differential potentiometric ladderÐ
similar to the 256R products. These converters are de-
signed to allow operation with the NSC800 and INS8080A
derivative control bus with TRI-STATEÉ output latches di-
rectly driving the data bus. These A/Ds appear like memory
locations or I/O ports to the microprocessor and no inter-
facing logic is needed.
Differential analog voltage inputs allow increasing the com-
mon-mode rejection and offsetting the analog zero input
voltage value. In addition, the voltage reference input can
be adjusted to allow encoding any smaller analog voltage
span to the full 8 bits of resolution.
FeaturesY Compatible with 8080 mP derivativesÐno interfacing
logic needed - access time - 135 nsY Easy interface to all microprocessors, or operates
‘‘stand alone’’
Y Differential analog voltage inputsY Logic inputs and outputs meet both MOS and TTL volt-
age level specificationsY Works with 2.5V (LM336) voltage referenceY On-chip clock generatorY 0V to 5V analog input voltage range with single 5V
supplyY No zero adjust requiredY 0.3× standard width 20-pin DIP packageY 20-pin molded chip carrier or small outline packageY Operates ratiometrically or with 5 VDC, 2.5 VDC, or ana-
log span adjusted voltage reference
Key SpecificationsY Resolution 8 bitsY Total error g(/4 LSB, g(/2 LSB and g1 LSBY Conversion time 100 ms
Typical Applications
TL/H/5671–1
8080 Interface
TL/H/5671–31
Error Specification (Includes Full-Scale,
Zero Error, and Non-Linearity)
PartFull-
VREF/2e2.500 VDC VREF/2eNo Connection
NumberScale
(No Adjustments) (No Adjustments)Adjusted
ADC0801 g(/4 LSB
ADC0802 g(/2 LSB
ADC0803 g(/2 LSB
ADC0804 g1 LSB
ADC0805 g1 LSB
TRI-STATEÉ is a registered trademark of National Semiconductor Corp.
Z-80É is a registered trademark of Zilog Corp.
C1995 National Semiconductor Corporation RRD-B30M115/Printed in U. S. A.
Absolute Maximum Ratings (Notes 1 & 2)
If Military/Aerospace specified devices are required,
please contact the National Semiconductor Sales
Office/Distributors for availability and specifications.
Supply Voltage (VCC) (Note 3) 6.5V
Voltage
Logic Control Inputs b0.3V to a18V
At Other Input and Outputs b0.3V to (VCCa0.3V)
Lead Temp. (Soldering, 10 seconds)
Dual-In-Line Package (plastic) 260§CDual-In-Line Package (ceramic) 300§CSurface Mount Package
Vapor Phase (60 seconds) 215§CInfrared (15 seconds) 220§C
Storage Temperature Range b65§C to a150§CPackage Dissipation at TAe25§C 875 mW
ESD Susceptibility (Note 10) 800V
Operating Ratings (Notes 1 & 2)
Temperature Range TMINsTAsTMAXADC0801/02LJ, ADC0802LJ/883 b55§CsTAsa125§CADC0801/02/03/04LCJ b40§CsTAsa85§CADC0801/02/03/05LCN b40§CsTAsa85§CADC0804LCN 0§CsTAsa70§CADC0802/03/04LCV 0§CsTAsa70§CADC0802/03/04LCWM 0§CsTAsa70§C
Range of VCC 4.5 VDC to 6.3 VDC
Electrical CharacteristicsThe following specifications apply for VCCe5 VDC, TMINsTAsTMAX and fCLKe640 kHz unless otherwise specified.
Parameter Conditions Min Typ Max Units
ADC0801: Total Adjusted Error (Note 8) With Full-Scale Adj.g(/4 LSB
(See Section 2.5.2)
ADC0802: Total Unadjusted Error (Note 8) VREF/2e2.500 VDC g(/2 LSB
ADC0803: Total Adjusted Error (Note 8) With Full-Scale Adj.g(/2 LSB
(See Section 2.5.2)
ADC0804: Total Unadjusted Error (Note 8) VREF/2e2.500 VDC g1 LSB
ADC0805: Total Unadjusted Error (Note 8) VREF/2-No Connection g1 LSB
VREF/2 Input Resistance (Pin 9) ADC0801/02/03/05 2.5 8.0 kXADC0804 (Note 9) 0.75 1.1 kX
Analog Input Voltage Range (Note 4) V(a) or V(b) Gnd–0.05 VCCa0.05 VDC
DC Common-Mode Error Over Analog Input Voltage g(/16 g(/8 LSBRange
Power Supply Sensitivity VCCe5 VDC g10% Over g(/16 g(/8 LSBAllowed VIN(a) and VIN(b)Voltage Range (Note 4)
AC Electrical CharacteristicsThe following specifications apply for VCCe5 VDC and TAe25§C unless otherwise specified.
Symbol Parameter Conditions Min Typ Max Units
TC Conversion Time fCLKe640 kHz (Note 6) 103 114 ms
TC Conversion Time (Note 5, 6) 66 73 1/fCLK
fCLK Clock Frequency VCCe5V, (Note 5) 100 640 1460 kHzClock Duty Cycle (Note 5) 40 60 %
CR Conversion Rate in Free-Running INTR tied to WR with 8770 9708 conv/sMode CSe0 VDC, fCLKe640 kHz
tW(WR)L Width of WR Input (Start Pulse Width) CSe0 VDC (Note 7) 100 ns
tACC Access Time (Delay from Falling CLe100 pF 135 200 nsEdge of RD to Output Data Valid)
t1H, t0H TRI-STATE Control (Delay CLe10 pF, RLe10k 125 200 nsfrom Rising Edge of RD to (See TRI-STATE TestHi-Z State) Circuits)
tWI, tRI Delay from Falling Edge 300 450 nsof WR or RD to Reset of INTR
CIN Input Capacitance of Logic 5 7.5 pFControl Inputs
COUT TRI-STATE Output 5 7.5 pFCapacitance (Data Buffers)
CONTROL INPUTS [Note: CLK IN (Pin 4) is the input of a Schmitt trigger circuit and is therefore specified separately]
VIN (1) Logical ‘‘1’’ Input Voltage VCCe5.25 VDC 2.0 15 VDC(Except Pin 4 CLK IN)
2
AC Electrical Characteristics (Continued)
The following specifications apply for VCC e 5VDC and TMIN s TA s TMAX, unless otherwise specified.
Symbol Parameter Conditions Min Typ Max Units
CONTROL INPUTS [Note: CLK IN (Pin 4) is the input of a Schmitt trigger circuit and is therefore specified separately]
VIN (0) Logical ‘‘0’’ Input Voltage VCCe4.75 VDC 0.8 VDC
(Except Pin 4 CLK IN)
IIN (1) Logical ‘‘1’’ Input Current VINe5 VDC 0.005 1 mADC
(All Inputs)
IIN (0) Logical ‘‘0’’ Input Current VINe0 VDC b1 b0.005 mADC
(All Inputs)
CLOCK IN AND CLOCK R
VTa CLK IN (Pin 4) Positive Going 2.7 3.1 3.5 VDC
Threshold Voltage
VTb CLK IN (Pin 4) Negative 1.5 1.8 2.1 VDC
Going Threshold Voltage
VH CLK IN (Pin 4) Hysteresis 0.6 1.3 2.0 VDC
(VTa)b(VTb)
VOUT (0) Logical ‘‘0’’ CLK R Output IOe360 mA 0.4 VDC
Voltage VCCe4.75 VDC
VOUT (1) Logical ‘‘1’’ CLK R Output IOeb360 mA 2.4 VDC
Voltage VCCe4.75 VDC
DATA OUTPUTS AND INTR
VOUT (0) Logical ‘‘0’’ Output Voltage
Data Outputs IOUTe1.6 mA, VCCe4.75 VDC 0.4 VDC
INTR Output IOUTe1.0 mA, VCCe4.75 VDC 0.4 VDC
VOUT (1) Logical ‘‘1’’ Output Voltage IOeb360 mA, VCCe4.75 VDC 2.4 VDC
VOUT (1) Logical ‘‘1’’ Output Voltage IOeb10 mA, VCCe4.75 VDC 4.5 VDC
IOUT TRI-STATE Disabled Output VOUTe0 VDC b3 mADC
Leakage (All Data Buffers) VOUTe5 VDC 3 mADC
ISOURCE VOUT Short to Gnd, TAe25§C 4.5 6 mADC
ISINK VOUT Short to VCC, TAe25§C 9.0 16 mADC
POWER SUPPLY
ICC Supply Current (Includes fCLKe640 kHz,
Ladder Current) VREF/2eNC, TAe25§Cand CSe5V
ADC0801/02/03/04LCJ/05 1.1 1.8 mA
ADC0804LCN/LCV/LCWM 1.9 2.5 mA
Note 1: Absolute Maximum Ratings indicate limits beyond which damage to the device may occur. DC and AC electrical specifications do not apply when operating
the device beyond its specified operating conditions.
Note 2: All voltages are measured with respect to Gnd, unless otherwise specified. The separate A Gnd point should always be wired to the D Gnd.
Note 3: A zener diode exists, internally, from VCC to Gnd and has a typical breakdown voltage of 7 VDC.
Note 4: For VIN(b)t VIN(a) the digital output code will be 0000 0000. Two on-chip diodes are tied to each analog input (see block diagram) which will forward
conduct for analog input voltages one diode drop below ground or one diode drop greater than the VCC supply. Be careful, during testing at low VCC levels (4.5V),
as high level analog inputs (5V) can cause this input diode to conduct–especially at elevated temperatures, and cause errors for analog inputs near full-scale. The
spec allows 50 mV forward bias of either diode. This means that as long as the analog VIN does not exceed the supply voltage by more than 50 mV, the output
code will be correct. To achieve an absolute 0 VDC to 5 VDC input voltage range will therefore require a minimum supply voltage of 4.950 VDC over temperature
variations, initial tolerance and loading.
Note 5: Accuracy is guaranteed at fCLK e 640 kHz. At higher clock frequencies accuracy can degrade. For lower clock frequencies, the duty cycle limits can be
extended so long as the minimum clock high time interval or minimum clock low time interval is no less than 275 ns.
Note 6: With an asynchronous start pulse, up to 8 clock periods may be required before the internal clock phases are proper to start the conversion process. The
start request is internally latched, see Figure 2 and section 2.0.
Note 7: The CS input is assumed to bracket the WR strobe input and therefore timing is dependent on the WR pulse width. An arbitrarily wide pulse width will hold
the converter in a reset mode and the start of conversion is initiated by the low to high transition of the WR pulse (see timing diagrams).
Note 8: None of these A/Ds requires a zero adjust (see section 2.5.1). To obtain zero code at other analog input voltages see section 2.5 and Figure 5.
Note 9: The VREF/2 pin is the center point of a two-resistor divider connected from VCC to ground. In all versions of the ADC0801, ADC0802, ADC0803, and
ADC0805, and in the ADC0804LCJ, each resistor is typically 16 kX. In all versions of the ADC0804 except the ADC0804LCJ, each resistor is typically 2.2 kX.
Note 10: Human body model, 100 pF discharged through a 1.5 kX resistor.
3
Typical Performance Characteristics
Logic Input Threshold Voltage
vs. Supply Voltage
Delay From Falling Edge of
RD to Output Data Valid
vs. Load Capacitance
CLK IN Schmitt Trip Levels
vs. Supply Voltage
fCLK vs. Clock Capacitor
Full-Scale Error vs
Conversion Time
Effect of Unadjusted Offset Error
vs. VREF/2 Voltage
Output Current vs
Temperature
Power Supply Current
vs Temperature (Note 9)
Linearity Error at Low
VREF/2 Voltages
TL/H/5671–2
4
TRI-STATE Test Circuits and Waveforms
t1H t1H, CLe10 pF
tre20 ns
t0H t0H, CLe10 pF
tre20 ns TL/H/5671–3
Timing Diagrams (All timing is measured from the 50% voltage points)
Output Enable and Reset INTR
Note: Read strobe must occur 8 clock periods (8/fCLK) after assertion of interrupt to guarantee reset of INTR.TL/H/5671–4
5
Typical Applications (Continued)
6800 Interface Ratiometric with Full-Scale Adjust
Note: before using caps at VIN or VREF/2,
see section 2.3.2 Input Bypass Capacitors.
Absolute with a 2.500V Reference
*For low power, see also LM385-2.5
Absolute with a 5V Reference
Zero-Shift and Span Adjust: 2VsVINs5V Span Adjust: 0VsVINs3V
TL/H/5671–5
6
Typical Applications (Continued)
Directly Converting a Low-Level Signal
VREF/2e256 mV
A mP Interfaced Comparator
For: VIN(a)lVIN(b)
OutputeFFHEX
For: VIN(a)kVIN(b)
Outpute00HEX
1 mV Resolution with mP Controlled Range
VREF/2e128 mV
1 LSBe1 mV
VDACsVINs(VDACa256 mV)
Digitizing a Current Flow
TL/H/5671–6
7
Typical Applications (Continued)
Self-Clocking Multiple A/Ds
*Use a large R value
to reduce loading
at CLK R output.
External Clocking
100 kHzsfCLKs1460 kHz
Self-Clocking in Free-Running Mode
*After power-up, a momentary grounding
of the WR input is needed to guarantee operation.
mP Interface for Free-Running A/D
Operating with ‘‘Automotive’’ Ratiometric Transducers
*VIN(b)e0.15 VCC
15% of VCCsVXDRs85% of VCC
Ratiometric with VREF/2 Forced
TL/H/5671–7
8
Typical Applications (Continued)
mP Compatible Differential-Input Comparator with Pre-Set VOS (with or without Hysteresis)
*See Figure 5 to select R value
DB7e‘‘1’’ for VIN(a)lVIN(b)a(VREF/2)
Omit circuitry within the dotted area if
hysteresis is not needed
Handling g10V Analog Inputs
*Beckman Instruments Ý694-3-R10K resistor array
Low-Cost, mP Interfaced, Temperature-to-Digital Converter
mP Interfaced Temperature-to-Digital Converter
*Circuit values shown are for 0§CsTAsa128§C**Can calibrate each sensor to allow easy replacement, then
A/D can be calibrated with a pre-set input voltage.
TL/H/5671–8
9
Typical Applications (Continued)
Handling g5V Analog Inputs
TL/H/5671–33
*Beckman Instruments Ý694-3-R10K resistor array
Read-Only Interface
TL/H/5671–34
mP Interfaced Comparator with Hysteresis
TL/H/5671–35
Analog Self-Test for a System
TL/H/5671–36
Protecting the Input
TL/H/5671–9
A Low-Cost, 3-Decade Logarithmic Converter
TL/H/5671–37*LM389 transistors
A, B, C, D e LM324A quad op amp
Diodes are 1N914
10
Typical Applications (Continued)
3-Decade Logarithmic A/D Converter
Noise Filtering the Analog Input
fCe20 Hz
Uses Chebyshev implementation for steeper roll-off
unity-gain, 2nd order, low-pass filter
Adding a separate filter for each channel increases
system response time if an analog multiplexer
is used
Multiplexing Differential Inputs
Output Buffers with A/D Data Enabled
*A/D output data is updated 1 CLK period
prior to assertion of INTR
Increasing Bus Drive and/or Reducing Time on Bus
*Allows output data to set-up at falling edge of CS
TL/H/5671–10
11
Typical Applications (Continued)
Sampling an AC Input Signal
Note 1: Oversample whenever possible [keep fs l 2f(b60)] to eliminate input frequency folding
(aliasing) and to allow for the skirt response of the filter.
Note 2: Consider the amplitude errors which are introduced within the passband of the filter.
70% Power Savings by Clock Gating
(Complete shutdown takes & 30 seconds.)
Power Savings by A/D and VREF Shutdown
TL/H/5671–11
*Use ADC0801, 02, 03 or 05 for lowest power consumption.
Note: Logic inputs can be driven to VCC with A/D supply at zero volts.
Buffer prevents data bus from overdriving output of A/D when in shutdown mode.
12
Functional Description1.0 UNDERSTANDING A/D ERROR SPECS
A perfect A/D transfer characteristic (staircase waveform) is
shown in Figure 1a. The horizontal scale is analog input
voltage and the particular points labeled are in steps of 1
LSB (19.53 mV with 2.5V tied to the VREF/2 pin). The digital
output codes that correspond to these inputs are shown as
Db1, D, and Da1. For the perfect A/D, not only will center-
value (Ab1, A, Aa1, . . . . ) analog inputs produce the cor-
rect output ditigal codes, but also each riser (the transitions
between adjacent output codes) will be located g(/2 LSB
away from each center-value. As shown, the risers are ideal
and have no width. Correct digital output codes will be pro-
vided for a range of analog input voltages that extend g(/2
LSB from the ideal center-values. Each tread (the range of
analog input voltage that provides the same digital output
code) is therefore 1 LSB wide.
Figure 1b shows a worst case error plot for the ADC0801.
All center-valued inputs are guaranteed to produce the cor-
rect output codes and the adjacent risers are guaranteed to
be no closer to the center-value points than g(/4 LSB. In
other words, if we apply an analog input equal to the center-
value g(/4 LSB, we guarantee that the A/D will produce the
correct digital code. The maximum range of the position of
the code transition is indicated by the horizontal arrow and it
is guaranteed to be no more than (/2 LSB.
The error curve of Figure 1c shows a worst case error plot
for the ADC0802. Here we guarantee that if we apply an
analog input equal to the LSB analog voltage center-value
the A/D will produce the correct digital code.
Next to each transfer function is shown the corresponding
error plot. Many people may be more familiar with error plots
than transfer functions. The analog input voltage to the A/D
is provided by either a linear ramp or by the discrete output
steps of a high resolution DAC. Notice that the error is con-
tinuously displayed and includes the quantization uncertain-
ty of the A/D. For example the error at point 1 of Figure 1ais a(/2 LSB because the digital code appeared (/2 LSB in
advance of the center-value of the tread. The error plots
always have a constant negative slope and the abrupt up-
side steps are always 1 LSB in magnitude.
Transfer Function Error Plot
a) Accuracyeg0 LSB: A Perfect A/D
Transfer Function Error Plot
b) Accuracyeg(/4 LSB
Transfer Function Error Plot
c) Accuracyeg(/2 LSB TL/H/5671–12
FIGURE 1. Clarifying the Error Specs of an A/D Converter
13
Functional Description (Continued)
2.0 FUNCTIONAL DESCRIPTION
The ADC0801 series contains a circuit equivalent of the
256R network. Analog switches are sequenced by succes-
sive approximation logic to match the analog difference in-
put voltage [VIN(a) b VIN(b)] to a corresponding tap on
the R network. The most significant bit is tested first and
after 8 comparisons (64 clock cycles) a digital 8-bit binary
code (1111 1111 e full-scale) is transferred to an output
latch and then an interrupt is asserted (INTR makes a high-
to-low transition). A conversion in process can be interrupt-
ed by issuing a second start command. The device may be
operated in the free-running mode by connecting INTR to
the WR input with CSe0. To ensure start-up under all pos-
sible conditions, an external WR pulse is required during the
first power-up cycle.
On the high-to-low transition of the WR input the internal
SAR latches and the shift register stages are reset. As long
as the CS input and WR input remain low, the A/D will re-
main in a reset state. Conversion will start from 1 to 8 clockperiods after at least one of these inputs makes a low-to-high transition .
A functional diagram of the A/D converter is shown in Fig-ure 2. All of the package pinouts are shown and the major
logic control paths are drawn in heavier weight lines.
The converter is started by having CS and WR simulta-
neously low. This sets the start flip-flop (F/F) and the result-
ing ‘‘1’’ level resets the 8-bit shift register, resets the Inter-
rupt (INTR) F/F and inputs a ‘‘1’’ to the D flop, F/F1, which
is at the input end of the 8-bit shift register. Internal clock
signals then transfer this ‘‘1’’ to the Q output of F/F1. The
AND gate, G1, combines this ‘‘1’’ output with a clock signal
to provide a reset signal to the start F/F. If the set signal is
no longer present (either WR or CS is a ‘‘1’’) the start F/F is
reset and the 8-bit shift register then can have the ‘‘1’’
clocked in, which starts the conversion process. If the set
signal were to still be present, this reset pulse would have
no effect (both outputs of the start F/F would momentarily
be at a ‘‘1’’ level) and the 8-bit shift register would continue
to be held in the reset mode. This logic therefore allows for
wide CS and WR signals and the converter will start after at
least one of these signals returns high and the internal
clocks again provide a reset signal for the start F/F.
TL/H/5671–13
Note 1: CS shown twice for clarity.
Note 2: SAR e Successive Approximation Register.
FIGURE 2. Block Diagram
14
Functional Description (Continued)
After the ‘‘1’’ is clocked through the 8-bit shift register
(which completes the SAR search) it appears as the input to
the D-type latch, LATCH 1. As soon as this ‘‘1’’ is output
from the shift register, the AND gate, G2, causes the new
digital word to transfer to the TRI-STATE output latches.
When LATCH 1 is subsequently enabled, the Q output
makes a high-to-low transition which causes the INTR F/F
to set. An inverting buffer then supplies the INTR input sig-
nal.
Note that this SET control of the INTR F/F remains low for
8 of the external clock periods (as the internal clocks run at
(/8 of the frequency of the external clock). If the data output
is continuously enabled (CS and RD both held low), the
INTR output will still signal the end of conversion (by a high-
to-low transition), because the SET input can control the Q
output of the INTR F/F even though the RESET input is
constantly at a ‘‘1’’ level in this operating mode. This INTR
output will therefore stay low for the duration of the SET
signal, which is 8 periods of the external clock frequency
(assuming the A/D is not started during this interval).
When operating in the free-running or continuous conver-
sion mode (INTR pin tied to WR and CS wired lowÐsee
also section 2.8), the START F/F is SET by the high-to-low
transition of the INTR signal. This resets the SHIFT REGIS-
TER which causes the input to the D-type latch, LATCH 1,
to go low. As the latch enable input is still present, the Q
output will go high, which then allows the INTR F/F to be
RESET. This reduces the width of the resulting INTR output
pulse to only a few propagation delays (approximately 300
ns).
When data is to be read, the combination of both CS and
RD being low will cause the INTR F/F to be reset and the
TRI-STATE output latches will be enabled to provide the 8-
bit digital outputs.
2.1 Digital Control Inputs
The digital control inputs (CS, RD, and WR) meet standard
T2L logic voltage levels. These signals have been renamed
when compared to the standard A/D Start and Output En-
able labels. In addition, these inputs are active low to allow
an easy interface to microprocessor control busses. For
non-microprocessor based applications, the CS input (pin 1)
can be grounded and the standard A/D Start function is
obtained by an active low pulse applied at the WR input (pin
3) and the Output Enable function is caused by an active
low pulse at the RD input (pin 2).
2.2 Analog Differential Voltage Inputs and
Common-Mode Rejection
This A/D has additional applications flexibility due to the
analog differential voltage input. The VIN(b) input (pin 7)
can be used to automatically subtract a fixed voltage value
from the input reading (tare correction). This is also useful in
4 mA–20 mA current loop conversion. In addition, common-
mode noise can be reduced by use of the differential input.
The time interval between sampling VIN(a) and VIN(b) is 4-
(/2 clock periods. The maximum error voltage due to this
slight time difference between the input voltage samples is
given by:
DVe(MAX) e (VP) (2qfcm) # 4.5
fCLK J ,
where:
DVe is the error voltage due to sampling delay
VP is the peak value of the common-mode voltage
fcm is the common-mode frequency
As an example, to keep this error to (/4 LSB (E5 mV) when
operating with a 60 Hz common-mode frequency, fcm, and
using a 640 kHz A/D clock, fCLK, would allow a peak value
of the common-mode voltage, VP, which is given by:
VP e
[DVe(MAX) (fCLK)](2qfcm) (4.5)
or
VP e
(5 c 10b3) (640c103)
(6.28) (60) (4.5)
which gives
VPj1.9V.
The allowed range of analog input voltages usually places
more severe restrictions on input common-mode noise lev-
els.
An analog input voltage with a reduced span and a relatively
large zero offset can be handled easily by making use of the
differential input (see section 2.4 Reference Voltage).
2.3 Analog Inputs
2.3.1 Input Current
Normal Mode
Due to the internal switching action, displacement currents
will flow at the analog inputs. This is due to on-chip stray
capacitance to ground as shown in Figure 3.
TL/H/5671–14
rON of SW 1 and SW 2 j 5 kX
rerON CSTRAY j 5 kX c 12 pF e 60 ns
FIGURE 3. Analog Input Impedance
15
Functional Description (Continued)
The voltage on this capacitance is switched and will result in
currents entering the VIN(a) input pin and leaving the
VIN(b) input which will depend on the analog differential
input voltage levels. These current transients occur at the
leading edge of the internal clocks. They rapidly decay and
do not cause errors as the on-chip comparator is strobed at
the end of the clock period.
Fault Mode
If the voltage source applied to the VIN(a) or VIN(b) pin
exceeds the allowed operating range of VCCa50 mV, large
input currents can flow through a parasitic diode to the VCCpin. If these currents can exceed the 1 mA max allowed
spec, an external diode (1N914) should be added to bypass
this current to the VCC pin (with the current bypassed with
this diode, the voltage at the VIN(a) pin can exceed the
VCC voltage by the forward voltage of this diode).
2.3.2 Input Bypass Capacitors
Bypass capacitors at the inputs will average these charges
and cause a DC current to flow through the output resist-
ances of the analog signal sources. This charge pumping
action is worse for continuous conversions with the VIN(a)
input voltage at full-scale. For continuous conversions with
a 640 kHz clock frequency with the VIN(a) input at 5V, this
DC current is at a maximum of approximately 5 mA. There-
fore, bypass capacitors should not be used at the analoginputs or the VREF/2 pin for high resistance sources (l 1
kX). If input bypass capacitors are necessary for noise filter-
ing and high source resistance is desirable to minimize ca-
pacitor size, the detrimental effects of the voltage drop
across this input resistance, which is due to the average
value of the input current, can be eliminated with a full-scale
adjustment while the given source resistor and input bypass
capacitor are both in place. This is possible because the
average value of the input current is a precise linear func-
tion of the differential input voltage.
2.3.3 Input Source Resistance
Large values of source resistance where an input bypass
capacitor is not used, will not cause errors as the input cur-
rents settle out prior to the comparison time. If a low pass
filter is required in the system, use a low valued series resis-
tor (s 1 kX) for a passive RC section or add an op amp RC
active low pass filter. For low source resistance applica-
tions, (s 1 kX), a 0.1 mF bypass capacitor at the inputs will
prevent noise pickup due to series lead inductance of a long
wire. A 100X series resistor can be used to isolate this ca-
pacitorÐboth the R and C are placed outside the feedback
loopÐfrom the output of an op amp, if used.
2.3.4 Noise
The leads to the analog inputs (pin 6 and 7) should be kept
as short as possible to minimize input noise coupling. Both
noise and undesired digital clock coupling to these inputs
can cause system errors. The source resistance for these
inputs should, in general, be kept below 5 kX. Larger values
of source resistance can cause undesired system noise
pickup. Input bypass capacitors, placed from the analog in-
puts to ground, will eliminate system noise pickup but can
create analog scale errors as these capacitors will average
the transient input switching currents of the A/D (see sec-
tion 2.3.1.). This scale error depends on both a large source
resistance and the use of an input bypass capacitor. This
error can be eliminated by doing a full-scale adjustment of
the A/D (adjust VREF/2 for a proper full-scale readingÐsee
section 2.5.2 on Full-Scale Adjustment) with the source re-
sistance and input bypass capacitor in place.
2.4 Reference Voltage
2.4.1 Span Adjust
For maximum applications flexibility, these A/Ds have been
designed to accommodate a 5 VDC, 2.5 VDC or an adjusted
voltage reference. This has been achieved in the design of
the IC as shown in Figure 4.
TL/H/5671–15
FIGURE 4. The VREFERENCE Design on the IC
Notice that the reference voltage for the IC is either (/2 of
the voltage applied to the VCC supply pin, or is equal to the
voltage that is externally forced at the VREF/2 pin. This al-
lows for a ratiometric voltage reference using the VCC sup-
ply, a 5 VDC reference voltage can be used for the VCCsupply or a voltage less than 2.5 VDC can be applied to the
VREF/2 input for increased application flexibility. The inter-
nal gain to the VREF/2 input is 2, making the full-scale differ-
ential input voltage twice the voltage at pin 9.
An example of the use of an adjusted reference voltage is to
accommodate a reduced spanÐor dynamic voltage range
of the analog input voltage. If the analog input voltage were
to range from 0.5 VDC to 3.5 VDC, instead of 0V to 5 VDC,
the span would be 3V as shown in Figure 5. With 0.5 VDCapplied to the VIN(b) pin to absorb the offset, the reference
voltage can be made equal to (/2 of the 3V span or 1.5 VDC.
The A/D now will encode the VIN(a) signal from 0.5V to 3.5
V with the 0.5V input corresponding to zero and the 3.5 VDCinput corresponding to full-scale. The full 8 bits of resolution
are therefore applied over this reduced analog input voltage
range.
16
Functional Description (Continued)
*Add if VREF/2 s 1 VDC with LM358
to draw 3 mA to ground.
TL/H/5671–16
a) Analog Input Signal Example b) Accommodating an Analog Input from
0.5V (Digital Out ee00HEX) to 3.5V
(Digital OuteFFHEX)
FIGURE 5. Adapting the A/D Analog Input Voltages to Match an Arbitrary Input Signal Range
2.4.2 Reference Accuracy Requirements
The converter can be operated in a ratiometric mode or an
absolute mode. In ratiometric converter applications, the
magnitude of the reference voltage is a factor in both the
output of the source transducer and the output of the A/D
converter and therefore cancels out in the final digital output
code. The ADC0805 is specified particularly for use in ratio-
metric applications with no adjustments required. In abso-
lute conversion applications, both the initial value and the
temperature stability of the reference voltage are important
factors in the accuracy of the A/D converter. For VREF/2
voltages of 2.4 VDC nominal value, initial errors of g10
mVDC will cause conversion errors of g1 LSB due to the
gain of 2 of the VREF/2 input. In reduced span applications,
the initial value and the stability of the VREF/2 input voltage
become even more important. For example, if the span is
reduced to 2.5V, the analog input LSB voltage value is cor-
respondingly reduced from 20 mV (5V span) to 10 mV and
1 LSB at the VREF/2 input becomes 5 mV. As can be seen,
this reduces the allowed initial tolerance of the reference
voltage and requires correspondingly less absolute change
with temperature variations. Note that spans smaller than
2.5V place even tighter requirements on the initial accuracy
and stability of the reference source.
In general, the magnitude of the reference voltage will re-
quire an initial adjustment. Errors due to an improper value
of reference voltage appear as full-scale errors in the A/D
transfer function. IC voltage regulators may be used for ref-
erences if the ambient temperature changes are not exces-
sive. The LM336B 2.5V IC reference diode (from National
Semiconductor) has a temperature stability of 1.8 mV typ
(6 mV max) over 0§CsTAsa70§C. Other temperature
range parts are also available.
2.5 Errors and Reference Voltage Adjustments
2.5.1 Zero Error
The zero of the A/D does not require adjustment. If the
minimum analog input voltage value, VIN(MIN), is not ground,
a zero offset can be done. The converter can be made to
output 0000 0000 digital code for this minimum input voltage
by biasing the A/D VIN(b) input at this VIN(MIN) value (see
Applications section). This utilizes the differential mode op-
eration of the A/D.
The zero error of the A/D converter relates to the location
of the first riser of the transfer function and can be mea-
sured by grounding the VIN (b) input and applying a small
magnitude positive voltage to the VIN (a) input. Zero error
is the difference between the actual DC input voltage that is
necessary to just cause an output digital code transition
from 0000 0000 to 0000 0001 and the ideal (/2 LSB value
((/2 LSB e 9.8 mV for VREF/2e2.500 VDC).
2.5.2 Full-Scale
The full-scale adjustment can be made by applying a differ-
ential input voltage that is 1(/2 LSB less than the desired
analog full-scale voltage range and then adjusting the mag-
nitude of the VREF/2 input (pin 9 or the VCC supply if pin 9 is
not used) for a digital output code that is just changing from
1111 1110 to 1111 1111.
17
Functional Description (Continued)
2.5.3 Adjusting for an Arbitrary Analog Input Voltage
Range
If the analog zero voltage of the A/D is shifted away from
ground (for example, to accommodate an analog input sig-
nal that does not go to ground) this new zero reference
should be properly adjusted first. A VIN(a) voltage that
equals this desired zero reference plus (/2 LSB (where the
LSB is calculated for the desired analog span, 1 LSBeana-
log span/256) is applied to pin 6 and the zero reference
voltage at pin 7 should then be adjusted to just obtain the
00HEX to 01HEX code transition.
The full-scale adjustment should then be made (with the
proper VIN(b) voltage applied) by forcing a voltage to the
VIN(a) input which is given by:
VIN (a) fs adj e VMAXb1.5 Ð (VMAX b VMIN)
256 ( ,where:
VMAXeThe high end of the analog input range
and
VMINethe low end (the offset zero) of the analog range.
(Both are ground referenced.)
The VREF/2 (or VCC) voltage is then adjusted to provide a
code change from FEHEX to FFHEX. This completes the ad-
justment procedure.
2.6 Clocking Option
The clock for the A/D can be derived from the CPU clock or
an external RC can be added to provide self-clocking. The
CLK IN (pin 4) makes use of a Schmitt trigger as shown in
Figure 6.
fCLKj1
1.1 RC
Rj10 kX
TL/H/5671–17
FIGURE 6. Self-Clocking the A/D
Heavy capacitive or DC loading of the clock R pin should be
avoided as this will disturb normal converter operation.
Loads less than 50 pF, such as driving up to 7 A/D convert-
er clock inputs from a single clock R pin of 1 converter, are
allowed. For larger clock line loading, a CMOS or low power
TTL buffer or PNP input logic should be used to minimize
the loading on the clock R pin (do not use a standard TTL
buffer).
2.7 Restart During a Conversion
If the A/D is restarted (CS and WR go low and return high)
during a conversion, the converter is reset and a new con-
version is started. The output data latch is not updated if the
conversion in process is not allowed to be completed, there-
fore the data of the previous conversion remains in this
latch. The INTR output simply remains at the ‘‘1’’ level.
2.8 Continuous Conversions
For operation in the free-running mode an initializing pulse
should be used, following power-up, to ensure circuit opera-
tion. In this application, the CS input is grounded and the
WR input is tied to the INTR output. This WR and INTR
node should be momentarily forced to logic low following a
power-up cycle to guarantee operation.
2.9 Driving the Data Bus
This MOS A/D, like MOS microprocessors and memories,
will require a bus driver when the total capacitance of the
data bus gets large. Other circuitry, which is tied to the data
bus, will add to the total capacitive loading, even in TRI-
STATE (high impedance mode). Backplane bussing also
greatly adds to the stray capacitance of the data bus.
There are some alternatives available to the designer to
handle this problem. Basically, the capacitive loading of the
data bus slows down the response time, even though DC
specifications are still met. For systems operating with a
relatively slow CPU clock frequency, more time is available
in which to establish proper logic levels on the bus and
therefore higher capacitive loads can be driven (see typical
characteristics curves).
At higher CPU clock frequencies time can be extended for
I/O reads (and/or writes) by inserting wait states (8080) or
using clock extending circuits (6800).
Finally, if time is short and capacitive loading is high, exter-
nal bus drivers must be used. These can be TRI-STATE
buffers (low power Schottky such as the DM74LS240 series
is recommended) or special higher drive current products
which are designed as bus drivers. High current bipolar bus
drivers with PNP inputs are recommended.
2.10 Power Supplies
Noise spikes on the VCC supply line can cause conversion
errors as the comparator will respond to this noise. A low
inductance tantalum filter capacitor should be used close to
the converter VCC pin and values of 1 mF or greater are
recommended. If an unregulated voltage is available in the
system, a separate LM340LAZ-5.0, TO-92, 5V voltage regu-
lator for the converter (and other analog circuitry) will greatly
reduce digital noise on the VCC supply.
2.11 Wiring and Hook-Up Precautions
Standard digital wire wrap sockets are not satisfactory for
breadboarding this A/D converter. Sockets on PC boards
can be used and all logic signal wires and leads should be
grouped and kept as far away as possible from the analog
signal leads. Exposed leads to the analog inputs can cause
undesired digital noise and hum pickup, therefore shielded
leads may be necessary in many applications.
18
Functional Description (Continued)
A single point analog ground that is separate from the logic
ground points should be used. The power supply bypass
capacitor and the self-clocking capacitor (if used) should
both be returned to digital ground. Any VREF/2 bypass ca-
pacitors, analog input filter capacitors, or input signal shield-
ing should be returned to the analog ground point. A test for
proper grounding is to measure the zero error of the A/D
converter. Zero errors in excess of (/4 LSB can usually be
traced to improper board layout and wiring (see section
2.5.1 for measuring the zero error).
3.0 TESTING THE A/D CONVERTER
There are many degrees of complexity associated with test-
ing an A/D converter. One of the simplest tests is to apply a
known analog input voltage to the converter and use LEDs
to display the resulting digital output code as shown in Fig-ure 7.
For ease of testing, the VREF/2 (pin 9) should be supplied
with 2.560 VDC and a VCC supply voltage of 5.12 VDCshould be used. This provides an LSB value of 20 mV.
If a full-scale adjustment is to be made, an analog input
voltage of 5.090 VDC (5.120–1(/2 LSB) should be applied to
the VIN(a) pin with the VIN(b) pin grounded. The value of
the VREF/2 input voltage should then be adjusted until the
digital output code is just changing from 1111 1110 to 1111
1111. This value of VREF/2 should then be used for all the
tests.
The digital output LED display can be decoded by dividing
the 8 bits into 2 hex characters, the 4 most significant (MS)
and the 4 least significant (LS). Table I shows the fractional
binary equivalent of these two 4-bit groups. By adding the
voltages obtained from the ‘‘VMS’’ and ‘‘VLS’’ columns in
Table I, the nominal value of the digital display (when
TL/H/5671–18
FIGURE 7. Basic A/D Tester
VREF/2 e 2.560V) can be determined. For example, for an
output LED display of 1011 0110 or B6 (in hex), the voltage
values from the table are 3.520 a 0.120 or 3.640 VDC.
These voltage values represent the center-values of a per-
fect A/D converter. The effects of quantization error have to
be accounted for in the interpretation of the test results.
For a higher speed test system, or to obtain plotted data, a
digital-to-analog converter is needed for the test set-up. An
accurate 10-bit DAC can serve as the precision voltage
source for the A/D. Errors of the A/D under test can be
expressed as either analog voltages or differences in 2 digi-
tal words.
A basic A/D tester that uses a DAC and provides the error
as an analog output voltage is shown in Figure 8. The 2 op
amps can be eliminated if a lab DVM with a numerical sub-
traction feature is available to read the difference voltage,
‘‘A–C’’, directly. The analog input voltage can be supplied
by a low frequency ramp generator and an X-Y plotter can
be used to provide analog error (Y axis) versus analog input
(X axis).
For operation with a microprocessor or a computer-based
test system, it is more convenient to present the errors digi-
tally. This can be done with the circuit ofFigure 9, where the
output code transitions can be detected as the 10-bit DAC is
incremented. This provides (/4 LSB steps for the 8-bit A/D
under test. If the results of this test are automatically plotted
with the analog input on the X axis and the error (in LSB’s)
as the Y axis, a useful transfer function of the A/D under
test results. For acceptance testing, the plot is not neces-
sary and the testing speed can be increased by establishing
internal limits on the allowed error for each code.
4.0 MICROPROCESSOR INTERFACING
To dicuss the interface with 8080A and 6800 microproces-
sors, a common sample subroutine structure is used. The
microprocessor starts the A/D, reads and stores the results
of 16 successive conversions, then returns to the user’s
program. The 16 data bytes are stored in 16 successive
memory locations. All Data and Addresses will be given in
hexadecimal form. Software and hardware details are pro-
vided separately for each type of microprocessor.
4.1 Interfacing 8080 Microprocessor Derivatives (8048,
8085)
This converter has been designed to directly interface with
derivatives of the 8080 microprocessor. The A/D can be
mapped into memory space (using standard memory ad-
dress decoding for CS and the MEMR and MEMW strobes)
or it can be controlled as an I/O device by using the I/O R
and I/O W strobes and decoding the address bits A0 xA7 (or address bits A8 x A15 as they will contain the
same 8-bit address information) to obtain the CS input. Us-
ing the I/O space provides 256 additional addresses and
may allow a simpler 8-bit address decoder but the data can
only be input to the accumulator. To make use of the addi-
tional memory reference instructions, the A/D should be
mapped into memory space. An example of an A/D in I/O
space is shown in Figure 10.
19
Functional Description (Continued)
FIGURE 8. A/D Tester with Analog Error Output
TL/H/5671–19
FIGURE 9. Basic ‘‘Digital’’ A/D Tester
TABLE I. DECODING THE DIGITAL OUTPUT LEDs
OUTPUT VOLTAGE
FRACTIONAL BINARY VALUE FORCENTER VALUES
HEX BINARY WITH
VREF/2e2.560 VDC
MS GROUP LS GROUP VMS GROUP* VLS GROUP*
F 1 1 1 1 15/16 15/256 4.800 0.300
E 1 1 1 0 7/8 7/128 4.480 0.280
D 1 1 0 1 13/16 13/256 4.160 0.260
C 1 1 0 0 3/4 3/64 3.840 0.240
B 1 0 1 1 11/16 11/256 3.520 0.220
A 1 0 1 0 5/8 5/128 3.200 0.200
9 1 0 0 1 9/16 9/256 2/880 0.180
8 1 0 0 0 1/2 1/32 2/560 0.160
7 0 1 1 1 7/16 7/256 2.240 0.140
6 0 1 1 0 3/8 3/128 1.920 0.120
5 0 1 0 1 5/16 2/256 1.600 0.100
4 0 1 0 0 1/4 1/64 1/280 0.080
3 0 0 1 1 3/16 3/256 0.960 0.060
2 0 0 1 0 1/8 1/128 0.640 0.040
1 0 0 0 1 1/16 1/256 0.320 0.020
0 0 0 0 0 0 0
*Display OutputeVMS Group a VLS Group
20
Functional Description (Continued)
TL/H/5671–20
Note 1: *Pin numbers for the DP8228 system controller, others are INS8080A.
Note 2: Pin 23 of the INS8228 must be tied to a12V through a 1 kX resistor to generate the RST 7
instruction when an interrupt is acknowledged as required by the accompanying sample program.
FIGURE 10. ADC0801–INS8080A CPU Interface
SAMPLE PROGRAM FORFIGURE 10 ADC0801–INS8080A CPU INTERFACE
0038 C3 00 03 RST 7: JMP LD DATA
# # ## # #
0100 21 00 02 START: LXI H 0200H ; HL pair will point to
; data storage locations
0103 31 00 04 RETURN: LXI SP 0400H ; Initialize stack pointer (Note 1)
0106 7D MOV A, L ; Test # of bytes entered
0107 FE OF CPI OF H ; If # 4 16. JMP to
0109 CA 13 01 JZ CONT ; user program
010C D3 E0 OUT E0 H ; Start A/D
010E FB EI ; Enable interrupt
010F 00 LOOP: NOP ; Loop until end of
0110 C3 OF 01 JMP LOOP ; conversion
0113 # CONT: ## # # ## # (User program to ## # process data) ## # # ## # # #
0300 DB E0 LD DATA: IN E0 H ; Load data into accumulator
0302 77 MOV M, A ; Store data
0303 23 INX H ; Increment storage pointer
0304 C3 03 01 JMP RETURN
Note 1: The stack pointer must be dimensioned because a RST 7 instruction pushes the PC onto the stack.
Note 2: All address used were arbitrarily chosen.
21
Functional Description (Continued)
The standard control bus signals of the 8080 CS, RD and
WR) can be directly wired to the digital control inputs of the
A/D and the bus timing requirements are met to allow both
starting the converter and outputting the data onto the data
bus. A bus driver should be used for larger microprocessor
systems where the data bus leaves the PC board and/or
must drive capacitive loads larger than 100 pF.
4.1.1 Sample 8080A CPU Interfacing Circuitry and
Program
The following sample program and associated hardware
shown in Figure 10 may be used to input data from the
converter to the INS8080A CPU chip set (comprised of the
INS8080A microprocessor, the INS8228 system controller
and the INS8224 clock generator). For simplicity, the A/D is
controlled as an I/O device, specifically an 8-bit bi-direction-
al port located at an arbitrarily chosen port address, E0. The
TRI-STATE output capability of the A/D eliminates the need
for a peripheral interface device, however address decoding
is still required to generate the appropriate CS for the con-
verter.
It is important to note that in systems where the A/D con-
verter is 1-of-8 or less I/O mapped devices, no address
decoding circuitry is necessary. Each of the 8 address bits
(A0 to A7) can be directly used as CS inputsÐone for each
I/O device.
4.1.2 INS8048 Interface
The INS8048 interface technique with the ADC0801 series
(see Figure 11) is simpler than the 8080A CPU interface.
There are 24 I/O lines and three test input lines in the 8048.
With these extra I/O lines available, one of the I/O lines (bit
0 of port 1) is used as the chip select signal to the A/D, thus
eliminating the use of an external address decoder. Bus
control signals RD, WR and INT of the 8048 are tied directly
to the A/D. The 16 converted data words are stored at on-
chip RAM locations from 20 to 2F (Hex). The RD and WR
signals are generated by reading from and writing into a
dummy address, respectively. A sample interface program
is shown below.
TL/H/5671–21
FIGURE 11. INS8048 Interface
SAMPLE PROGRAM FORFIGURE 11 INS8048 INTERFACE
04 10 JMP 10H : Program starts at addr 10
ORG 3H
04 50 JMP 50H ; Interrupt jump vector
ORG 10H ; Main program
99 FE ANL P1, #0FEH ; Chip select
81 MOVX A, @R1 ; Read in the 1st data
; to reset the intr
89 01 START: ORL P1, Ý1 ; Set port pin high
B8 20 MOV R0, #20H ; Data address
B9 FF MOV R1, #0FFH ; Dummy address
BA 10 MOV R2, #10H ; Counter for 16 bytes
23 FF AGAIN: MOV A, #0FFH ; Set ACC for intr loop
99 FE ANL P1, #0FEH ; Send CS (bit 0 of P1)
91 MOVX @R1, A ; Send WR out
05 EN I ; Enable interrupt
96 21 LOOP: JNZ LOOP ; Wait for interrupt
EA 1B DJNZ R2, AGAIN ; If 16 bytes are read
00 NOP ; go to user’s program
00 NOP
ORG 50H
81 INDATA: MOVX A, @R1 ; Input data, CS still low
A0 MOV @R0, A ; Store in memory
18 INC R0 ; Increment storage counter
89 01 ORL P1, #1 ; Reset CS signal
27 CLR A ; Clear ACC to get out of
93 RETR ; the interrupt loop
22
Functional Description (Continued)
4.2 Interfacing the Z-80
The Z-80 control bus is slightly different from that of the
8080. General RD and WR strobes are provided and sepa-
rate memory request, MREQ, and I/O request, IORQ, sig-
nals are used which have to be combined with the general-
ized strobes to provide the equivalent 8080 signals. An ad-
vantage of operating the A/D in I/O space with the Z-80 is
that the CPU will automatically insert one wait state (the RD
and WR strobes are extended one clock period) to allow
more time for the I/O devices to respond. Logic to map the
A/D in I/O space is shown in Figure 13.
TL/H/5671–23
FIGURE 13. Mapping the A/D as an I/O Device
for Use with the Z-80 CPU
Additional I/O advantages exist as software DMA routines
are available and use can be made of the output data trans-
fer which exists on the upper 8 address lines (A8 to A15)
during I/O input instructions. For example, MUX channel
selection for the A/D can be accomplished with this operat-
ing mode.
4.3 Interfacing 6800 Microprocessor Derivatives
(6502, etc.)
The control bus for the 6800 microprocessor derivatives
does not use the RD and WR strobe signals. Instead it em-
ploys a single R/W line and additional timing, if needed, can
be derived fom the w2 clock. All I/O devices are memory
mapped in the 6800 system, and a special signal, VMA,
indicates that the current address is valid. Figure 14 shows
an interface schematic where the A/D is memory mapped in
the 6800 system. For simplicity, the CS decoding is shown
using (/2 DM8092. Note that in many 6800 systems, an al-
ready decoded 4/5 line is brought out to the common bus at
pin 21. This can be tied directly to the CS pin of the A/D,
provided that no other devices are addressed at HX ADDR:
4XXX or 5XXX.
The following subroutine performs essentially the same
function as in the case of the 8080A interface and it can be
called from anywhere in the user’s program.
In Figure 15 the ADC0801 series is interfaced to the M6800
microprocessor through (the arbitrarily chosen) Port B of the
MC6820 or MC6821 Peripheral Interface Adapter, (PIA).
Here the CS pin of the A/D is grounded since the PIA is
already memory mapped in the M6800 system and no CS
decoding is necessary. Also notice that the A/D output data
lines are connected to the microprocessor bus under pro-
gram control through the PIA and therefore the A/D RD pin
can be grounded.
A sample interface program equivalent to the previous one
is shown below Figure 15. The PIA Data and Control Regis-
ters of Port B are located at HEX addresses 8006 and 8007,
respectively.
5.0 GENERAL APPLICATIONS
The following applications show some interesting uses for
the A/D. The fact that one particular microprocessor is used
is not meant to be restrictive. Each of these application cir-
cuits would have its counterpart using any microprocessor
that is desired.
5.1 Multiple ADC0801 Series to MC6800 CPU Interface
To transfer analog data from several channels to a single
microprocessor system, a multiple converter scheme pre-
sents several advantages over the conventional multiplexer
single-converter approach. With the ADC0801 series, the
differential inputs allow individual span adjustment for each
channel. Furthermore, all analog input channels are sensed
simultaneously, which essentially divides the microproces-
sor’s total system servicing time by the number of channels,
since all conversions occur simultaneously. This scheme is
shown in Figure 16.
TL/H/5671–24
Note 1: Numbers in parentheses refer to MC6800 CPU pin out.
FIGURE 14. ADC0801-MC6800 CPU Interface
Note 2: Number or letters in brackets refer to standard M6800 system common bus code.
23
Functional Description (Continued)
SAMPLE PROGRAM FORFIGURE 14 ADC0801-MC6800 CPU INTERFACE
0010 DF 36 DATAIN STX TEMP2 ; Save contents of X
0012 CE 00 2C LDX #$002C ; Upon IRQ low CPU
0015 FF FF F8 STX $FFF8 ; jumps to 002C
0018 B7 50 00 STAA $5000 ; Start ADC0801
001B 0E CLI
001C 3E CONVRT WAI ; Wait for interrupt
001D DE 34 LDX TEMP1
001F 8C 02 0F CPX #$020F ; Is final data stored?
0022 27 14 BEQ ENDP
0024 B7 50 00 STAA $5000 ; Restarts ADC0801
0027 08 INX
0028 DF 34 STX TEMP1
002A 20 F0 BRA CONVRT
002C DE 34 INTRPT LDX TEMP1
002E B6 50 00 LDAA $5000 ; Read data
0031 A7 00 STAA X ; Store it at X
0033 3B RTI
0034 02 00 TEMP1 FDB $0200 ; Starting address for
; data storage
0036 00 00 TEMP2 FDB $0000
0038 CE 02 00 ENDP LDX #$0200 ; Reinitialize TEMP1
003B DF 34 STX TEMP1
003D DE 36 LDX TEMP2
003F 39 RTS ; Return from subroutine
; To user’s program
Note 1: In order for the microprocessor to service subroutines and interrupts, the stack pointer must be dimensioned in the user’s program.
TL/H/5671–25
FIGURE 15. ADC0801–MC6820 PIA Interface
24
Functional Description (Continued)
SAMPLE PROGRAM FORFIGURE 15 ADC0801–MC6820 PIA INTERFACE
0010 CE 00 38 DATAIN LDX #$0038 ; Upon IRQ low CPU
0013 FF FF F8 STX $FFF8 ; jumps to 0038
0016 B6 80 06 LDAA PIAORB ; Clear possible IRQ flags
0019 4F CLRA
001A B7 80 07 STAA PIACRB
001D B7 80 06 STAA PIAORB ; Set Port B as input
0020 0E CLI
0021 C6 34 LDAB #$34
0023 86 3D LDAA #$3D
0025 F7 80 07 CONVRT STAB PIACRB ; Starts ADC0801
0028 B7 80 07 STAA PIACRB
002B 3E WAI ; Wait for interrupt
002C DE 40 LDX TEMP1
002E 8C 02 0F CPX #$020F ; Is final data stored?
0031 27 0F BEQ ENDP
0033 08 INX
0034 DF 40 STX TEMP1
0036 20 ED BRA CONVRT
0038 DE 40 INTRPT LDX TEMP1
003A B6 80 06 LDAA PIAORB ; Read data in
003D A7 00 STAA X ; Store it at X
003F 3B RTI
0040 02 00 TEMP1 FDB $0200 ; Starting address for
; data storage
0042 CE 02 00 ENDP LDX #$0200 ; Reinitialize TEMP1
0045 DF 40 STX TEMP1
0047 39 RTS ; Return from subroutine
PIAORB EQU $8006 ; To user’s program
PIACRB EQU $8007
The following schematic and sample subroutine (DATA IN)
may be used to interface (up to) 8 ADC0801’s directly to the
MC6800 CPU. This scheme can easily be extended to allow
the interface of more converters. In this configuration the
converters are (arbitrarily) located at HEX address 5000 in
the MC6800 memory space. To save components, the
clock signal is derived from just one RC pair on the first
converter. This output drives the other A/Ds.
All the converters are started simultaneously with a STORE
instruction at HEX address 5000. Note that any other HEX
address of the form 5XXX will be decoded by the circuit,
pulling all the CS inputs low. This can easily be avoided by
using a more definitive address decoding scheme. All the
interrupts are ORed together to insure that all A/Ds have
completed their conversion before the microprocessor is in-
terrupted.
The subroutine, DATA IN, may be called from anywhere in
the user’s program. Once called, this routine initializes the
CPU, starts all the converters simultaneously and waits for
the interrupt signal. Upon receiving the interrupt, it reads the
converters (from HEX addresses 5000 through 5007) and
stores the data successively at (arbitrarily chosen) HEX ad-
dresses 0200 to 0207, before returning to the user’s pro-
gram. All CPU registers then recover the original data they
had before servicing DATA IN.
5.2 Auto-Zeroed Differential Transducer Amplifier
and A/D Converter
The differential inputs of the ADC0801 series eliminate the
need to perform a differential to single ended conversion for
a differential transducer. Thus, one op amp can be eliminat-
ed since the differential to single ended conversion is pro-
vided by the differential input of the ADC0801 series. In gen-
eral, a transducer preamp is required to take advantage of
the full A/D converter input dynamic range.
25
Functional Description (Continued)
TL/H/5671–26
Note 1: Numbers in parentheses refer to MC6800 CPU pin out.
Note 2: Numbers of letters in brackets refer to standard M6800 system common bus code.
FIGURE 16. Interfacing Multiple A/Ds in an MC6800 System
SAMPLE PROGRAM FORFIGURE 16 INTERFACING MULTIPLE A/Ds IN AN MC6800 SYSTEM
ADDRESS HEX CODE MNEMONICS COMMENTS
0010 DF 44 DATAIN STX TEMP ; Save Contents of X
0012 CE 00 2A LDX #$002A ; Upon IRQ LOW CPU
0015 FF FF F8 STX $FFF8 ; Jumps to 002A
0018 B7 50 00 STAA $5000 ; Starts all A/D’s
001B 0E CLI
001C 3E WAI ; Wait for interrupt
001D CE 50 00 LDX #$5000
0020 DF 40 STX INDEX1 ; Reset both INDEX
0022 CE 02 00 LDX #$0200 ; 1 and 2 to starting
0025 DF 42 STX INDEX2 ; addresses
0027 DE 44 LDX TEMP
0029 39 RTS ; Return from subroutine
002A DE 40 INTRPT LDX INDEX1 ; INDEX1 x X
002C A6 00 LDAA X ; Read data in from A/D at X
002E 08 INX ; Increment X by one
002F DF 40 STX INDEX1 ; X x INDEX1
0031 DE 42 LDX INDEX2 ; INDEX2 x X
26
Functional Description (Continued)
SAMPLE PROGRAM FORFIGURE 16 INTERFACING MULTIPLE A/Ds IN AN MC6800 SYSTEM
ADDRESS HEX CODE MNEMONICS COMMENTS
0033 A7 00 STAA X ; Store data at X
0035 8C 02 07 CPX #$0207 ; Have all A/D’s been read?
0038 27 05 BEQ RETURN ; Yes: branch to RETURN
003A 08 INX ; No: increment X by one
003B DF 42 STX INDEX2 ; X x INDEX2
003D 20 EB BRA INTRPT ; Branch to 002A
003F 3B RETURN RTI
0040 50 00 INDEX1 FDB $5000 ; Starting address for A/D
0042 02 00 INDEX2 FDB $0200 ; Starting address for data storage
0044 00 00 TEMP FDB $0000
Note 1: In order for the microprocessor to service subroutines and interrupts, the stack pointer must be dimensioned in the user’s program.
For amplification of DC input signals, a major system error is
the input offset voltage of the amplifiers used for the
preamp. Figure 17 is a gain of 100 differential preamp
whose offset voltage errors will be cancelled by a zeroing
subroutine which is performed by the INS8080A microproc-
essor system. The total allowable input offset voltage error
for this preamp is only 50 mV for (/4 LSB error. This would
obviously require very precise amplifiers. The expression for
the differential output voltage of the preamp is:
VO e [VIN(a)bVIN(b)] Ð1 a
2R2
R1 ( a
X ä Y X ä YSIGNAL GAIN
(VOS2b VOS1
b VOS3g IXRX) #1 a
2R2
R1 JX ä Y X ä YDC ERROR TERM GAIN
where IX is the current through resistor RX. All of the offset
error terms can be cancelled by making gIXRXe VOS1 a
VOS3 b VOS2. This is the principle of this auto-zeroing
scheme.
The INS8080A uses the 3 I/O ports of an INS8255 Pro-
gramable Peripheral Interface (PPI) to control the auto zero-
ing and input data from the ADC0801 as shown inFigure 18.
The PPI is programmed for basic I/O operation (mode 0)
with Port A being an input port and Ports B and C being
output ports. Two bits of Port C are used to alternately open
or close the 2 switches at the input of the preamp. Switch
SW1 is closed to force the preamp’s differential input to be
zero during the zeroing subroutine and then opened and
SW2 is then closed for conversion of the actual differential
input signal. Using 2 switches in this manner eliminates con-
cern for the ON resistance of the switches as they must
conduct only the input bias current of the input amplifiers.
Output Port B is used as a successive approximation regis-
ter by the 8080 and the binary scaled resistors in series with
each output bit create a D/A converter. During the zeroing
subroutine, the voltage at Vx increases or decreases as re-
quired to make the differential output voltage equal to zero.
This is accomplished by ensuring that the voltage at the
output of A1 is approximately 2.5V so that a logic ‘‘1’’ (5V)
on any output of Port B will source current into node VX thus
raising the voltage at VX and making the output differential
more negative. Conversely, a logic ‘‘0’’ (0V) will pull current
out of node VX and decrease the voltage, causing the differ-
ential output to become more positive. For the resistor val-
ues shown, VX can move g12 mV with a resolution of 50
mV, which will null the offset error term to (/4 LSB of full-
scale for the ADC0801. It is important that the voltage levels
that drive the auto-zero resistors be constant. Also, for sym-
metry, a logic swing of 0V to 5V is convenient. To achieve
this, a CMOS buffer is used for the logic output signals of
Port B and this CMOS package is powered with a stable 5V
source. Buffer amplifier A1 is necessary so that it can
source or sink the D/A output current.
27
Functional Description (Continued)
Note 1: R2 e 49.5 R1
Note 2: Switches are LMC13334 CMOS analog switches.
Note 3: The 9 resistors used in the auto-zero section can be g5% tolerance.
FIGURE 17. Gain of 100 Differential Transducer Preamp
TL/H/5671–27
FIGURE 18. Microprocessor Interface Circuitry for Differential Preamp
28
A flow chart for the zeroing subroutine is shown in Figure19. It must be noted that the ADC0801 series will output an
all zero code when it converts a negative input [VIN(b) t
VIN(a)]. Also, a logic inversion exists as all of the I/O ports
are buffered with inverting gates.
Basically, if the data read is zero, the differential output volt-
age is negative, so a bit in Port B is cleared to pull VX more
negative which will make the output more positive for the
next conversion. If the data read is not zero, the output volt-
age is positive so a bit in Port B is set to make VX more
positive and the output more negative. This continues for 8
approximations and the differential output eventually con-
verges to within 5 mV of zero.
The actual program is given in Figure 20. All addresses
used are compatible with the BLC 80/10 microcomputer
system. In particular:
Port A and the ADC0801 are at port address E4
Port B is at port address E5
Port C is at port address E6
PPI control word port is at port address E7
Program Counter automatically goes to ADDR:3C3D upon
acknowledgement of an interrupt from the ADC0801
5.3 Multiple A/D Converters in a Z-80 Interrupt
Driven Mode
In data acquisition systems where more than one A/D con-
verter (or other peripheral device) will be interrupting pro-
gram execution of a microprocessor, there is obviously a
need for the CPU to determine which device requires servic-
ing. Figure 21 and the accompanying software is a method
of determining which of 7 ADC0801 converters has com-
pleted a conversion (INTR asserted) and is requesting an
interrupt. This circuit allows starting the A/D converters in
any sequence, but will input and store valid data from the
converters with a priority sequence of A/D 1 being read first,
A/D 2 second, etc., through A/D 7 which would have the
lowest priority for data being read. Only the converters
whose INT is asserted will be read.
The key to decoding circuitry is the DM74LS373, 8-bit D
type flip-flop. When the Z-80 acknowledges the interrupt,
the program is vectored to a data input Z-80 subroutine.
This subroutine will read a peripheral status word from the
DM74LS373 which contains the logic state of the INTR out-
puts of all the converters. Each converter which initiates an
interrupt will place a logic ‘‘0’’ in a unique bit position in the
status word and the subroutine will determine the identity of
the converter and execute a data read. An identifier word
(which indicates which A/D the data came from) is stored in
the next sequential memory location above the location of
the data so the program can keep track of the identity of the
data entered.
TL/H/5671–28
FIGURE 19. Flow Chart for Auto-Zero Routine
29
3D00 3E90 MVI 90
3D02 D3E7 Out Control Port ; Program PPI
3D04 2601 MVI H 01 Auto-Zero Subroutine
3D06 7C MOV A,H
3D07 D3E6 OUT C ; Close SW1 open SW2
3D09 0680 MVI B 80 ; Initialize SAR bit pointer
3D0B 3E7F MVI A 7F ; Initialize SAR code
3D0D 4F MOV C,A Return
3D0E D3E5 OUT B ; Port B 4 SAR code
3D10 31AA3D LXI SP 3DAA Start ; Dimension stack pointer
3D13 D3E4 OUT A ; Start A/D
3D15 FB IE
3D16 00 NOP Loop ; Loop until INT asserted
3D17 C3163D JMP Loop
3D1A 7A MOV A,D Auto-Zero
3D1B C600 ADI 00
3D1D CA2D3D JZ Set C ; Test A/D output data for zero
3D20 78 MOV A,B Shift B
3D21 F600 ORI 00 ; Clear carry
3D23 1F RAR ; Shift ‘1‘ in B right one place
3D24 FE00 CPI 00 ; Is B zero? If yes last
3D26 CA373D JZ Done ; approximation has been made
3D29 47 MOV B,A
3D2A C3333D JMP New C
3D2D 79 MOV A,C Set C
3D2E B0 ORA B ; Set bit in C that is in same
3D2F 4F MOV C,A ; position as ‘1‘ in B
3D30 C3203D JMP Shift B
3D33 A9 XRA C New C ; Clear bit in C that is in
3D34 C30D3D JMP Return ; same position as ‘1‘ in B
3D37 47 MOV B,A Done ; then output new SAR code.
3D38 7C MOV A,H ; Open SW1, close SW2 then
3D39 EE03 XRI 03 ; proceed with program. Preamp
3D3B D3E6 OUT C ; is now zeroed.
3D3D # Normal
##Program for processing
proper data values
3C3D DBE4 IN A Read A/D Subroutine ; Read A/D data
3C3F EEFF XRI FF ; Invert data
3C41 57 MOV D,A
3C42 78 MOV A,B ; Is B Reg 4 0? If not stay
3C43 E6FF ANI FF ; in auto zero subroutine
3C45 C21A3D JNZ Auto-Zero
3C48 C33D3D JMP NormalNote: All numerical values are hexadecimal representations.
FIGURE 20. Software for Auto-Zeroed Differential A/D
5.3 Multiple A/D Converters in a Z-80É Interrupt Driven
Mode (Continued)
The following notes apply:
1) It is assumed that the CPU automatically performs a RST
7 instruction when a valid interrupt is acknowledged (CPU
is in interrupt mode 1). Hence, the subroutine starting ad-
dress of X0038.
2) The address bus from the Z-80 and the data bus to the Z-
80 are assumed to be inverted by bus drivers.
3) A/D data and identifying words will be stored in sequen-
tial memory locations starting at the arbitrarily chosen ad-
dress X 3E00.
4) The stack pointer must be dimensioned in the main pro-
gram as the RST 7 instruction automatically pushes the
PC onto the stack and the subroutine uses an additional
6 stack addresses.
5) The peripherals of concern are mapped into I/O space
with the following port assignments:
HEX PORT ADDRESS PERIPHERAL
00 MM74C374 8-bit flip-flop
01 A/D 1
02 A/D 2
03 A/D 3
04 A/D 4
05 A/D 5
06 A/D 6
07 A/D 7
This port address also serves as the A/D identifying word in
the program.
30
TL/H/5671–29
FIGURE 21. Multiple A/Ds with Z-80 Type Microprocessor
INTERRUPT SERVICING SUBROUTINESOURCE
LOC OBJ CODE STATEMENT COMMENT0038 E5 PUSH HL ; Save contents of all registers affected by
0039 C5 PUSH BC ; this subroutine.
003A F5 PUSH AF ; Assumed INT mode 1 earlier set.
003B 21 00 3E LD (HL),X3E00 ; Initialize memory pointer where data will be stored.
003E 0E 01 LD C, X01 ; C register will be port ADDR of A/D converters.
0040 D300 OUT X00, A ; Load peripheral status word into 8-bit latch.
0042 DB00 IN A, X00 ; Load status word into accumulator.
0044 47 LD B,A ; Save the status word.
0045 79 TEST LD A,C ; Test to see if the status of all A/D’s have
0046 FE 08 CP, X08 ; been checked. If so, exit subroutine
0048 CA 60 00 JPZ, DONE
004B 78 LD A,B ; Test a single bit in status word by looking for
004C 1F RRA ; a ‘1‘ to be rotated into the CARRY (an INT
004D 47 LD B,A ; is loaded as a ‘1‘). If CARRY is set then load
004E DA 5500 JPC, LOAD ; contents of A/D at port ADDR in C register.
0051 0C NEXT INC C ; If CARRY is not set, increment C register to point
0052 C3 4500 JP,TEST ; to next A/D, then test next bit in status word.
0055 ED 78 LOAD IN A, (C) ; Read data from interrupting A/D and invert
0057 EE FF XOR FF ; the data.
0059 77 LD (HL),A ; Store the data
005A 2C INC L
005B 71 LD (HL),C ; Store A/D identifier (A/D port ADDR).
005C 2C INC L
005D C3 51 00 JP,NEXT ; Test next bit in status word.
0060 F1 DONE POP AF ; Re-establish all registers as they were
0061 C1 POP BC ; before the interrupt.
0062 E1 POP HL
0063 C9 RET ; Return to original program
31
Ordering Information
TEMP RANGE 0§C TO 70§C 0§C TO 70§C 0§C TO 70§C b40§C TO a85§C
g(/4 Bit ADC0801LCN
Adjusted
ERRORg(/2 Bit ADC0802LCWM ADC0802LCV ADC0802LCN
Unadjusted
g(/2 Bit ADC0803LCWM ADC0803LCV ADC0803LCN
Adjusted
g1Bit ADC0804LCWM ADC0804LCV ADC0804LCN ADC0805LCN
Unadjusted
PACKAGE OUTLINE M20BÐSmall Outline V20AÐChip Carrier N20AÐMolded DIP
TEMP RANGE b40§C TO a85§C b55§C TO a125§C
g(/4 Bit Adjusted ADC0801LCJ ADC0801LJ
ERRORg(/2 Bit Unadjusted ADC0802LCJ ADC0802LJ,
g(/2 Bit Adjusted ADC0803LCJ ADC0802LJ/883
g1Bit Unadjusted ADC0804LCJ
PACKAGE OUTLINE J20AÐCavity DIP J20AÐCavity DIP
Connection Diagrams
ADC080X
Dual-In-Line and Small Outline (SO) Packages
TL/H/5671–30
ADC080X
Molded Chip Carrier (PCC) Package
TL/H/5671–32
See Ordering Information
32
33
Physical Dimensions inches (millimeters)
Dual-In-Line Package (J)
Order Number ADC0801LJ, ADC0802LJ, ADC0801LCJ,
ADC0802LCJ, ADC0803LCJ or ADC0804LCJ
ADC0802LJ/883 or 5962-9096601MRA
NS Package Number J20A
SO Package (M)
Order Number ADC0802LCWM, ADC0803LCWM or ADC0804LCWM
NS Package Number M20B
34
Physical Dimensions inches (millimeters) (Continued)
Molded Dual-In-Line Package (N)
Order Number ADC0801LCN, ADC0802LCN,
ADC0803LCN, ADC0804LCN or ADC0805LCN
NS Package Number N20A
35
AD
C0801/A
DC
0802/A
DC
0803/A
DC
0804/A
DC
0805
8-B
itm
PC
om
patible
A/D
Convert
ers
Physical Dimensions inches (millimeters) (Continued)
Molded Chip Carrier Package (V)
Order Number ADC0802LCV, ADC0803LCV or ADC0804LCV
NS Package Number V20A
LIFE SUPPORT POLICY
NATIONAL’S PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE SUPPORT
DEVICES OR SYSTEMS WITHOUT THE EXPRESS WRITTEN APPROVAL OF THE PRESIDENT OF NATIONAL
SEMICONDUCTOR CORPORATION. As used herein:
1. Life support devices or systems are devices or 2. A critical component is any component of a life
systems which, (a) are intended for surgical implant support device or system whose failure to perform can
into the body, or (b) support or sustain life, and whose be reasonably expected to cause the failure of the life
failure to perform, when properly used in accordance support device or system, or to affect its safety or
with instructions for use provided in the labeling, can effectiveness.
be reasonably expected to result in a significant injury
to the user.
National Semiconductor National Semiconductor National Semiconductor National SemiconductorCorporation Europe Hong Kong Ltd. Japan Ltd.1111 West Bardin Road Fax: (a49) 0-180-530 85 86 13th Floor, Straight Block, Tel: 81-043-299-2309Arlington, TX 76017 Email: cnjwge@ tevm2.nsc.com Ocean Centre, 5 Canton Rd. Fax: 81-043-299-2408Tel: 1(800) 272-9959 Deutsch Tel: (a49) 0-180-530 85 85 Tsimshatsui, KowloonFax: 1(800) 737-7018 English Tel: (a49) 0-180-532 78 32 Hong Kong
Fran3ais Tel: (a49) 0-180-532 93 58 Tel: (852) 2737-1600Italiano Tel: (a49) 0-180-534 16 80 Fax: (852) 2736-9960
National does not assume any responsibility for use of any circuitry described, no circuit patent licenses are implied and National reserves the right at any time without notice to change said circuitry and specifications.
This datasheet has been download from:
www.datasheetcatalog.com
Datasheets for electronics components.