Create A D/A Output Using Two Pins On A PIC Micro

June 18, 2001
With the addition of only a resistor and a capacitor, the low-cost eight-pin PIC12C671 can be used to provide an 8-bit digital-to-analog output (Fig. 1). Of course, this topology will work with...

With the addition of only a resistor and a capacitor, the low-cost eight-pin PIC12C671 can be used to provide an 8-bit digital-to-analog output (Fig. 1). Of course, this topology will work with almost any microprocessor that has an internal analog-to-digital (A/D) peripheral.

Following a simple concept, one of the microcontroller's A/D inputs monitors the voltage across an external capacitor (C1). Next, one of the digital I/O port pins pulls the voltage up or down (through R1) until it reaches the required value. When the digital I/O isn't being used to set the voltage on C1, it serves as a high-impedance input.

The flow diagram regulates the voltage across C1 at a rate of about 1 LSB per microsecond (Fig. 2). Therefore, C1 can be shifted (up or down) quickly enough to settle even a near-rail-to-rail output adjustment in about 20 ms. More clever algorithms, which match the pulse-adjustment time with the error, will obviously allow much faster convergence.

To view a sample code listing for the PIC12-C671, go to www.PlanetEE.com and click on "Ideas for Design."

Sponsored Recommendations

Near- and Far-Field Measurements

April 16, 2024
In this comprehensive application note, we delve into the methods of measuring the transmission (or reception) pattern, a key determinant of antenna gain, using a vector network...

DigiKey Factory Tomorrow Season 3: Sustainable Manufacturing

April 16, 2024
Industry 4.0 is helping manufacturers develop and integrate technologies such as AI, edge computing and connectivity for the factories of tomorrow. Learn more at DigiKey today...

Connectivity – The Backbone of Sustainable Automation

April 16, 2024
Advanced interfaces for signals, data, and electrical power are essential. They help save resources and costs when networking production equipment.

Empowered by Cutting-Edge Automation Technology: The Sustainable Journey

April 16, 2024
Advanced automation is key to efficient production and is a powerful tool for optimizing infrastructure and processes in terms of sustainability.

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!