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.

How to read ADC ADS7230 correctly

Other Parts Discussed in Thread: ADS7230

1ello,

I'm using ADS7230 with the following

Our init procedure

2) Config with internal clk and no TAG bit

            Assert CS

            Send 16-bit data 0xe4FD with 16 clks

            De-assert CS

 

2) Select channel to read

            Assert CS

            Send 4-bit channel number (0 or 1) with 4 clks

             De-assert CS           Assert CS

  3) Read converted result

            Assert CS

            Send 4-bit command 0xD with 4 clks

            Capture 12-bit data with 12 clks as converted result

            De-assert CS           Assert CS

 

The read data were not matched with voltage measurement, from 4 to 8 times larger

What's wrong with my Init or My Reading ?

Thanks,

~Duy-Ky

  • Hi Duy-Ky,

    Are you always going between channel 0 and 1 on the ADS7230?  If so, there is no need to send the READ DATA command along with the 4-bit channel selection command.  If you want to ping-pong between the two channels, simply write 0x0000 and 0x1000 - the ADS7820 assumes your intention is to read data, so the conversion results (starting with the MSB) are output starting with the first SCLK applied to the chip.  If you want to sample multiple conversions from CH0 and then switch to CH1, you can do the four-bit channel select command followed by 0xD000 to 'read data' - your MSB is going to be present with the first applied SCLK.

  • Hello Tom,

    It's still NOT working for me.

    I have some questions below

    1) For configuration, I have ONLY one setup with

       1.a) Assert CS

       1.b) Send out 0xE4FD along with 16 clocks

       1.c) De-assert CS

    2) For data read, I have tried 2 different ways :

       2.a) Single operation with ONLY one CS activatyion

          2.a.1) Assert CS

          2.a.2) Send out Channel_Id ( 0 or 1) with 4 clocks

          2.a.3) Capture Data Read with 12 clocks

          2.a.4) De-assert CS

     >>  I got data read 0 for both channels !?!?

       2.b) Two operation with 2 CS aqctivations

         2.b.1) Assert CS

          2.b.2) Send out Channel_Id ( 0 or 1) with 4 clocks

          2.b.3) De-assert CS

         2.b.4) Assert CS

          2.b.5) Capture Data Read with 12 clocks

          2.b.6) De-assert CS

     >>  I got data read 0x8000 for both channels !?!?

    So, what's wrong with my procedure ?

    Thanks, Tom

    ~Duy-Ky

  • Hi Duy-Ky,

    What is happening with the EOC/INT pin?  The 0xE4FD you write to the CFR is setting the device up to do Manual Channel select and Auto Trigger mode with TAG disabled.  Try running with Manual Channel select and Manual CONVST instead, or Auto Channel and Auto Trigger.  How fast is your SCLK?  A scope shot of your control lines would be very helpful here as well.   

  • Hello Tom,

    Per the schematic, the HW engineer left 2 pins opened : EOC and #CONVST

    So, per datasheet, I guessed the conversion started once I send 4-bit channel number ?

    Is there anything wrong with those 2 pins above ?

    Thanks so much, Tom

    ~Duy-Ky

  • Hi Duy-Ku,

    Is CONVST open or pulled high?  If you don't actively control CONVST, you force yourself to use Auto Trigger mode, in which case you should also use Auto Ch select with TAG enabled (see note1 under Table 1).  If CONVST is floating (open) this might be the cause of your frustration.  Please review Figure 3 in the data sheet - CONVST should be logic 1 (high) when using Auto Trigger mode.

  • Hello Tom,

    Yes, we missed the pin CONVST.

    Now the pin is tied DIRECTLY to +5V

    Now I use data 0xCFFF to set config for Auto Trigger, Auto-Channel and TAG bit enable

    I have the procedure below to read data

    1) Assert CS

    2) Send Read Cmd 0xD along with 4 clks

    3) Read Data with 13 clks, extra clk for TAG bit

    4) De-assert CS

    It's still NOT working for me. For many read in a row, I still get the same data 0x0180, instead of switching from 1st channel to the 2nd one

    This value of 0x0180 or 384 might be for input voltage 344 mV I measured, while the other channel is at 3 mV

    So, what's wrong with my procedure

    I attached my scope shot for your reference. It's a PDF, let me know if you're not able to get the file

    Thanks so much, Tom

    ~Duy-Ky

    6215.ADC ADS7230.pdf

  • Hi Duy-Ky,

    What is the time scale in your scope plots?  Can you also describe how the BUSY output reacts?  Please note that you must send at least 17 SCLKs to get the TAG bit out of the ADS7230 device.  This is described in Table 6 on page 36 of the data sheet. 

  • Hi Tom,

     The timescale is 200 uS.

    It works for me now with the setting 0x4FD, ie my very first setting

    • Manual Channel,
    • Auto-Trigger,
    • no TAG bit

    I have to do RESET first then take it out of reset in order to make it work properly

    Thanks so much for your great support, Tom

    ~Duy-Ky

  • Great news Duy-Ky!

    I'm happy to hear that you've got the issues resolved.  Let us know if there is anything else we can help out.

  • Hello Tom,

    I still have problem with ADS7230.

    Before the converted data did not stay with the right channel.

    That problem is gone, but a new problem is the converted data are NOT matched with the measured voltage

    Channel 0 : measured  402 mV -> read around 2352

    Channel 1 : measured 396 mV -> read around 2176

    The results are about more than 5 times than measurements. They are still not correct even I shift 2 bits (divide by 4) !?!?

    What I did were

    1) Tie CONVST directly to 5 V : Is it correct ?

    2) Set config 0x4FD (Manual Channel, Internal CCLK, Auto Trigger, NO TAG bit

    3) I tried both ways and got the same results

       3.a) Single operation : Set channel and read result : I have to do at least 3 times to get right result for right channel

        3.b) Two operation

             3.b.1) Set Channel first

             3.b.2) Send READ op 0xD and read data : I also have to do at least 3 times to get right data for right channel

    Any idea what went wrong

    Thanks, Tom

    ~Duy-Ky

  • Can I get updated screen captures and raw conversion data?

  • Hi Tom,

    Attached is screen capture for Read Config as 0x04FD as expected in setting and 5 Reads of Channel 1 with measurement of about 396 mV, but read about 0x900 - 2304 mV

    Thanks, Tom

    ~Duy-Ky

    1185.ADC ADS7230a.pdf