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.

ADS124S08EVM: How to configure the GUI to monitor an external voltage?

Part Number: ADS124S08EVM
Other Parts Discussed in Thread: ADS124S08

I have an external voltage (2.0V) connected to AIN0. How do I configure the GUI so I can monitor this voltage?

  • Hi Tony,

    Welcome to the E2E forum!  The ADS124S08EVM user's guide is a useful tool to help understand the GUI and the various connection options.  When connecting an external voltage to the ADS124S08 there needs to be two connections as the input is differential.  For example 2.0V would connect to the AINP (or AIN0 would be selected for AINP or MUXP in the GUI) of the ADC and the common or ground of the voltage source would need to connect to AGND of the EVM and also connect to a selected AINN input (or shown as MUXN in the GUI).  I would suggest connecting the ground side of the source to J9 (at ACOM) and also connect JP13 to GND.

    In the GUI register map, select AIN0 for MUXP and AINCOM for MUXN in the INPMUX register.  The remaining register settings can use default settings.  To collect data click on the Data Analysis button.  Once the client window opens you can Collect data.  Keep in mind that the default data rate is 20sps and the default samples to collect are 2048 which will take 102 seconds to complete.  Lower to a smaller number of samples if you do not wish to wait that long to see the results.

    Best regards,

    Bob B

  • I would like to use commands to read a data (an external voltage (2.5V) connected to AIN10, and ACOM connected to GND, Vref = 5V, Clock = 4096000Hz). What are the commands should I use? 

  • Actually I would like to use our MCU to read the data and want to know the setup. I do see a command (COLLECT) used in the GUI. Can you please provide the source code for this command?

  • Also I need the source code for COLLECTSETUP command.

  • Hi Tony,

    It is not totally clear to me what you want to do.  There is a script called Voltage Measurement that you can follow and by running the script will setup the voltage measurement.  As a part of the scripting you can also issue the Collect  command which is essentially the same as pressing the collect button in the data analysis.  Information and details on the scripts can be found in the ADS124S08EVM user's guide in section 4.3.2.

    As far as using your own MCU, that will require you to write the firmware and create your own GUI application.  The firmware used on the EVM is very specialized and communicates to the PC using USB_BULK data transfers.  We do not provide source code for either the GUI or the firmware used on the EVM.

    So can you be a little more clear on what you really want to accomplish?  The EVM is not designed for development but rather as a demonstration of the features and capabilities of the ADS124S08. 

    If you want to develop code using the EVM you can do so by disabling the onboard Tiva processor by holding it in a RESET state by installing a jumper at JP1.  You can then make indicated connections on the J3 connector for communication and control of the ADS124S08.

    Best regards,

    Bob B  

  • I have my FW already and I could be able to do register read and write correctly via our MCU. The only thing that I need is the steps (setup) to read the data. I do see your GUI is using COLLECTSETUP and COLLECT commands. I just want to understand those two commands and create a similar functions in my FW.

  • Hi Tony,

    There is nothing special about these two commands.  The COLLECTSETUP informs the firmware that a data collection is about to begin and the firmware returns the how the data being returned is formatted.  For example, conversion data only, status and conversion data, conversion data and CRC, etc..  What is returned is based on the register settings.

    The COLLECT command starts the data collection for the number of samples requested.  What happens here is:

    1. The interrupt monitoring the DRDY pin is enabled.
    2. When the DRDY interrupt is tripped, the RDATA command is sent.
    3. The collected data is transmitted out the USB interface as binary bulk data in the format returned with the COLLECTSETUP command.
    4. Loop back to 2 for the number of samples given in the COLLECT command
    5. Interrupt is disabled

    So there is nothing different that is happening here beside what is discussed in the device datasheet.  DRDY is monitored for a high to low transition, the RDATA command is issued and the result is sent back to the GUI.

    Best regards,

    Bob B

  • Can you please explain the above data pattern for me? I need understand the data pattern first, then I will create a similar command in my FW. Please keep in mind that I am using my FW running in my MCU to control (read/write) ADS124S08 via J3 SPI.  In this case, your GUI and FW are not running. So the EVM USB, COLLECTSETUP and COLLECT commands are not available.

  • Hi Tony,

    It is still not clear to me what you are trying to accomplish.  Are you hoping to use the GUI to collect data?  I need to precisely know your end goal to help get you the result you hope to achieve.

    In short, the COLLECTSETUP and COLLECT commands are specific to a particular device operation.  The COLLECTSETUP command returns a string depending on device configuration.  In other words it is dynamic representing how the binary data will be transmitted after it is collected.  

    These commands having nothing to do with the ADS124S08 operation, but rather only on how data is communicated to the GUI.

    Best regards,

    Bob B

  • As I mentioned that I am using our MCU, and I've already put the jumper wire on JP1 and RST pin on J3 already pulled HIGH. Therefore the GUI and on-board MCU cannot be accessed anymore. What I am trying to do is to collect data using our MCU and my FW via J3 SPI. To do that I need to develop the similar two commands in my firmware. I understood that COLLECTSETUP and COLLECT commands are your GUI/MCU commands. These commands are not directly related to the ADS124S08, but the MCU operation. What I need from you is the detail of COLLECTSETUP and COLLECT so I can create similar code to collect the data.

    As I mentioned before, I have an external voltage 2.5V connected to AIN10 and AINCOM connected GND. By using your GUI, I've already get the ADC reported value = 856564. Now I would like to use our MCU (please forget your GUI and those two commands) and want to know how to get the same value.

    So without using your GUI, what are the steps I need to do to get 856564 data? Something like:

    1. sendCommand(WAKE_OPCODE_MASK)


    3. sendCommand(START_OPCODE_MASK)

    4. and so on

  • Is it clear to you now? Thanks for your support.

  • Hi Tony,

    Where I am still confused is how you think the EVM firmware/GUI commands will help you.  So let's go to the basics.  All of the information specific to operation of the ADS124S08 is in the device datasheet.  There is a section 10.1.6 with a pseudo code example which discuss device startup, configuration and data collection.  If you take that basic information you should be able to convert to your code loop.  I will skip down from the reset section as the device will power up and properly reset once all the supplies are at nominal operating voltage.  All SPI commands are shown in Table 24 of the datasheet.

    1. Write the respective register configuration with the WREG command.  Here you need to write to each register that you wish to be different from the default values.  Your example of regWrite(INPMUX_ADDR_MASK, ADS_P_AIN10 + ADS_N_AINCOM) would be appropriate.  What happens in the regWrite function is the WREG command is issued as SPI data 0x41 (register write command starting at register 1) 0x00 (write one register) 0xAC (AIN10 for AINP and AINCOM for AINN).
    2. For verification, read back all configuration registers with the RREG command.  This would be similar using regRead(INPMUX_ADDR_MASK) function where the SPI communication is 0x21 (RREG command starting at register 1) 0x00 (read one register) and 0x00 (NOP byte to retrieve register contents).
    3. Send the START command (08h) to start converting in continuous conversion mode.  Issue the sendCommand(START_OPCODE_MASK) which is just transmitting the byte via SPI of 0x08.
    4. Loop {
      1. Wait for DRDY to transition from high to low.
      2. Issue a function command for dataRead().  This function consists of the RDATA command. The SPI transfer is 0x12 (the RDATA command) followed by the NOPs for the number of bytes read.  Conversion data is 3 bytes (24-bits MSB first).  If STATUS is enabled the STATUS byte comes first followed by the conversion data.  If CRC is used, the CRC byte is transmitted following the conversion data.  So if just the conversion result is read from the ADC issue via SPI 0x12 (RDATA command) 0x00 0x00 0x00 (which is 3 bytes of NOPs to retrieve the data.  Refer to figure 91 of the ADS124S08 datasheet.}

     * Read the last conversion result
    int dataRead(uint8_t *dStatus, uint8_t *dData, uint8_t *dCRC)
    	uint32_t dataRx[5];
    	uint8_t status;
    	uint8_t crc;
    	if((registers[SYS_ADDR_MASK] & 0x01) == DATA_MODE_STATUS)
    		status = xferWord(0x00);    // xferWord is a byte transfer via SPI
    		dStatus[0] = status;
    	// get the conversion data
    	dataRx[0] = xferWord(0x00);     // xferWord is a byte transfer via SPI 
    	dataRx[1] = xferWord(0x00);     // xferWord is a byte transfer via SPI
    	dataRx[2] = xferWord(0x00);     // xferWord is a byte transfer via SPI
    	dData[0] = dataRx[0];
    	dData[1] = dataRx[1];
    	dData[2] = dataRx[2];
    	if((registers[SYS_ADDR_MASK] & 0x02) == DATA_MODE_CRC)
    		crc = xferWord(0x00);       // xferWord is a byte transfer via SPI
    		dCRC[0] = crc;
    	// sign extend
    	return ((int)(  // data shifted up by an extra 8 bits so downshift sign-extends.
    		((dataRx[0] & 0x00FF) << 24)
    		| ((dataRx[1] & 0x00FF) << 16)
    		| ((dataRx[2] & 0x00FF) <<  8)
    		)) >> 8;

    Best regards,

    Bob B

  • My firmware is working fine now. I could be able to get the same value as GUI reported (856564)