ads1100 16-bit adc

Adrian62

New Member
Hi

Anybody had trouble with the ads1100 adc....can only read up to 12 bit when I was hoping to get to 15 bit reading. tried playing with configuration byte but with no success. Any help appreciated.
 

sghioto

Senior Member
Adrian62
I don't have any experience with this A/D converter but I am interested in your application of this device. What are you using it for and is it controlled by a Picaxe chip? I have a 10 bit data logger using the 18X storing to an external eeprom. I would like to have 12 bit resolution and wonder if this chip would fill the bill.

Steve Ghioto
 

kranenborg

Senior Member
Just want to mention that 16-bits accuracy is an awful lot and may in practice not be usable and requires extreme signal conditioning, both at the input as well as the line between the ADC and the sensor. The boundary probably lies somewhere with 11-12 bits. For some inspiration you may look at Jeremy Leach's implementation of a pressure reader ( http://home.btconnect.com/PicAxe_Projects/WeatherMonitor/WeatherMonitor.htm ), where he initially planned for 12 bits but later turned to 10 bits + amplifying circuit. Note that you may also use an MCP3221 as an 12bit ADC alternative with i2c.

/Jurjen
 

demonicpicaxeguy

Senior Member
the mcp3301 is a bad one to use it's a 13 bit adc works nicely with the picaxe and it's fairly straightforward haven't used it in a long while
 

hippy

Ex-Staff (retired)
Whether 16-bits is useful or not, you should be able to read 16-bits ( 15 for positive FSD ) and I cannot see why it's not working. If the input voltage is in the right ball-park to give near 15-bit FSD either the Data Rate or PGA settings are wrong. It may be worthwhile posting our code, and also worth trying this having powered the ADC off and then on ( the defaults should be okay after reset ) ...

Code:
I2cSlave %1010???0,i2cslow,i2cbyte
Do
  I2cRead(b3,b2,b0)
  SerTxd("ST=",#bit7)
  SerTxd(" SC=",#bit4)
  SerTxd(" DR=",#bit3,#bit2)
  SerTxd(" PG=",#bit1,#bit0)
  SerTxd(" AD=",#w1,CR,LF)
Loop
 

Adrian62

New Member
Thanks your input has got me a bit further with my project, variometer for a model glider.
Using your code I was able to prove the ADC was working as I had doubts, have to admit not entirely sure how your code works, will have a closer look later!

Here is the code as I had it.

i2cslave %10010000, i2cslow, i2cbyte
writei2c %10010000, (%10001100)

do
readi2c %10010000, (b0,b1,b2)
w5=b0*255+b1
debug
loop


Code that now works.

i2cslave %10010000, i2cslow, i2cbyte
i2cwrite(%10001100)

do
i2cread(b0,b1,b2)
w5=b0*255+b1
debug
loop

I was following guidance from the help files and a book.

Thanks again for your help.
 

Adrian62

New Member
Adrian62
I don't have any experience with this A/D converter but I am interested in your application of this device. What are you using it for and is it controlled by a Picaxe chip? I have a 10 bit data logger using the 18X storing to an external eeprom. I would like to have 12 bit resolution and wonder if this chip would fill the bill.

Steve Ghioto
Hi Steve

I am using this ADC for a variometer in a model glider and intend to use it with an 18X. The ads1100 is now working nicely seems very stable and is giving 15 bit resolution, the chip is very cheap and uses i2c.
 

hippy

Ex-Staff (retired)
readi2c %10010000,(b0,b1,b2) versus readi2c(b0,b1,b2), that's the difference.

In the first form the %1001000 is an address ( the device ID being mistakenly used here ) when the ADC doesn't need an address. The first form is primarily for memory type I2C devices.
 

Adrian62

New Member
readi2c %10010000,(b0,b1,b2) versus readi2c(b0,b1,b2), that's the difference.

In the first form the %1001000 is an address ( the device ID being mistakenly used here ) when the ADC doesn't need an address. The first form is primarily for memory type I2C devices.
How would it work if I were to use two of these ADCs with different i2c addresses and wanted to read them?
 

hax

New Member
You can't change the ADC addresses on these chips. You have to buy a different series in the range. There are 7 addresses that you can choose when purchasing the chip which are set in factory. Otherwise they function exactly the same.

See attached datasheet on page 2 for the addresses available.
 

Attachments

hippy

Ex-Staff (retired)
@ Adrian62 : As Haxby says above. Issue a new I2CSLAVE command with the Device Address to specify which ADC you want to read from then issue a READI2C.
 

BCJKiwi

Senior Member
You've not indicated which PICAXE is being used. If it is an X1 then the Hardware i2c is recommended.

Once one i2cslave (or on the X1s one hi2csetup) command has been issued, you should only need to specify the address with the read or write thereafter.

The following code for an 28X1 configures 4 different MCP23017 I/O expanders each with their own address.
Code:
symbol IO_0  = %01000000   '#0 Microchip MCP23017 I/O expander i2c address
symbol IO_1  = %01000010   '#1 Microchip MCP23017 I/O expander i2c address
symbol IO_2  = %01000100   '#2 Microchip MCP23017 I/O expander i2c address
symbol IO_3  = %01000110   '#3 Microchip MCP23017 I/O expander i2c address
 
'MCP23017 on 28X1 @ 16Mhz using Hardware i2c Replace hi2csetup master with i2cslave on non X1 PICAXE
 hi2csetup i2cmaster,IO_0,i2cslow_16,i2cbyte
  '[IO_0] %0100 0  0  0  0 is the address with A0,A1,A2 all tied to 0V
 hi2cout [IO_0],0,($00,$00)   'IODIRA,IODIRB set port direction register to output
 hi2cout 8,($00,$00)     'IOCON0 Active driver output, Active Low - i.e sinks.
 hi2cout $12,(%11111111,%11111111) 'turn off all the LEDs (output High)
 hi2cout [IO_1],0,($00,$00)   'IODIRA,IODIRB set port direction register to output
 hi2cout 8,($00,$00)     'IOCON0 Active driver output, Active Low - i.e sinks. 
 hi2cout $12,(%11111111,%11111111) 'turn off all the LEDs (output High)
 hi2cout [IO_2],0,($00,$00)   'IODIRA,IODIRB set port direction register to output
 hi2cout 8,($00,$00)     'IOCON0 Active driver output, Active Low - i.e sinks.  
 hi2cout $12,(%11111111,%11111111) 'turn off all the LEDs (output High)
 hi2cout [IO_3],0,($00,$00)   'IODIRA,IODIRB set port direction register to output
 hi2cout 8,($00,$00)     'IOCON0 Active driver output, Active Low - i.e sinks.  
 hi2cout $12,(%11111111,%11111111) 'turn off all the LEDs (output High)
But a susequent write only needs;
- command [address],register,(data,data)
Code:
hi2cout [IO_0],$12,(b4,b5)
hi2cout [IO_3],$12,(%11111111,%11111111)
 
Last edited:

Adrian62

New Member
You can't change the ADC addresses on these chips. You have to buy a different series in the range. There are 7 addresses that you can choose when purchasing the chip which are set in factory. Otherwise they function exactly the same.

See attached datasheet on page 2 for the addresses available.
Thanks Haxby
still having a problem getting my head around the address byte, if you omit the address byte how do you access the configuration byte on a different adc.
I had the same problem as you, where I couldn't change the parameters until I got rid of the address byte. I would be interested to know what you are using your adc for?
 

hax

New Member
To write to another chip, you need to use the i2cslave command with the new address, new bus speed, and address size.

This command essentially sets up the picaxe with the new info.


I'm using it to accurately detect the light level coming from a photodiode. Some photos here http://www.picaxeforum.co.uk/showthread.php?t=8953

I was using a MAX195 (SPI interface) but I found that it was sensitive to varying clock frequencies, and required a constant clock source.

The ADS1110 is working out to be exceptionally stable. I am using a precision 5V reference IC (MAX 6250), and the fluctuations are around one LSB which is fantastic.
 

BCJKiwi

Senior Member
As per post #12, if you set them all up once at the beginning of the program, then you only need the address byte subsequently to refer to the device to be communicated with.
 

marky26uk

New Member
ads1100

Hi Adrian, your code:-
i2cslave %10010000, i2cslow, i2cbyte
i2cwrite(%10001100)

do
i2cread(b0,b1,b2)
w5=b0*255+b1
debug
loop

I got mine working but looking at debug b0 & b1 changes but b2 doesn't.
What is the variable b2 used for ?

Cheers,
Mark
 

hippy

Ex-Staff (retired)
@ Mark : b2 is the confirmation of how the ADC has been configured. It won't change on each read.

Also, "w5=b0*255+b1", that 255 should be 256, but your code can be improved even further by -

- i2cread(b1,b0,b2)
- debug

The word variable 'w0' is 'b1:b0' so you can simply use 'w0' as the 16-bit ADC result.
 
Top