This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS1258: Way to poll the ADC channels

Part Number: ADS1258
Other Parts Discussed in Thread: ADS131A04, ADS131M08, ADS1278, ADS1274

I have looked online and in the datasheet for the ADS1258 and I am not able to find a way to request a single ADC channel or all of them. Is there a way to not use the data ready pin and just poll the ADC channels one at a time or request the ADC value for all of the ADC channels?

  • Hi Matthew,

    Using DRDY is certainly the recommended method for polling data on the ADS1258. If you want to use a counter or something like that to time the conversion, it is best to do so using single-shot conversion mode (either toggling the START pin or using the PULSE command). This way the timer can begin as soon as the pin is taken high or the command is sent. If you want to try to time out multiple conversions across different channels, there is a good chance the timer and the ADC could get out of sync and you will either miss conversions or get corrupted / wrong data.

    The ADC data must be read out by the host on a per channel basis. There is no buffer / FIFO in this device such that you can read out multiple channel data at one time.

    I am not quite clear on exactly what you want to do, so hopefully some of this information helps. If not, please let me know what your end goal is and we can try to identify a solution.

    -Bryan

  • I wan to read each channel one at a time.  Send SPI command to read ADC channel 5 then get the results. 

  • Hi Matthew,

    If you can read channels on an individual basis i.e. use PULSE command or toggle START pin, then you should be able to set a timer in your host that begins counting as soon as either of those actions are taken. You can determine the time it takes for the conversion to complete by looking at the information in Table 11 in the ADS1258 datasheet (note the conditions in the table title, should you decided to make any changes to these specific register settings). Table 11 is relative to the master clock rate (fCLK).

    You could also use the NEW bit in the STATUS register, though this is only valid in Auto-Scan mode. You would have to poll the STATUS byte repeatedly within one conversion in order to determine when new data is available since you do not want to use DRDY. Please see page 33 in the datasheet for more information about this option.

    Let me know if you have any other questions.

    -Bryan

  • I do not like any of the options. I think I am going to look for another chip. I have dealt with ADC before and they have always allowed you to request each channel individually. The problem is they only supported 12 bit resolution and only had 8 channels.  

  • Hi Matthew,

    You can certainly request each channel data individually, but you would have to do so after measuring that channel. So if you measured channel 5, you would need to clock out the data after that conversion completes. If you did not, and then started a new conversion, the next channel channel would override the previous channel once that next channel conversion completes. In other words, the ADC only stores the data for most recent conversion.

    The processing flow would look something like this:

    • Power up ADC
    • Initialize registers, set mux to first channel e.g. AIN0
    • Begin conversions (PULSE command or START pin)
    • When conversion completes, clock out data from AIN0
    • Change channel to AIN1, begin conversion
    • When conversion completes, clock out data from AIN1
    • etc.

    Is this the type of operation you need?

    -Bryan

  • I clicked the wrong button this does not solve my problem but you can close the thread.

  • Hi Matthew,

    Is there a way then that we can help identify an ADC that works for your application? Do you need a simultaneous sampling ADC? An ADC with a parallel interface? I am not sure I completely understand what type of ADC operation you are looking for, so if you want to help explain it in more detail we will gladly help you find a device that meets your needs.

    -Bryan

  • I am looking for a ADC with 24 bit resolutions where I can request all of the ADC values in one message or one channel at a time. That way I can queue them up in a DMA. I would think that would be faster and use less of the CPU if I did it that way. 

  • Also my math was wrong. I thought it took 62 milliseconds to read all of the ADC channels on the chip it was actually 6.2 milliseconds  

  • Hi Matthew,

    It sounds like you might need a simultaneous sampling ADC, for example:

    • ADS131A04 = 24-bit, 4-ch simultaneous sampling ADC with no-front end drive
    • ADS131M08 = 24-bit, 8-ch simultaneous sampling ADC with PGA
    • ADS1278 = 24-bit, 4-ch simultaneous sampling ADC with flat passband filter

    All of these ADCs measure each channel in parallel, so when the DRDY signal indicates new data are ready, you can read out all 4 or 8 channels worth of data at once. You would still need to read the data before the next conversion completes since the information is not buffered, but you would not have to read out each channel sequentially by sending read data commands each time.

    Let me know if this is what you are looking for. Links to these devices will be appended to the top of this thread, just below the thread title ("ADS1258: way to poll the ADC channels")

    -Bryan

  • That is it but do you have one that has more channels? We currently use 2 ADS1258. If you have a 16 channel or 12 channel one that would be great. I think that would allow me to read the ADC faster or about the same rate without using up so much of the CPU. The current setup uses about 25% of the CPU and that is when the data rate is set to 384.  Every time I get an interrupt from the data ready pin I need to put 5 byte on the bus and that takes about 80 microseconds. That doesn't count for the time it takes to run the code around the code that sends the data on the SPI bus and and the time to  enter and exit the interrupt.  

  • Hi Matthew,

    We do not have a single device with >8 simultaneous channels at the moment. However, there are options to use two or more ADCs together to achieve the same goal. For example, the ADS1278 and ADS131A04 have daisy-chain modes where the signals from your controller feed into one device and through to the next one, with only one DOUT pin in most cases. Below is a screenshot from the ADS1278 datasheet showing how the devices are connected together, the signals required, and how the data stream comes out of the ADC. The ADS131A04 has a similar format.

    The ADS131M08 can operate with multiple devices, but you would need separate CS lines for each device to control when data is being received. Or, if you have multiple DOUT pins on your controller, you can take the data from each device separately. Refer to section 9.1.5 in the ADS131M08 for more information.

    Please review these options and let me know if you have any more general questions. If you have specific questions about these simultaneous sampling devices, I would ask that you post a new thread with that specific subject line so one of our other ADC experts can help you. I am not as familiar with those ADCs as some of my colleagues, so they will provide support when you start a new thread.

  • That solves that problem. What is no maximum number of devices you can daisy chain. I could not find it in the documentation.

  • Hi Matthew

    This would depend on a variety of factors, including your desired SCLK speed, how much data comes from one channel (typically 24 bits, but if you have things like CRC or STATUS bytes enabled - where applicable - then you could have 32, 40, or more bits per channel), and how fast you intend to run the ADCs. For example, if you sampled very slow e.g. 1 SPS, you would have lots of time to clock out data before the next conversion completes, and could reasonably daisy-chain more devices together under those circumstances. On the flip side, if you were sampling very fast, the opposite would be true. Moreover, you would need to consider the drive strength of your digital signals if you start adding lots of devices to the chain. So it really depends on a lot of factors.

    I would respectfully ask that if this sounds like it could work for you, please select a device (ADS1278 might be best since you could use either 1x ADS1278 and 1x ADS1274 for 12 channels, or 2x ADS1278s for 16 channels) and post a new thread with your specific requirements included. Then, the appropriate ADC expert will help you from there.

    -Bryan