Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC with built in DAC

Status
Not open for further replies.

SocMatt

New Member
Hi,

I am using a PIC16C782 which has a built in Digital to Analog converter. However i have not been able to find any commands which refer to setting up or reading the DAC.
If anyone could help it would be most appreciated.

Cheers

Matt
 

Nigel Goodwin

Super Moderator
Most Helpful Member
SocMatt said:
Hi,

I am using a PIC16C782 which has a built in Digital to Analog converter. However i have not been able to find any commands which refer to setting up or reading the DAC.
If anyone could help it would be most appreciated.

Cheers

Matt

I've never seen or used one, but pages 81-83 of the datasheets explain how to use it, including sample code for setting it up and outputing a value.

It looks pretty straight forward, I've copied the actual code below.

Code:
BANKSEL TRISB ; Select bank 1
BSF TRISB,1 ; Set RB1 input
BSF ANSEL,1 ; Set RB1 as analog
BANKSEL DACON0 ; Select Bank 2
CLRF DAC ; DAC to 00
MOVLW B’11000000’ ; Enable DAC output
MOVWF DACON0 ; Set REF = VDD

MOVLW DAC_VALUE
MOVWF DAC ; Set DAC output
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Top