TSI ADC Features

Introduction

The TLSR8258F512 integrates one Successive Approximation Register type (SAR) Analog-to-Digital Converter (ADC) module, which can be used to sample analog input signals such as battery voltage, temperature sensor, mono or stereo audio signals, as well as internal noise signal. ADC module supports 4 channels as follows:

  • Misc channel: Applied to battery voltage detection and temperature measurement
  • Left channel: Supports mono and stereo audio
  • Right channel: Only support stereo audio with Left channel
  • RNS channel: generate random number sequence by sampling internal noise signals

All channels above can be combined freely or independently except Right channel, which only can be applied to the stereo audio with Left channel.

Set-Capture Structure

The operation process of every channel in the ADC module can be roughly divided into channel configuration phase ("Set State") and data conversion phase ("Capture State"). In the channel configuration phase, you must offer enough time to ensure all configurations be finished. Similarly, there is enough time for data conversion operations during the data conversion phase. All channels have data conversion phase and channel configuration phase except RNS channel. RNS channel only have data conversion phase.

The ADC module uses a polling mechanism to access the enabled channels in sequence. if all channels are enabled, The ADC module converts data from the RNS, to the left channel, to the right channel, and finally to the MISC channel.

Set State

In the channel configuration phase("Set State"), The main work of the ADC module is as follows:

  • select Input Mode: single-end or differential input mode
  • select Input Pin: select input pin in single-end mode and select positive and negative input pin in differential mode
  • select Reference Voltage: Vref, ADC maximum input range is the determined by the ADC reference voltage.
  • select Input scaling factor: By setting this scaling factor, ADC maximum input range can be extended based on the Vref. for example, suppose the Vref is set as 1.2v:
    • if the scaling factor is set as 1, the ADC maximum input range should be 0 ~ 1.2v in single-end mode and -1.2v ~ +1.2v in differential mode
    • if the scaling factor is set as 1/2, the ADC maximum input range should be 0 ~ 2.4v in single-end mode and -2.4v ~ +2.4v in differential mode
      - select ADC resolution: Supports 4 resolution settings: 8,10,12,14bits. ADC data is always 15-bit format no matter what the resolution is set. for example, 14 bits resolution indicates ADC data consists of 14-bit valid data and 1-bit sign extension bit.
  • select sampling time: set sampling time which determines the speed to stablilize input signals. The lower sampling cycle, the shorter ADC convert time.

Capture State

In the data conversion phase("Capture State"), the RNS channel is to capture random number sequence(RNS) derived from internal noise. For the Left , Right and MiSC channels, data sampling, data conversion, and data output are required at this stage.

The total duration is the sum of the length of "Set State" and "Capture State" of all enabled channels, determines the sampling rate.

ADC APIs List

In order to facilitate users to quickly develop products according to their own needs, TSI provide the following related APIs and examples.

