Using the ADS7828 with the Beagleboard

Hi,
Does anyone have experience of using an ADC based on the ADS7828 chip?

I have connected an ADC module to the I2C port and when I run
i2cdetect I see a new device at location 0x48. The thing is the
ADS7828 datasheet and the module documentation both say that the
default device address is 0x90. Which seem to be a bit shift for 0x48.
What is not clear is how to read the internal device registers? Does
the device only have 2 bytes to read which are always the result of
the last conversion for the last channel requested or can the request
of all the channels be read in one go?

It would be useful if anyone could give some guidance.

     Ernie

Hi Ernie,

Le 15/11/2011 15:25, Ernie a �crit :

Does anyone have experience of using an ADC based on the ADS7828 chip?

I have connected an ADC module to the I2C port and when I run
i2cdetect I see a new device at location 0x48. The thing is the
ADS7828 datasheet and the module documentation both say that the
default device address is 0x90. Which seem to be a bit shift for 0x48.
What is not clear is how to read the internal device registers? Does
the device only have 2 bytes to read which are always the result of
the last conversion for the last channel requested or can the request
of all the channels be read in one go?

It would be useful if anyone could give some guidance.

add this to your board 's i2c_board_info (the one concerning the i2c bus which is connected to your ADS7828) :
  {
    I2C_BOARD_INFO("ads7828", 0x48),
  },

Enable ads7828 driver in the kernel (CONFIG_SENSORS_ADS7828=y), compile/install the kernel and you will get access to the ADC values in /sys/class/hwmon/hwmonX/device/ where you can read the 8 input using "cat in*input"

Eric

Hi Eric,
  Thanks for your replay. So what you seem to be saying is that the
only way I can access the ADS7828 is by rebuild the kernel. The image
I am using was created by Robert Nelson, so building a kernel is not
something I have tried yet. Can I not access the ADS7828 by using the
I2C ports directly? This is what I was trying to do, but was a bit
confused by the datasheet for the device.

  Ernie

You might take a look at the driver, ads7828.c, in drivers/hwmon. It
looks like a pretty simple driver, and between datasheet and looking
at how the driver gets information from the device, you should be able
to figure out how to do this from user-space if you want. Also the
driver does have a detect method, so you can try to do a modprobe
ads7828 and if the driver is built then it will load and it should
detect the device. If the driver isn't built, you can try building it
yourself and then doing an insmod ads7828.ko. I haven't tried using
Robert Nelson's kernels in some time, but I seem to recall that he had
some scripts that could allow you to build a custom version of his
kernels.

Good luck,
Greg