Go Down

Topic: Can't get any reading from 24-Bit ADS1232 other than 255? (Read 160 times) previous topic - next topic

evilgoatee

Hey all, I'm fairly new to Arduinos and am trying to wire this 24-bit ADC to a Pro Micro.

I found this library to use but I think I have it wired up incorrectly.

Here's the sketch:
Code: [Select]

    #include <ADS1232.h>
   
    #include <SPI.h>
    #define SPI_SCK     15
    #define SPI_MISO    14
   
    #define SCALE_CS     7
    #define SCALE_PDWN   2
    #define SCALE_GAIN0  0
    #define SCALE_GAIN1  1
    #define SCALE_SPEED  3
    #define SCALE_A0     4
    #define SCALE_TEMP   5
   
    ADS1232 scale_adc(SCALE_CS, SPI_MISO, SCALE_PDWN, SCALE_GAIN0, SCALE_GAIN1, SCALE_SPEED, SCALE_A0, SCALE_TEMP);
   
    void setup() {
      Serial.begin(9600);
      SPI.begin();
      scale_adc.init(ADS1232::GAIN1, ADS1232::FAST);
    }
   
    void loop() {
      int32_t scaleval;
      scaleval = scale_adc.read();
      Serial.println(scaleval);
    }


The Pro Micro pin out says pin 15 is SPI SLCK and pin 14 is SPI MISO, and those are going to the SCLK and DOUT pins of the ADC respectively. So, I think those are correct. the "SCALE_" pins are all going to the same-named pins on the ADC *EXCEPT* for SCALE_CS, I'm not sure where that goes and I can't seem to get any different behavior from various pins or unwired.

So, with that out of the way, When I run the sketch all I get is 255. So I'm not sure what exactly is wrong.

Any help is greatly appreciated.

Koepel

That is so confusing.
The chip is confusing. That library is confusing (far too complicated for a ATmega32U4 chip).
All that is needed is checking if data is ready and then 24 clock pulses.

You can try another library, that is known to work with the ATmega32U4: https://github.com/hiveeyes/arduino/tree/master/libraries/ADS1231.
Start with the example that comes with that library.
That library is still not easy, it uses direct I/O instructions for faster signals. But you can use any digital pins, and it will still be fast.

horace

this does not look like an SPI device - look under  DATA RETRIEVAL in the device datasheet under Technical Documents in
http://www.ti.com/product/ADS1232

your code has to clock the data in by pulsing a digital pin and reading the corresponing data pin

if you look at the ADS1231.cpp code in library mentioned by @Koepel in post #1  you will how this is done
https://github.com/hiveeyes/arduino/tree/master/libraries/ADS1231

Go Up