Main Content

ADS1x15

Read digital output data from ADS1015 and ADS1115 ADCs

Since R2023a

Add-On Required: This feature requires the Simulink Support Package for Raspberry Pi Hardware add-on.

  • Raspberry Pi ADS1x15 Block Icon

Libraries:
Simulink Support Package for Raspberry Pi Hardware / Basic

Description

Use the ADS1x15 analog-to-digital converter block to perform analog-to-digital conversion of signals connected to the selected ADC input pins. The block outputs digital values representing the analog input signal and stores the converted values in the result register of your digital signal processor. You use this block to capture and digitize analog signals from external sources such as signal generators, frequency generators, or audio devices. With the ADS1x15 block, you can configure for ADS1015 and ADS1115 converter, that provides a 12-bit and 16-bit precision digital output, respectively.

Ports

Output

expand all

The block outputs the converted digital data of analog channel. For ADS1015 converter, the digital output values are in the range 0 to 4095 while, for ADS1115 converter, the digital output values are in the range 0 to 65535.

Data Types: int16

Parameters

expand all

Basic

Select an ADC converter integrated circuit (IC) for performing analog to digital conversion. The ADS1015 IC is a 12-bit ADC while, the ADS1115 IC is a 16-bit ADC.

Select the I2C address for ADS1x15 ADC for communicating with the Raspberry Pi® board. The ADS1x15 ADC can have four I2C addresses depending on the logic level on pins SCL and SDA.

I2C AddressADC Address Pin
0x48GND
0x49VIN
0x4ASDA
0x4BSCL

  • Single-shot — In this mode, the ADC performs only one analog-to-digital conversion at the specified sample time and writes to the ADC result data registers.

  • Continuous — In this mode, the analog input is continually converted to its digital equivalent and written to the ADC result data registers.

Select the analog input channel of the ADC converter.

Select the gain of the ADC converter to amplify the weak input analog signal.

Select the analog-to-digital conversion rate of the ADC converter in samples per second (SPS).

Enter the time in seconds between consecutive sets of samples that are converted for the selected input channel. This is the rate at which values are read from the result registers.

Advanced

Select this option to enable advanced functions useful for ADC applications.

Select the comparator mode of operation for ALERT pin on ADC chip.

  • Traditional with hysteresis — In this mode, the ALERT pin on the ADC chip asserts when conversion data exceeds the limit set in the high threshold register. The comparator then de-asserts when the input signal falls below the low threshold register value.

  • Window — In this mode, the ALERT pin asserts is the conversion data exceeds the high threshold register or falls below the low threshold register.

Dependencies

  • To enable this parameter, select Enable comparator.

Select the comparator polarity for the ALERT pin on ADC chip.

  • Active low — Assert on the ALERT pin of the ADC chip on the falling edge of the digital output signal.

  • Active high — Assert on the ALERT pin of the ADC chip on the rising edge of the digital output signal.

Dependencies

  • To enable this parameter, select Enable comparator.

Select the latching configuration of the ALERT pin on the ADC chip.

  • Non-latching — Select this option to clear away the assertion on the ALERT ping of the ADC chip when the input analog signal is not beyond the low and high threshold values.

  • Latching — Select this option for the assertion to continue on the ALERT pin of the ADC chip even if the input analog signal is not beyond the low and high threshold values.

Dependencies

  • To enable this parameter, select Enable comparator.

Select the option to control the number of successive conversions exceeding the upper or lower thresholds required before asserting the ALERT pin of the ADC chip.

Dependencies

  • To enable this parameter, select Enable comparator.

Enter the lower threshold value for queue configuration before asserting the ALERT pin of the ADC chip.

Dependencies

  • To enable this parameter, select Enable comparator.

Enter the higher threshold value for queue configuration before asserting the ALERT pin of the ADC chip.

Dependencies

  • To enable this parameter, select Enable comparator.

Version History

Introduced in R2023a