1
\$\begingroup\$

I am trying to hook up an ADCeh8b1 to a Raspberry Pi 3 via SPI to convert some readings from an analog sensor. I've been changing around my code and my hardware connections for a few days now without much success.

Based on the manual for the adc (http://www.datasheetlib.com/datasheet/1004614/adc-eh8b1_datel.html) I assumed the start conversion pin is for CS. I cannot figure out what the end of conversion pin connects to: MOSI or CS?

Apart from that I only get readings of 255 from the ADC once the serial out is connected to the MISO pin and disconnecting the sensor does not seem to affect this reading.

Can anyone spot the issue?

\$\endgroup\$

1 Answer 1

1
\$\begingroup\$

Reading the datasheet, I see an important thing - this chip is not SPI! For one thing, the clock is an output from the chip, not an input. You might be able to make it work if you can configure your micro as an SPI slave device but it cannot work if the micro is master.

If you do run as slave, it would work as follows:

  1. You need a GPIO to pulse Start Convert to start the communications.
  2. EOC connects to the micro’s CS. However, this is positive logic where SPI CS is normally negative logic.
  3. The Clock connects to your clock input.
  4. The Serial Output would connect to MISO
  5. MOSI is unconnected.

I really suggest you find a different ADC that interfaces as a proper SPI slave.

\$\endgroup\$
2
  • \$\begingroup\$ Thanks for the quick response. Just to clarify. In 2, is there a way to correct this issue? Also what would my clock input be on the Pi? Just ordinary GPIO? \$\endgroup\$ Commented Oct 21, 2017 at 17:19
  • \$\begingroup\$ I’m not familiar enough with the Pi to say for sure. There may be a register setting for the CS polarity. The clock should be connected to the SPI clock pin on the Pi. If it is configured as slave, it should become an input. \$\endgroup\$
    – DoxyLover
    Commented Oct 21, 2017 at 19:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.