Weirdness with 16F1705's eeprom and DAC


Results 1 to 14 of 14

Threaded View

  1. #10
    Join Date
    May 2013
    Location
    australia
    Posts
    2,644


    Did you find this post helpful? Yes | No

    Default Re: Weirdness with 16F1705's eeprom and DAC

    new code without all the noisy comment

    with both outputs driven , from fvr buff2 @2.048v [1.024v got weird results]
    the unmentioned feature in data sheet is that out2 is complement of out1 and the gain seems a bit different
    ps blue trace is dacout1
    Code:
    #CONFIG ; 16F1705
        __config _CONFIG1, _FOSC_INTOSC & _WDTE_ON & _PWRTE_ON & _MCLRE_ON & _CP_OFF & _BOREN_ON & _CLKOUTEN_OFF
        __config _CONFIG2, _WRT_OFF & _PPS1WAY_OFF & _ZCDDIS_OFF & _PLLEN_OFF & _STVREN_ON & _BORV_LO & _LPBOR_OFF & _LVP_OFF       
    #ENDCONFIG
    
    
    a   var byte                    ' Loop counter. 
    b var byte[8]
    
    
    
    
    
    
        DEFINE  OSC 4               ' Adjust to suit design.
        OSCCON  = $68         ' Internal 4MHz osc.
    
    
    
    
        ANSELA = 0
        ANSELC = 0       
    
    
        FVRCON = %10001000         ' Enabled, Vref 2.048V.
    
    
    
        DAC1CON0 = %10111000        ' Vref from FVRb2, DAC1out2 (RA2).  DAC1out1 (RA0).  
    
    
        TRISA = 0
      
    
    
        
       b[0]=128
       b[1]=192
       b[2]=255
       b[3]=192
       b[4]=128
       b[5]=40
       b[6]=0
       b[7]=40
    
    
    First:  
        a=7
        while a
        DAC1CON1 = b[a]
        pause 5            ' Let the DMM settle.
        a=a-1
        wend
        goto first              
    
    
        end
    Attached Images Attached Images  
    Last edited by richard; - 4th August 2020 at 06:16.
    Warning I'm not a teacher

Similar Threads

  1. Select Case Weirdness
    By rocket_troy in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 19th June 2014, 00:33
  2. Ti Dac 7553
    By GeoJoe in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 28th August 2008, 20:29
  3. Looking for a DAC
    By RussMartin in forum Off Topic
    Replies: 4
    Last Post: - 25th November 2007, 06:21
  4. Using DAC's with pics
    By J_norrie in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 27th March 2007, 14:00
  5. dac
    By kaisersystems in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 10th June 2005, 20:23

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts