High Speed ADCs and Interfacing with Texas Instruments ADS8321

I needed a high speed ADC for sampling in cylinder pressure for my ECU, and settled on trying a few from Texas Instruments. I am using an optical encoder on the engine which provides 720 pulses per revolution . If I took a sample every pulse, then at 6000 RPM (100 Hz) then I would be looking at about 720 * 100 Hz = 72,000 Samples per Second (SPS) or 72kHz ( although I realise now that I could take a sample on each edge, resulting in 1440 samples per revolution, or 144,000 SPS). That’s pretty high speed, considering most ADCs built into microcontrollers take a few microseconds to perform their conversion which results in a sampling rate of perhaps up to 50,000 SPS max for the Arduino for example. DSP chips or higher end micros probably have better performance, but for the sake of learning, I fancied trying to use an external ADC anyway.

8 MSOP breakout


So, I began a search for some suitable ADCs. Texas Instruments provide free small samples, so that was a good place to start looking. ADCs do range into the Gigahertz, so my application is realistically not mega high speed, but still higher than the lowest end chips. The problem with the higher speed is not only expense, but apparently increased complexity resulting in much smaller packages which make it difficult to solder. In the end, I was somewhat limited more by the package type than anything else, since I didn’t fancy soldering a 64-TQPF. I was aiming for at least 100 kSPS, and as high an accuracy as possible in the largest package. In the end I ordered a 16-bit 100kSPS ADS8321 in an 8-MSOP and a 12-bit 0.5 to 1MSPS ADC121S101 in a 6SOT package.

I decided to have a go at soldering the 16-bit 8-MSOP chip first by following this guide, and made a pretty good mess of it. I ended up with a blob of wires, solder and melted sellotape worthy of a nailed it meme. In the end, I found it much easier to just solder each wire on to each leg. Amazingly I didn’t fry the chip in the process, and so hooked up a 50:50 voltage divider over Vss to provide a reference voltage. This chip is a little special since it’s a Bipolar ADC, meaning that it can read values both above and below Vref which would be handy for certain applications, although probably not so much for me. So I then wired it into my Stellaris Launchpad since it’s the fastest (only) dev board I have available, and began looking for a way to interface with it.

Modifying some very helpful code from this thread I managed to actually read some values out of it! The basic protocol is supposed to resemble SPI but of course is slightly non standard, with some additional clock cycles required before the data can be read out (this is the sample period for the ADC). None the less, bitbanging the protocol seems to work, and so I then added a bit of serial communication to a PC client written in Processing and after some debugging, I seem to have some pretty realistic high speed data capture! This is the result of me touching the input wires, apparently I generate some sort of sine wave (tested working on other signals too). I don’t have a signal generator, but will test it a bit more with some micro-controller generated square waves when I find my other box of bits. ADCTest2

I have put the code up on my BitBucket account here.

4 thoughts on “High Speed ADCs and Interfacing with Texas Instruments ADS8321

  1. Daniel Fritz

    Hi
    maybe you can help me along the way.
    i want a hall sensor that measures rpm up to 15000rpm sent to arduino. it is obviously too many impulses in too short a time.
    arduino must then control a servo that changes gears. (cvt gearbox)

    I need it to run sprint with. like a dragster race. (it’s an old moped)
    100 meters from 0 km / h

    so when starting sounds, I release clutch and give full throttle. engine rpm max is about 15,000 so the arduino has to turn the servo + into gear until the engine comes down to 12,750rpm all the way down the track. and vice versa, if the engine gets below 12750rpm then the servo turns – in gear.

    does it make sense to you?

    Reply
    1. Scott Snowden Post author

      Yes, kind of – have you tried using interrupts on the Arduino?

      15,000 RPM is quite fast – but is still only 250Hz, so the micro controller should be able to handle it fine. You are likely to get problems with signal noise.

      I understand what you are trying to achieve, but what problems are you having?

      Reply
  2. Ram Niwas

    hello, sir, I want to measure engine cylinder pressure with Arduino for each cycle
    I am using 360PPr encoder with ABZ pules
    I want to use high-speed ADC (ADS121 12 bit up to 1MSPS)
    I have no idea for this
    pls help me if you have any code for Arduino pls mail to me (dhimanram1280@gmail.com )

    Reply
    1. Scott Snowden Post author

      You should not use an ADC for the encoder – you have digital signals coming from your encoder in the form of ABZ pulses, you should just input them to the microcontroller digital inputs (first check the voltages are compatible! If not you will need a level shifter). The ADC can be used for engine cylinder pressure, but it all depends on what pressure sensor you are using and many other things. My code for the Texas instruments ADS8321 is available here: https://bitbucket.org/SSnowden/texas-instruments-ads8321-interface/src/master/HighSpeed/

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *