Become a subscriber (Free)

Join 29,000 other subscribers to receive subscriber sale discounts and other free resources.
Don't worry -- your e-mail address is totally secure. I promise to use it only to send you MicroZine.

PIC register DAC controls


PIC register DAC controls

To find out if you can use the PIC's internal voltage reference DAC just check the data sheet for your device and look for the CVRCON control register.  There should be a control bit labeled CVROE which is the bit that controls whether the  voltage is sent to the output pin (usually on RA2).

Here's part of the 16F88 datasheet:

CVRCON voltage reference output control - 16F88

Here bit 6 controls output of the voltage reference to a pin (For the 16F88 this is the "RA2/AN2/CVREF/VREF-" pin i.e. pin 1).

Note If you can only find a control register labeled VRCON then youcan't output the DAC voltage.

Voltage Reference block diagram

The block diagram of the generator is the internal hardware representation of the system - you can identify each control bit with each functional block so it's not difficult to understand.

16F88 voltage reference block diagram

Voltage reference block diagram 16F88

There is a 16 stage resistor network with each arm selected using an analogue mux (CVR[3..0]- this sends an analogue voltage to the comparator reference input (see the "Comparator Module" in the datasheet for using the reference voltage in the comparator).

To turn on the voltage reference CVREN enables the Fet at the top of the resistor chain.  CVRR changes the total current through the resistor chain so the range of output voltage is controllable (to some extent).

To send the analogue voltage outside the chip CVROE enables an analogue switch sending the voltage to the 'RA2/AN2/CVREF/VREF' pin.

Configuring the PIC pin for voltage output


Continue >>>>

New! Comments

Have your say about what you just read! Leave me a comment in the box below.

Privacy Policy | Contact | About Me

Site Map | Terms of Use

Visit our Facebook Page:

   Click Here

Recent Articles

  1. How to use the BMP280 Barometric Pressure chip with the Arduino

    How to use the BMP280 for weather pressure measurement or altitude change detection.

    Read more

  2. How to use the SSD1306 OLED LCD.

    Easily use the SSD1306 in any of your projects.

    Read more

  3. Logic Level Converters made easy

    How to easily make a logic level converter e.g. between 3V and 5V.

    Read more

Sign up for MicroZine
''The'' Microcontroller Newsletter

Enter your first Name and primary email address in the form below:

And receive absolutely FREE a full project for:

"Measuring Analogue Voltages
Without An ADC"

(Using only one pin).

Instant Download:
You Can
Get It Right Now

Warning: This project could be  Removed 
at any time.  

It will  NOT be 
available indefinitely SO
To avoid 
disappointment  get it:


Don't worry -- your e-mail address is totally secure. I promise to use it only to send you MicroZine
Remember this is a project with full description and fully debugged C Source code - and it's not available from the main website.

You can only get it through this newsletter.

To get exclusive access Enter your first name Name and primary email address Now in the form above.:

But wait !

There's more...

You'll receive more
free and exclusive reports as well as site information and site product updates

Scroll up to the form above and sign up NOW. Don't forget it's FREE and if you don't like it, you can unsubscribe at any time.

Click Here Now to use the form above to get your Valuable information absolutely free.

Readers Comments

"I wanted to thank
you so so so much
for all the information
you have provided in
your site it's


- Ranish Pottath

"This site really is
the best and my favorite.
I find here many useful
projects and tips."

- Milan


"Awesome site,
very, very easy and nice
to navigate!"

- Matt

Learn Microcontrollers

"Interested in

Sign up for The
Free 7 day guide:


"I am a newbie to PIC
and I wanted to say
 how great your
site has been for me."

- Dave


"Your site is a great
and perfect work.

- Suresh


"I couldn't find the correct
words to define
yourweb site.

Very useful, uncovered,
honest and clear.

Thanks so much for
your time and works.

- Anon

Back to Top