Coolquest, Inc. Home Products Support About Contact
cbold_logo_gif C++BOLD Example Design: IROD cbold_logo_gif

Design Home <<  File View  >> Class View Output (partial) Parts Library Examples Home

 

// THIS FILE IS IN THE PUBLIC DOMAIN.
// IT IS PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT
// NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
 
#ifndef _MeasureH_
#define _MeasureH_
 
#include "max396.h"
#include "ads1252.h"
 
// CB_MeasureControl: ports to/from external controller of measurement ADC
class CB_MeasureControl : public TBundle {
public:
  port ASEL;      // mux address lines
  port CLK;       // ADC clock, 16 MHz max
  port SCLK;      // serial clock
  port DOUT;      // serial data
  virtual void Register() {
    regb( ASEL, 3, 0 );
    reg(  CLK );
    reg(  SCLK );
    reg(  DOUT );
  }
};
 
 
class CM_Measure : public TModule {    // Power measurement
public:
 
// ***** member bundles ***** //
  CB_MeasureControl MeasCtrl;    // control and data signals
 
// ***** member ports ***** //
  port VCC12;     // all supply voltages for this module are derived from 12V
  port GND;
  port AIN;       // analog voltages to be measured
 
// ***** member modules and parts ***** //
  CP_REG103UA_5 Regulator;   // 5.0 V voltage regulator for VCC5A
  CP_AD1580     Reference1;  // 1.225V voltage references
  CP_AD1580     Reference2;
  CP_AD1580     Reference3;
 
  CP_MAX396CAI  Mux;         // 16-input analog mux
  CP_ADS1252U   ADC;         // Burr-Brown delta-sigma ADC
  CP_OPA237NA   Buffer1;     // buffer between mux and divider, powered by VCC10A
  CP_OPA237NA   Buffer2;     // buffer between divider and ADC, powered by VCC5A
 
  CP_R110       Rpwr1;       // fuse/filter resistor for VME 12V
  CP_R4_7K      Rpwr2;       // protection resistor for mux
  CP_R1K        Rb;          // bias resistor for references, 1K --> 1.3 mA to references
  CP_R4_7K      Rin1;        // Buffer input resistor
  CP_R4_7K      Rfb1;        // Buffer feedback resistors
  CP_R4_7K      Rfb2;
  CP_R10K       Rdivh;       // resistor divider
  CP_R10K       Rdivl;
 
  CP_R1K        Rsclkp;      // pullup resistors (ADC requires >4V digital level)
  CP_R1K        Rclkp;
  CP_R4_7K      Rsclks;      // series resistors to protect ADC
  CP_R4_7K      Rclks;
  CP_R4_7K      Rdouts;      // (optional)
 
  CP_R360       Rmuxin[ 16 ];  // series resistors at analog mux input:  minimize risk of shorting power supplies, simplify connections to power planes
 
  CP_R110       Rpwr3;         // resistor added for more power dissipation capability: in series with Rpwr1
  CP_CDC_POS    CDC[ 7 ];      // ceramic decoupling and filter capacitors
  CP_TDC_POS    TDC;           // tantalum decoupling capacitor
 
 
  virtual void Register() {
// bundles
    reg( MeasCtrl );
 
// ports
    reg(  VCC12 );
    reg(  GND );
    regb( AIN, 13, 0 );
 
// parts and modules
    reg(  Regulator  );
    reg(  Reference1 );
    reg(  Reference2 );
    reg(  Reference3 );
    reg(  Mux );
    reg(  ADC );
    reg(  Buffer1 );
    reg(  Buffer2 );
 
    reg(  Rpwr1  );
    reg(  Rpwr2  );
    reg(  Rb     );
    reg(  Rin1   );
    reg(  Rfb1   );
    reg(  Rfb2   );
    reg(  Rdivh  );
    reg(  Rdivl  );
 
    reg(  Rsclkp );
    reg(  Rclkp  );
    reg(  Rsclks );
    reg(  Rclks  );
    reg(  Rdouts );
    rega( Rmuxin, 16 );
    reg(  Rpwr3  );
 
    rega( CDC, 7 );
    reg(  TDC    );
 
  }
 
