Active low input?


Closed Thread
Results 1 to 15 of 15
  1. #1
    CosMecc's Avatar
    CosMecc Guest

    Unhappy Active low input?

    Hi I'm trying to work about the AD7731 24 bit sigma-deltaAD converter, but I 've some problems:
    What mean "Active low input"?
    Does any one has a scheme about this ADC?

    Thanks
    Last edited by CosMecc; - 10th November 2006 at 19:25.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Active Low: This input will be active on a logic level 0,or 0V

    You may find some timing diagram in your datasheet. Look how it goes.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    CosMecc's Avatar
    CosMecc Guest


    Did you find this post helpful? Yes | No

    Cool

    Thanks
    I've find the problem, I didn't connect the STANDBY pin of the AD7731, now it works fine.
    The problem now is with 24bit numbers with PBP! (I'm work around)

    P.S.: in some codes on the net, I've seen that the Proton PicBasic works with decimal numbers, it is right?

  4. #4
    CosMecc's Avatar
    CosMecc Guest


    Did you find this post helpful? Yes | No

    Angry

    I've write a code that read the Data OUT of the AD7731, but i note that the most significant bit continuosly change??
    I've setted the part to unipolar mode.

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Is it possible to send your schematic and code here?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    CosMecc's Avatar
    CosMecc Guest


    Did you find this post helpful? Yes | No

    Default

    Here is my code, for the schematic I'm drawing it...

    Code:
    '****************************************************************
    '*  Name    : 7731_SigmA2D.BAS                                  *
    '*  Author  : Giandomenico Di Massa                             *
    '*  Notice  : Copyright (c) 2006                                *
    '*          : All Rights Reserved                               *
    '*  Date    : 01/11/2006                                        *
    '*  Version : 1.0                                               *
    '*  Notes   :                                                   *
    '*          :                                                   *
    '****************************************************************
    define OSC 10
    define SHIFT_PAUSEUS 20
    
    'LCD setup
    Define LCD_DREG	PORTB		'Set the LCD port
    Define LCD_DBIT	4			'set the fist bit for the LCD
    Define LCD_RSREG PORTB		'Set the bit Register Select port
    Define LCD_RSBIT 1			'set Register Select pin
    Define LCD_EREG	PORTB		'Set bit Enable port 
    Define LCD_EBIT 2 			'Set the Enable pin
    Define LCD_BITS 4
    Define LCD_LINES 4
    
    'Serial Peripheral Interface setup	
    symbol SCK=PORTC.6          'Clock pin
    symbol SI=PORTC.5           'AD7731 Data in pin
    symbol SO=PORTC.4           'AD7731 Data out pin
    symbol CS=PORTC.7           'AD7731 Chip select pin
    symbol RDY=PORTC.2          'AD7731 Ready pin
    
    'Variables declaration
    C1 Var byte
    Send Var byte               'Byte sent to the 8 bits Communication register of the AD7731
    Command var byte            'Byte sent as command to a register setted by Send in Communcation register
    Command2 var word           'Word sent to 16 bit register as Mode or Filter register of the AD7731
    Rec  VAR byte               'Byte received from AD7731:only for communication register 8 bit
    AD var word                 'AD converter value 16 bits data word
    mVolt var word
    dmVolt var word
    
    pause 500    
    LCDOUT $FE,1
    input rdy
    LCDOUT "Initiating..."
    gosub waitbutton
    lcdout $FE, $C0, "OK"
    pause 1000
    
    Test_communication_interface: 'Active and deactive the D0 digital line to test the AD7731 - Communication
          Send=$2               'Send command $2 hex to the communication register:next operation  is a write on Mode register
          Command2=$0B74        'Send command $0B74 hex to the Mode Register: Active Digital line, put hi the D0 output
          gosub lcdupdate
          gosub ad_write2       'Send command
          gosub waitbutton 
          Send=$2               'Send command $2 hex to the communication register:next operation  is a write on Mode register
          Command2=$0974        'Send command $0974 hex to the Mode Register: Active Digital line, put low the D0 output
          gosub lcdupdate
          gosub ad_write2       'Send command
          gosub waitbutton
    Setup_Configuration:
          Send=$3               'Send command $3 hex to the communication register:next operation  is a write on Filter register
          Command2=$8002        'Send command $8002 hex to the Filter register: 122Hz output rate in nonCHOP mode
          gosub lcdupdate
          gosub ad_write2       'Send command
          gosub waitbutton     
    
    'AD7731 Self Calibration      
          Send=$2               'Send command $2 hex to the communication register:next operation  is a write on Mode register
          Command2=$91F4        'Send command $0974 hex to the Mode Register: Internal zero scale calibration
          gosub lcdupdate
          gosub ad_write2       'Send command     
          gosub waitrdy
          Send=$2               'Send command $2 hex to the communication register:next operation  is a write on Mode register
          Command2=$B1F4        'Send command $B1F4 hex to the Mode Register: Internal full scale calibration
          gosub lcdupdate
          gosub ad_write2       'Send command  
          gosub waitrdy
          Send=$2               'Send command $2 hex to the communication register:next operation  is a write on Mode register
          Command2=$D1F4        'Send command $D1F4 hex to the Mode Register: System zero scale calibration
          gosub lcdupdate
          gosub ad_write2       'Send command  
          gosub waitrdy
          Send=$2               'Send command $2 hex to the communication register:next operation  is a write on Mode register
          Command2=$F1F4        'Send command $F1F4 hex to the Mode Register: System full scale calibration
          gosub lcdupdate
          gosub ad_write2       'Send command  
          gosub waitrdy
          lcdout $FE,$1
    Loop:           
          Send=$2               'Send command $2 hex to the communication register:next operation  is a write on Mode register
          command2=$50F4        'Send command $50F4 hex to the Mode Register: Single conversion,Range 0-1.28V, Data length 16 bit, AIN1-AIN2 Full Differential
          gosub ad_write2       'Send command  
          gosub waitrdy      
          gosub ad_read                             'Read the Data Registaer
          lcdout $FE, $80,"Rec:",hex ad,"    "
          lcdout $FE,$80+10," AD:",dec ad,"    "
          lcdout $FE,$C0,"Ad:",bin16 ad
          mvolt = ad*195                            'Scale the 16 bit value to milliVolt
          mvolt=div32 10000
          dmvolt=R2/100
          lcdout $FE,$94,"Volt:",dec mvolt,",",dec2 dmvolt, " mV     "
          pause 300     
     goto loop       
     END
          
    AD_Write2:
    'AD7731 write routine into a 16 bit register as Mode register
    'first byte is sent to the Communication register for the register selection
    'second word od 16 bit is value to be sent 
    'this routine is valid only for writin in 16 bits registers
    
        low cs                          'Enable Device
        shiftout so,sck,1,[send\8]      'Send the command to the communication register: write enable command
        shiftout so,sck,1,[command2\16] 'Send the command to the 16 bit register
        high cs                         'disable the device
        return
    
    AD_Read:
        low cs
        shiftout so,sck,1,[$11\8]
        shiftin si,sck,0,[AD\16]
        high cs
    return
        
    WaitButton:
       button PORTC.3,255,0,0,C1,1,GoOut
       goto waitbutton
    GoOut:
        return
     
    LCDupdate:
    	LCDOUT $FE,1
        lcdout "Comm. register: ", hex send,$FE, $C0,BIN8 send
        lcdout $FE, $94,"Command: ",hex command2 , $FE, $D4,bin16 command2
        return                   
    
    WaitRDY: 
        while rdy=1 
        wend
    return
    Last edited by CosMecc; - 12th November 2006 at 11:03.

  7. #7
    CosMecc's Avatar
    CosMecc Guest


    Did you find this post helpful? Yes | No

    Default

    Here is the scheme...
    thanks
    Attached Images Attached Images

  8. #8
    CosMecc's Avatar
    CosMecc Guest


    Did you find this post helpful? Yes | No

    Default

    does any one has experience with this ADC?

  9. #9
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    If i refer to the datasheet, they suggest 33pF capacitor wit a 4.9152MHz crystal.
    Try increasing the capacitor value first.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  10. #10
    CosMecc's Avatar
    CosMecc Guest


    Did you find this post helpful? Yes | No

    Default

    Do you think that the cap difference could be the cause of the ADC instability?

  11. #11
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Talking

    could be... i've never use this converter, i'm not on your bench, i don't see how you place it on your board (prototype or not) and unfortunately my scope probe are not long enough to reach you

    could also be the supply line, wind direction or alien invasion... who knows ?
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  12. #12
    CosMecc's Avatar
    CosMecc Guest


    Did you find this post helpful? Yes | No

    Angry

    I'm trying with 33pF cap, but nothing new

  13. #13
    CosMecc's Avatar
    CosMecc Guest


    Did you find this post helpful? Yes | No

    Cool

    Uhau!
    I've found the problem! It isn't the AD7731, but the PIC, I've used the MSBPRE mode to read the data, changing to MSBPOST, it works very fine!!

    Thanks

  14. #14
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    DOH! i should see it before

    Even a superhero may fail

    Congratulation!
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  15. #15
    sparkysignal116's Avatar
    sparkysignal116 Guest


    Did you find this post helpful? Yes | No

    Question Is this project still alive?

    Hi everybody,

    I have this module at home and i would like to experiment to get the same result but with a PIC16F628A. Will it work?.

    I've seen the schematics and all seems to be fit into the processor i am trying to use.
    I dont have any idea if the original creator of this thread is still active, but this project seems very exciting to me.

Similar Threads

  1. Sony LanC Program
    By l_gaminde in forum Code Examples
    Replies: 2
    Last Post: - 25th September 2009, 18:51
  2. RB0 + Internal Pullup + Interrupt
    By Freman in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 10th August 2009, 11:11
  3. Old and beyond help ?
    By DavidFMarks in forum mel PIC BASIC Pro
    Replies: 46
    Last Post: - 11th December 2008, 15:23
  4. Serial Question + General Review
    By Freman in forum General
    Replies: 2
    Last Post: - 20th June 2008, 22:27
  5. 4-line LCD Help - using PortA instead of B
    By Tom Gonser in forum mel PIC BASIC Pro
    Replies: 28
    Last Post: - 31st March 2005, 03:14

Members who have read this thread : 1

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