Sei sulla pagina 1di 6

INTERFACING WITH ADC AND DAC

DAC(digital to analog converter) 0808 with Interfacing with PIC 18


The digital-to-analog converter (DAC) is a device widely used to convert digital pulses to
analog signals.

• The DAC0808 is an 8-bit monolithic digital-to-analog converter (DAC).

• featuring a full scale output current settling time of 150 ns while dissipating only 33
mW with ±5V supplies.

• No reference current (IREF) trimming is required for most applications since the full
scale output current is typically ±1 LSB of 255 IREF/256.

• Relative accuracies of better than ±0.19% assure 8-bit monotonicity and linearity while
zero level output current of less than 4 µA provides 8-bit zero accuracy for IREF≥2 mA.

• The power supply currents of the DAC0808 is independent of bit codes, and exhibits
essentially constant device characteristics over the entire supply voltage range.

Features
 Relative accuracy: ±0.19% error maximum

 Full scale current match: ±1 LSB typ

 Fast settling time: 150 ns typ

 Noninverting digital inputs are TTL and CMOS compatible

 High speed multiplying input slew rate: 8 mA/µs

 Power supply voltage range: ±4.5V to ±18V

 Low power consumption: 33 mW @ ±5V


Pin diagram of DAC 0808
Block diagram of DAC 0808

Interfacing of DAC to PIC 18

• In the DAC0808, the digital inputs are converted to current (Iout), and by connecting a
resistor to the Iout pin, we convert the result to voltage.
• The total current provided by the Iout pin is a function of the binary numbers at the DO
– D7 inputs of the DAC0808 and the reference current (Iref), and is as follows:

PIC18F458 ADC with Features.


• ADC is analog to digital converter.

• It converts voltage into corresponding digital value.

• ADC used in data acquisition system.

• PIC 18 microcontroller has On-chp ADC.

Features of ADC
 The PIC18f458 has a 10-bit 8 channel A/D converter.

 The number of analog inputs varies among difference PIC18 devices.  The
A/D converter has the following registers:
•A/D Result High Register (ADRESH)
•A/D Result Low Register (ADRESL)
•A/D Control Register 0 (ADCON0)
•A/D Control Register 1 (ADCON1)

 ADRESH and ADRESL registers hold the result of the A/D conversion and
gives 16 bit output.

 ADCON0 is Control Register used for setting conversion time as well as used
to select the input channels.

 ADCON1 is Control Register used for setting Vref voltage.


Block diagram of ADC

ADCON0 register.

• ADCON0 is 8 bit register.


• It is used for setting conversion time as well as used to select the input channels.

7 6 5 4 3 2 1 0
ADCS1 ADCS0 CHS2 CHS1 CHS0 GO/DONE# -- ADON

(note- # means bar)


Bit 7-6 ADCS1:ADCS0: A/D conversion clock select bits (used along with ADCS2
of the ADCON1 register .
ADCON1 ADCON0 Clock conversion
<ADCS2> <ADCS1:ADCS0>
0 00 FOSC/2

0 01 FOSC/8

0 10 FOSC/32

0 11 FRC (clock derived from internal A/D RC


oscillator)
1 00 FOSC/4

1 01 FOSC/16

1 10 FOSC/64

1 11 FRC (clock derived from internal A/D RC


oscillator)

Bit 5-3CHS2:CHS0: Analog channel select bits


000 = channel 0, (AN0)
001 = channel 1, (AN1)
010 = channel 2 (AN2)
010 = channel 2, (AN2)
011 = channel 3, (AN3)
100 = channel 4, (AN4)
101 = channel 5, (AN5)
110 = channel 6, (AN6)
111 = channel 7, (AN7)

Bit 2 GO/DONE#: A/D conversion status bit when


ADON = 1
0 = A/D conversion not in progress
1 = A/D conversion in progress (setting this bit starts the A/D conversion. This bit will
be cleared by hardware when A/D conversion is done)

Bit 1: Unimplemented

Bit 0 ADON: A/D on bit ADON: A/D on bit


0 = A/D converter module is shut-off 1
= A/D converter module is powered up.

Potrebbero piacerti anche