Main Content

SAR ADC

N-bit successive approximation register (SAR) based ADC

  • Library:
  • Mixed-Signal Blockset / ADC / Architectures

  • SAR ADC块

Description

Successive Approximation Register (SAR) based ADC consists of a sample and hold circuit (SHA), a comparator, an internal digital to analog converter (DAC), and a successive approximation register.

When the ADC receives thestartcommand, SHA is placed in hold mode. The most significant bit (MSB) of the SAR is set to logic1, and all other bits are set to logic0.

The output of the SAR is fed back to a DAC, whose output is compared with the incoming input signal. If the DAC output is greater than the analog input, MSB is reset, otherwise it is left set. The next MSB is now set to 1, and the process is repeated until every bit the SAR is compared. The final value of the SAR at the end of this process corresponds to the analog input value. The end of the conversion process is indicated by thereadysignal.

Ports

Input

expand all

Analog input signal, specified as a scalar.

Data Types:double

External clock to start conversion, specified as a scalar. The analog to digital conversion process starts at the rising edge of the signal at thestartport.

Data Types:double

Output

expand all

Converted digital output signal, returned as a scalar.

Data Types:fixed point|single|double|int8|int16|int32|uint8|uint16|uint32|Boolean

Determines whether the analog to digital conversion is complete, returned as a scalar.

Data Types:double

Parameters

expand all

Configuration

Number of physical output bits, specified as a unitless positive real integer in the range[1, 26].Number of bitsdetermines the resolution of the ADC.

Programmatic Use

  • Useget_param(gcb,'NBits')to view the currentNumber of bits.

  • Useset_param(gcb,'NBits',value)to setNumber of bitsto a specific value.

Data Types:double

ADC dynamic range, specified as a 2-element row vector in volts.

Programmatic Use

  • Useget_param(gcb,'InputRange')to view the currentInput range (V).

  • Useset_param(gcb,'InputRange',value)to setInput range (V)to a specific value.

Data Types:double

Select to connect to an external start conversion clock. By default, this option is selected. If you deselect this option, aSampling Clock Sourceblock inside theSAR ADCis used to generate the start conversion clock.

Frequency of internal start conversion clock, specified as a positive real scalar in Hz.Conversion start frequencydetermines the rate of the ADC.

Dependencies

This parameter is only available whenUse external start clockis not selected.

Programmatic Use

  • Useget_param(gcb,'StartFreq')to view the current value ofConversion start frequency (Hz).

  • Useset_param(gcb,'StartFreq',value)to setConversion start frequency (Hz)to a specific value.

Data Types:double

RMS aperture jitter added as an impairment to the start conversion clock, specified as a real nonnegative scalar in s. SetRMS aperture jittervalue to zero if you want a clean clock signal.

Dependencies

This parameter is only available whenUse external start clockis not selected.

Programmatic Use

  • Useget_param(gcb,'StartClkJitter')to view the current value ofRMS aperture jitter (s).

  • Useset_param(gcb,'StartClkJitter',value)to setRMS aperture jitter (s)to a specific value.

Data Types:double

Frequency of the SAR clock, specified as a real scalar in Hz.SAR Frequency (Hz)must be high enough to allow the ADC to performNbitscomparison, whereNbitsis theNumber of bitsADC。The block has one cycle overhead due to algebraic loop removal. So, the clock must run for one additional cycle before the output is ready. So, theSAR Frequency (Hz)(fSAR) is given by the equation f SAR ( N b i t s + 1 ) f start , wherefstartis theConversion start frequency.

Programmatic Use

  • Useget_param(gcb,'SARFreq')to view the current value ofSAR Frequency (Hz).

  • Useset_param(gcb,'SARFreq',value)to setSAR Frequency (Hz)to a specific value.

Inherit the output polarity and data type from the analog input signal to the ADC. When this option is selected, it forces the ADC to output a scalar double matched to the input's scale of the ADC.

Defines the ADC output data polarity.

IfOutput polarityis set toAuto, the minimum and maximum values of the output are determined by the polarity of theInput range.

IfOutput polarityis set toBipolar, the outputs are between-2Nbits-1and2Nbits-1-1.

IfOutput polarityis set toUnipolar, the outputs are between0and2Nbits-1.

Dependencies

This parameter is only editable whenMatch input scaleoption is deselected.

Programmatic Use

  • Useget_param(gcb,'OutputPolarity')to view the currentOutput polarity.

  • Useset_param(gcb,'OutputPolarity',value)to setOutput polarityto a specific value.

Defines ADC output data type.

Unsigned integers and fixed-point types (fixdt(0,Nbits)) are not available when theOutput polarityis set toBipolarorAuto.

Signed integers and fixed-point types (fixdt(1,Nbits)) are not available when theOutput polarityis set toUnipolar.

Dependencies

This parameter is only editable whenMatch input scaleoption is deselected.

Programmatic Use

  • Useget_param(gcb,'OutDataType')to view the currentOutput data type.

  • Useset_param(gcb,'OutDataType',value)to setOutput data typeto a specific value.

Impairments

Select to enable impairments such as offset error and gain error in ADC simulation. By default, this option is deselected.

Shifts quantization steps by specific value, specified as a scalar in least significant bit (LSB) or %.

Dependencies

This parameter is only available whenEnable impairmentsis selected.

Programmatic Use

  • Useget_param(gcb,'OffsetError')to view the current value ofOffset error (LSB).

  • Useset_param(gcb,'OffsetError',value)to setOffset error (LSB)to a specific value.

Data Types:double

Error on the slope of the straight line interpolating ADC transfer curve, specified as a real scalar in %FS, FS, or LSB.

Dependencies

This parameter is only available whenEnable impairmentsis selected in theImpairmentstab.

Programmatic Use

  • Useget_param(gcb,'GainError')to view the current value ofGain error.

  • Useset_param(gcb,'GainError',value)to setGain errorto a specific value.

Data Types:double

Version History

Introduced in R2019a