  virtual void Connect() {
    wireall( GND );
    wireall( "/NC", "NC" );
 
// power:  All power is derived from 12V, the circuit requires very little current (~20mA)
    VCC12    ^ Rpwr1 ^ "VCC11A" ^ Rpwr3 ^ "VCC10A";   // filter VCC12, drop voltage ~ 4.4V (assuming 20mA)
    "VCC10A" ^ Rpwr2 ^ "VCCMUX";   // mux power--current is ~ 1 uA
 
    "VCC10A" << Regulator.INPUT
             << Regulator.ENABLE;   // regulator is always enabled
    "VCC5A"  << Regulator.OUTPUT;   // 5V analog supply for most of the circuit
    "/NC"    << Regulator.NR;       // noise reduction
    "/NC"    << Regulator.ERROR_N;  // error indicator
 
 
    "VCC5A"  << TDC.POS;         // 10uF cap recommended for regulator stability
    "VCC5A"  << CDC[ 0 ].POS;  // decoupling
    "VCC5A"  << CDC[ 1 ].POS;
    "VCC5A"  << CDC[ 2 ].POS;
    "DIV2"   << CDC[ 3 ].POS;  // filter divided voltage
    "REF1"   << CDC[ 4 ].POS;  // filter references
    "REF3"   << CDC[ 5 ].POS;
    "VCC10A" << CDC[ 6 ].POS;  // filter VME 12V
 
// Buffers
    "VCC10A" << Buffer1.VPP;  GND << Buffer1.VNN;
    "VCC5A"  << Buffer2.VPP;  GND << Buffer2.VNN;
    "MUXOUT" << Mux.COM      ^ Rin1 ^ "IN_P1" << Buffer1.IN_P;  // input resistor to protect amp
    "IN_N1"  << Buffer1.IN_N ^ Rfb1 ^ "OUT1"  << Buffer1.OUT;   // resistor in feedback minimizes effect of amp's Ibias
    "IN_N2"  << Buffer2.IN_N ^ Rfb2 ^ "OUT2"  << Buffer2.OUT;
 
    "OUT1" ^ Rdivh ^ "DIV2" << Buffer2.IN_P ^ Rdivl ^ GND;     // resistor divider to Buffer2 input
 
// ADC
    "VCC5A" <<  ADC.VCC5;
    "OUT2"  <<  ADC.VIN_P;   // user's voltage divided by two
    "REF1"  <<  ADC.VIN_N;   // 1.225V
    "REF3"  <<  ADC.VREF;    // 3.675V
 
    //        pullup        port       series                pin
    "VCC5A" ^ Rsclkp ^ MeasCtrl.SCLK ^ Rsclks ^ "ADCSCLK" << ADC.SCLK;    // pullup and/or series protection resistors
    "VCC5A" ^ Rclkp  ^ MeasCtrl.CLK  ^ Rclks  ^ "ADCCLK"  << ADC.CLK;
                       MeasCtrl.DOUT ^ Rdouts ^ "ADCDOUT" << ADC.DOUT;
 
// references
    "REF3" << Reference3.VPP  ^ Rb ^ "VCC5A";
    "REF2" << Reference2.VPP << Reference3.VNN;
    "REF1" << Reference1.VPP << Reference2.VNN;
    GND    <<                   Reference1.VNN;
 
// analog mux
    "VCCMUX"       << Mux.VPP << Mux.EN;    // supply current is < 1 uA
    GND            << Mux.VNN;              // single-supply --> V- is connected to GND
    MeasCtrl.ASEL  << Mux.A(   3, 0 );
    "LOC_MUXIN"    << Mux.NO;
 
    for ( int i = 0; i < 14; ++ i ) {
      AIN( i )  ^ Rmuxin[ i  ] ^  Mux.NO( i );       // lowest 14 switches are available to user
    }
    "REF1"      ^ Rmuxin[ 14 ] ^  Mux.NO( 14 );         // 1.225V for calibration
    "REF3"      ^ Rmuxin[ 15 ] ^  Mux.NO( 15 );         // 3.675V for calibration
  }
};
 
#endif

 

Design Home <<  File View  >> Class View Output (partial) Parts Library Examples Home

Legal Copyright © 2007 by Coolquest, Inc. Contact