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.

Compiler: Manual and On-the-fly mode operations

Other Parts Discussed in Thread: ADS7038

Tool/software: TI C/C++ Compiler

Hi,

I will use the ADS7038 chip, and I would like to get the ADC sample on the same frame. I read section 8.4 Device Functional Modes from the datasheet and I see that there are 4 modes of operation. But I saw that, for example, on the Manual mode, you request the ADC sample and 2 frames after you will get theADC sample (N+2). There is also another way to get the previous sample (N+1) with the MUX channel. Is there a possibility of transmit two messages at the same time in order to get the current ADC sample, even if it is taking 48 clock counts? 

I will also evaluate the possibility of using the On-the-fly mode and check if there is no loss of data o wrong behaviour by doing the same, transmit twice the same signal to get the sample on the same frame.

Or is there any code examples for this two configurations?, that could help a lot.

Thank you in advance for your answer.

Regards,

Fili.

  • Fili,

    1.  Sorry, I do not have any code examples.

    2.  When the multiplexer switches, some delay is required for Mux settling.  Also, it takes some time to issue the command to switch the multiplexer.  Finally, it takes some time for the device to sample, then convert the result.  This is why there is a latency from the command to switch channels until the conversion results is available. 

    3. Based on your comments, I don't think you are as concerned with the time aspect of the latency but rather you are concerned with keeping track of the channel IC.  Is that correct?  If so, did you know that you can include the Chanel ID with the data (see figure 25)?

    4. Have you considered the Auto-Sequence mode?  Here you could pre-program a sequence of channels that you want to scan.  You could then include the channel ID as part of the output data.  You can then use the channel ID to identify which channel is being read.

    5.  Alternatively, your idea of using the on-the-fly mode with a double read is an approach that could be used if you always want to explicitly set the channel and read back the result.  This is a little in-efficient, but otherwise there is no problem doing this.  

  • Hi Kay,

    Thank you for your reply.

    The intention of my application is to read, convert and request the actual value of the current measurement from the same AIN1 channel in the shortest possible time, as well as commanding digital outputs to be ON or OFF.

    Looking at the datasheet it seems that only 24-bit messages can be sent from the microcontroller to te ADS7038 chip. 

    The idea is to get current reading samples constantly, and from time to time send a refresh command for the digital outputs.

    Is there a configuration (Manual, On-the-fly, auto-sequence or autonomous mode) for the SPI to take the shortest possible time?

     I want to make sure that I'm operating this module with the maximum efficiency and take the shortest time for the SPI communications between samples and commands.

    Regards,

    Thank you in advance for your answer.

    Fili.

  • Hello Fili,

    1.  Regarding your objective to " from time to time send a refresh command for the digital outputs".  For Manual, and on-the-fly mode SDI is used to select the channel ID.  For the Auto-sequence mode SDI is set low and not used.  So, regardless of the mode you choose, you will need to stop converting and do a register write (24 bit write) to the GPO value register.

    2.  There are two factors determining how fast your can read ADC conversion results from the ADC.  The first, that you have been focusing on, is the digital communications.  The other factor is the internal sampling mechanism of the device.  From a sampling perspective, you cannot sample this device faster than 1MHz (1M samples / second). 

    3. The digital communications speed is limited by the clock speed and the number of clocks required to transfer data.   The maximum clock for this device is 60MHz.  What frequency will you clock at?

    4. To get a better understanding of the number of clocks required for a conversion result read look at figure 25.  If you are not doing averaging, then 12 bits are required for data and four bits are optional for channel ID.   I recommend that you keep these bits and do a 16 bit transaction for conversion result reads.  You can then use the channel ID to keep track of the channel.  Technically, you could limit the frame size to 12 bits and not receive any feedback on which channel is selected.

    5.  I don't think choosing between, manual mode, on-the-fly, or auto sequence will impact the rate at which you get data.  I think you should choose these modes based on which one looks like it would be easy for you to implement in software.  Personally, I like Auto-Sequence mode.  Her you pre-program the mux sequence and each time you get a conversion result you check the channel ID to confirm which channel the data is associated with.  In the case of manual mode you need to know that the data you are reading is from two conversion ago.  For on-the-fly it is from the previous conversion cycle.

    I hope this summary helps.

  • Hello Kay,

    "So, regardless of the mode you choose, you will need to stop converting and do a register write".

    How do I stop the convertion specially in Manual mode and perform register read and register write. So far, I just continuously receive the convertion data output of the active channel (MANUAL_CHID) no matter the read and the write command I send. I have tried to read the content of the register (0x20) expecting 0xF0 but without success.

    Regards

    Gadoh

  • 1. To write a register use the timing shown in figure 31.

    2. To read a register use the timing shown in figure 32.

    3. To read a conversion result use the timing shown in figure 34.  Check figure 25 for the data format for conversion result reads.

    4. The timing pattern is different depending on which of the above tasks you are trying to accomplish.  If you are not able to successfully able to read a register I suggest that you send me a logic analyzer or scope plot of your measured timing.  I can review it to see if you are using the correct pattern, and if you are violating any timing requirements.

    Sorry for the difficulty you are having.  I hope we can solve the issue soon.