PIC18F4520: Serial Digital-to-Analog Conversion

From Mech
Revision as of 09:42, 2 July 2007 by LIMS (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigationJump to search

Since PIC microcontrollers do not offer analog outputs, a Digital-to-Analog converter (DAC) must be used to obtain an analog signal. An eight bit digital number can be converted to analog by using eight of the output pins from the PIC MCU to a separate DAC chip, however if more than one conversion is neccessary, this will quickly use up many of the available output pins from the PIC microcontroller, and require extensive wiring. Luckily, there is an easier and more effective way of doing this using communication. utilizes two lines to communicate, usually called SCL and SDA (a clock line and a data line). Communication begins with a start condition (the clock line being held high while the data line is dropped low) and ends with a stop condition (clock line held high while the data line is brought from low to high).