APIs list Description Example Update Date Status
adc_power_on_sar_adc() power on ADC Module API-ADC-CASE1 2019-1-10 Done
adc_reset_adc_module() reset ADC Module - 2019-1-10 Done
adc_enable_clk_24m_to_sar_adc() enable the clock of ADC Module - 2019-1-10 Done
adc_set_sample_clk() set the divider of clock frequency for ADC Module - 2019-1-10 Done
adc_set_vref_chn_misc() set the Vref of Misc channel - 2019-1-10 Done
adc_set_vref_chn_left() set the Vref of Left channel - 2019-1-10 Done
adc_set_vref_chn_right() set the Vref of Right channel - 2019-1-10 Done
adc_set_ref_voltage() set the Vref for the specified channel - 2019-1-10 Done
adc_set_vref_vbat_divider() set the divider of Vref for battery Detect - 2019-1-10 Done
adc_set_ain_negative_chn_misc() select negative pin for Misc channel - 2019-1-10 Done
adc_set_ain_positive_chn_misc() select positive pin for Misc channel - 2019-1-10 Done
adc_set_ain_negative_chn_left() select negative pin for Left channel - 2019-1-10 Done
adc_set_ain_positive_chn_left() select positive pin for Left channel - 2019-1-10 Done
adc_set_ain_negative_chn_right() select negative pin for Right channel - 2019-1-10 Done
adc_set_ain_positive_chn_right() select positive pin for Right channel - 2019-1-10 Done
adc_set_ain_channel_single_ended_input_mode() set the input pin of the single-end mode for the specified channel - 2019-1-10 Done
adc_set_ain_channel_differential_mode() set the positive and negative pin of the differential mode for the specified channel - 2019-1-10 Done
adc_set_ain_pre_scaler() set the input prescaler for the specified channel - 2019-1-10 Done
adc_set_resolution_chn_misc() set the resolution for Misc channel - 2019-1-10 Done
adc_set_resolution_chn_left() set the resolution for Left channel - 2019-1-10 Done
adc_set_resolution_chn_right() set the resolution for Right channel - 2019-1-10 Done
adc_set_resolution() set the resolution for the specified channel - 2019-1-10 Done
adc_set_input_mode_chn_misc() set the input mode for Misc channel - 2019-1-10 Done
adc_set_input_mode_chn_left() set the input mode for Left channel - 2019-1-10 Done
adc_set_input_mode_chn_right() set the input mode for Right channel - 2019-1-10 Done
adc_set_input_mode() set the input mode for the specified channel - 2019-1-10 Done
adc_set_tsample_cycle_chn_misc() set the sampling cycle for Misc channel - 2019-1-10 Done
adc_set_tsample_cycle_chn_left() set the sampling cycle for Left channel - 2019-1-10 Done
adc_set_tsample_cycle_chn_right() set the sampling cycle for Right channel - 2019-1-10 Done
adc_set_tsample_cycle() set the sampling cycle for the specified channel - 2019-1-10 Done
adc_set_length_set_state() set the length of set state for all channel - 2019-1-10 Done
adc_set_length_capture_state_for_chn_misc_rns() set the length of capture state for Misc and RNS channel - 2019-1-10 Done
adc_set_length_capture_state_for_chn_left_right() set the length of capture state for Left and Right channel - 2019-1-10 Done
adc_set_state_length() set the length of set and capture state for all channels - 2019-1-10 Done
adc_set_chn_enable() enable the specified channel - 2019-1-10 Done
adc_set_max_state_cnt() set the number of max state for ADC module - 2019-1-10 Done
adc_set_itrim_preamp() set pre-scaling for comparator preamp bias current trimming - 2019-1-10 Done
adc_set_itrim_vrefbuf() set pre-scaling for Vref buffer bias current trimming - 2019-1-10 Done
adc_set_itrim_vcmbuf() set pre-scaling for Vref(Vcmbuf) buffer bias current trimming - 2019-1-10 Done
adc_set_mode() set mode for ADC Module - 2019-1-10 Done
pga_left_chn_power_on() power on the Left channel of PGA - 2019-1-10 Done
pga_right_chn_power_on() power on the Right channel of PGA - 2019-1-10 Done
adc_set_left_boost_bias() set the boost bias of Left channel for ADC Module - 2019-1-10 Done
adc_set_right_boost_bias() set the boost bias of Right channel for ADC Module - 2019-1-10 Done
adc_set_left_gain_bias() set the gain bias of Left chanenl for ADC Module - 2019-1-10 Done
adc_set_right_gain_bias() set the gain bias of Right chanenl for ADC Module - 2019-1-10 Done
adc_sample_and_get_result() start adc sampling and get results API-ADC-CASE1 2019-1-10 Done
adc_init() initiate ADC Module API-ADC-CASE1 2019-1-10 Done
adc_base_pin_init() initiate the pin in the BASE mode of ADC Module API-ADC-CASE1 2019-1-10 Done
adc_vbat_pin_init() initiate the pin in the VBAT mode of ADC Module API-ADC-CASE2 2019-1-10 Done
adc_base_init() initiate ADC Module in the BASE mode API-ADC-CASE1 2019-1-10 Done
adc_vbat_init() initiate ADC Module in the VBAT mode API-ADC-CASE2 2019-1-10 Done

TSI provides the following examples of this module to help users quickly understand and apply related modules.

Examples list Description Update Date Status
API-ADC-CASE1 Measuring external voltage by gpio 2019-1-10 Done
API-ADC-CASE2 Measuring internal battery voltage 2019-1-10 Done
API-ADC-CASE3 Measuring random number sequence 2019-1-10 Done

History Record

Date Description Author
2019-1-10 initial release LJW
2019-8-15 update api name for application LJW