Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ADS115 configuration

Status
Not open for further replies.

John99407

Junior Member level 3
Junior Member level 3
Joined
Jul 14, 2019
Messages
26
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
240
I am trying to understand datasheet ADS1115 to read analog input.

Slave address = 0x 90

Page 25, Pointer register set config register or conversation register.

I do not understand which one config or conversation register need to configured to read the analog input.
 

Attachments

  • ADS1115_Datasheet_pdf_06192018114623.pdf
    1.4 MB · Views: 351

Hi,

Please re read section 10.1.7
Tell us what you understand and what is unclear.

Klaus
 

    John99407

    Points: 2
    Helpful Answer Positive Rating
Also section 9.5.3 which details the sequence for writing and reading.

Like many devices that have several internal registers, there is an intermediate step you have accomplish. Rather than each register having a different I2C address, which would use up many of the available combinations, the device contains its own pointer to internal registers. You address the device, then the internal register then transfer the data to/from where the internal register points to.

Brian.
 

    John99407

    Points: 2
    Helpful Answer Positive Rating
Hi,

Please re read section 10.1.7
Tell us what you understand and what is unclear.

Klaus
There are four internal register of ads1115. I know pointer register set config and conversation register.

I want to use continues mode.

In figure 31 I dot understand what are the data byte 1 and data byte 2?
 

Hi,

1 byte = 8 bit
ADC result = 16 bit = 2 bytes = HIGH byte + LOW byte

Klaus
 

Hi,

1 byte = 8 bit
ADC result = 16 bit = 2 bytes = HIGH byte + LOW byte

Klaus

In Datasheet It say two sequence need to write config and address pointer register

ADS1115_config.jpg


Will the sequence be like this

ADS111_Write
I2C_Start();
I2C_Write(1001000 + 0 ); // 7-BIT_Slave_Address + WRITE_BIT
ACK recived
I2C_Write(000000001); // Points to Config register
ACK recived
I2C_Write(10000100); // MSB of the Config register to be written)
ACK recived
I2C_Write(10000011); // LSB of the Config register to be written)
ACK recived Last byte
I2C_Stop();

ADS111_Write
I2C_Start();
I2C_Write(1001000 + 0 ); // 7-BIT_Slave_Address + WRITE_BIT
ACK recived
I2C_Write(000000000); // Points to Config register
ACK recived, Last byte
I2C_Stop

ADS111_Read
I2C_Start();
I2C_Write(1001000 + 1 ); // 7-BIT_Slave_Address + READ_BIT
ACK recived
I2C_Restart();
data = I2C_Read(MSB); // MSB of the Conversion register
ACK recived
data <<= 8;
data += I2C_Read(LSB); // LSB of the Conversion register
Last Byte
I2C_Stop

End
 

Hi,

first write looks O.K.
second write looks O.K.

but wiht the read there is an issue:
Mind: after every START or RESTART the next byte is: saleve_address + R/W.
thus you need to omit the RESTART.
then it should work.

Did you try? What´s the result?

Mind that "data" needs to be declared as UINT16.


Klaus
 
Hi,

first write looks O.K.
second write looks O.K.

but wiht the read there is an issue:
Mind: after every START or RESTART the next byte is: saleve_address + R/W.
thus you need to omit the RESTART.
then it should work.

Did you try? What´s the result?

Mind that "data" needs to be declared as UINT16.


Klaus

Yes almost done but there are some issue that have to be resolved. I will post code when its ready for testing

Is this write sequence is possible ? There is only one start and stop in this sequence

Main
ADS111_Write
I2C_Start();
I2C_Write(1001000 + 0 ); // 7-BIT_Slave_Address + WRITE_BIT
ACK recived
I2C_Write(000000001); // Points to Config register
ACK recived
I2C_Write(10000100); // MSB of the Config register to be written)
ACK recived
I2C_Write(10000011); // LSB of the Config register to be written)
ACK recived, Last byte
I2C_Write(000000000); // Points to Config register
ACK recived, Last byte
I2C_Stop

ADS111_Read
I2C_Start();
I2C_Write(1001000 + 1 ); // 7-BIT_Slave_Address + READ_BIT
ACK recived
data = I2C_Read(MSB); // MSB of the Conversion register
ACK recived
data <<= 8;
data += I2C_Read(LSB); // LSB of the Conversion register
Last Byte
I2C_Stop
End
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top