• AVR Freaks

Hot!PIC16LF1708: configuration help with using DAC and opAmp

Author
Sophi
Starting Member
  • Total Posts : 16
  • Reward points : 0
  • Joined: 2020/02/22 19:49:07
  • Location: 0
  • Status: offline
2020/03/15 18:25:21 (permalink)
0

PIC16LF1708: configuration help with using DAC and opAmp

Hi-
I am using the PIC16LF1708 with MPLAB v4.15. I'm also new to MPLAB/ PIC.
VDD is 3.3V.
I'm using the DAC as the input to an opamp configured as a voltage to current converter.
 
Is there somewhere that discusses configuring the peripherals in MPLAB?
 
DAC configuration question:
I'd like to cycle through multiple inputs (10-15) to the DAC. (configuration screenshot attached)
-How do I configure it?
-If I use the FVR, how does this work?
 
OPAMP configuration question:
The datasheet says that low power mode is not supported (screenshot attached).
-Does this mean that the opamp module won't work on an "LF" part?
 
Thanks in advance, ~Sophi
 
 
 

Attached Image(s)

#1

8 Replies Related Threads

    Sophi
    Starting Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2020/02/22 19:49:07
    • Location: 0
    • Status: offline
    Re: PIC16LF1708: configuration help with using DAC and opAmp 2020/03/22 16:45:45 (permalink)
    0
    update:
    I've configured the chip so that the DAC feeds into the op-amp.
     
    From the datasheet: The DAC has 256 voltage level ranges. The 256 levels are set with the DAC1R<7:0> bits of the DAC1CON1 register.
    -I'd like the input to the DAC to come from firmware so that I can set multiple outputs. Is there any example code for reaching the DAC? 
     
    Still wondering if the op-amp will work in low voltage mode.
     
    And finally, is this forum very active? Is there another place where people gather on Microchip topics?
    Thanks!
     
    #2
    ric
    Super Member
    • Total Posts : 27655
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: PIC16LF1708: configuration help with using DAC and opAmp 2020/03/22 17:38:17 (permalink)
    +2 (2)
    Sophi
    -I'd like the input to the DAC to come from firmware so that I can set multiple outputs.

    What do you mean by "come from firmware" ?
    You just calculate the 8 bit value required, and write it to the DAC1CON1 register.
     
    Did you mean "multiple output levels" ?
     

    And finally, is this forum very active? Is there another place where people gather on Microchip topics?

    This board is the  most active for PIC discussion.
    This sub forum ("Analog (ADC, Comp, DAC, HC I/O, OPA, PRG, SlopeComp, ZCD)") doesn't seem very busy, which just reflects how many questions have been asked.

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #3
    Sophi
    Starting Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2020/02/22 19:49:07
    • Location: 0
    • Status: offline
    Re: PIC16LF1708: configuration help with using DAC and opAmp 2020/03/25 16:08:49 (permalink)
    0
    Thanks for the reply!
    By "come from firmware" I meant by updating the DAC1CON1 register.
    Are there code examples for this? 
     
    #4
    ric
    Super Member
    • Total Posts : 27655
    • Reward points : 0
    • Joined: 2003/11/07 12:41:26
    • Location: Australia, Melbourne
    • Status: online
    Re: PIC16LF1708: configuration help with using DAC and opAmp 2020/03/25 16:29:45 (permalink)
    +1 (1)
    Sophi
    Are there code examples for this? 

    What is "this"?
    Do you mean just...
    variable = (result of some calculation);
    DAC1CON1 = variable;

     
     
     
     

    I also post at: PicForum
    Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
    NEW USERS: Posting images, links and code - workaround for restrictions.
    To get a useful answer, always state which PIC you are using!
    #5
    Sophi
    Starting Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2020/02/22 19:49:07
    • Location: 0
    • Status: offline
    Re: PIC16LF1708: configuration help with using DAC and opAmp 2020/03/25 16:38:51 (permalink)
    0
    Yes, I think that will do. // facepalm
    Thank you! Smile: Smile
    #6
    Sophi
    Starting Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2020/02/22 19:49:07
    • Location: 0
    • Status: offline
    Re: PIC16LF1708: configuration help with using DAC and opAmp 2020/03/29 16:32:35 (permalink)
    0
    Hi,
    Chip: PIC16LF1708
    IDE: MPLab 5.30
    Compiler: XC8
     
    The DAC puts out a nice sawtooth wave.
    I'd like to feed it into the internal op amp module. I've configured this first as Unity gain for testing, but no signal comes out. Are there any examples of how to configure this? 
     
    For the DAC config, it makes no difference if I check enable output on DACOUT1, DACOUT2, or neither.
     
    For the OPAMP module:
    I have enable OPAMP checked
    Power mode: High_GBWP_mode
    Channel select: DAC
    Unity Gain configuration
     
    On the input to the OPAMP/ output of the DAC there is a controllable signal.
    On the output pin of the OPAMP, there is no signal at all.
     
    Thanks in advance for help
    #7
    Sophi
    Starting Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2020/02/22 19:49:07
    • Location: 0
    • Status: offline
    Re: PIC16LF1708: configuration help with using DAC and opAmp 2020/03/31 08:46:17 (permalink)
    +1 (1)
    Solved, did not initialize in main. Ooops. :)
    #8
    Sophi
    Starting Member
    • Total Posts : 16
    • Reward points : 0
    • Joined: 2020/02/22 19:49:07
    • Location: 0
    • Status: offline
    Re: PIC16LF1708: configuration help with using DAC and opAmp 2020/05/23 08:57:25 (permalink)
    +1 (1)
    test
    #9
    Jump to:
    © 2020 APG vNext Commercial Version 4.5