Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

I2C device at address
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: I2C device at address

by adafruit_support_carter on Tue May 26, 2020 6:45 pm

That guide is referencing a deprecated library. It has been replaced by this one:
https://github.com/adafruit/Adafruit_Ci ... on_ADS1x15
which can be installed from pypi:
https://learn.adafruit.com/adafruit-4-c ... -2997261-8
and also requires Blinka:
https://learn.adafruit.com/circuitpytho ... rypi-linux
for use on RPi.

FWIW, the Seeed product page links to this for software to be used with the Seeed board:
https://github.com/Seeed-Studio/pi-hats

adafruit_support_carter
 
Posts: 16820
Joined: Tue Nov 29, 2016 2:45 pm

Re: I2C device at address

by tultalk on Tue May 26, 2020 9:29 pm

boot/overlays contains ads1015.dtbo and ads1115.dtbo both dated 2/1620 which is when I installed adafruit software. (git)

Can I just delete these two files? NO. I moved them to another directory and no boot wireless.

I guess if the config for device tree overlays (which listed these) stops boot if can't find the files. Back to blacklisting (I guess).

Don't understand why the conflict is generated.

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Re: I2C device at address

by tultalk on Wed May 27, 2020 11:29 am

adafruit_support_carter wrote:That guide is referencing a deprecated library. It has been replaced by this one:
https://github.com/adafruit/Adafruit_Ci ... on_ADS1x15
which can be installed from pypi:
https://learn.adafruit.com/adafruit-4-c ... -2997261-8
and also requires Blinka:
https://learn.adafruit.com/circuitpytho ... rypi-linux
for use on RPi.

I have that all installed and that is what I am trying to use.

FWIW, the Seeed product page links to this for software to be used with the Seeed board:
https://github.com/Seeed-Studio/pi-hats


There is NO sogtware to be used like the Adafruit libraries.

The Device Tree Overlays with my Raspberry Pi 2 B contain the overlays for the TI chips 1015 and 1115 and are loaded automatically
at start up. Thus the UU at 48 and the source of the problem when trying to access the ADC through i2c 0x48. That address is busy since the ads1015 is already loaded. So I don't understand how your breakout board does not face the same problem since the Overlay has nothing to do with the Adafruit breakout board. Your example of 0x48 (uu) makes no sense to me since that loading is a function of the RB booting. I don't know what kind of RB that is in your image but perhaps that one does not have the overlay. If your product looked like the Seeed one and had address jumpers (Which seeed does not) I would have bought yours.

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Re: I2C device at address

by tultalk on Wed May 27, 2020 11:47 am

The board I am using with the Adafruit software works fine if I rmmod ads1015 before running:

| Raw-A0 | Volts | Raw-A1 | Volts | Raw-A2 | Volts | Raw-A3 | Volts |
------------------------------------------------------------------------
| 3614 | 0.452 | 7261 | 0.908 | 10894 | 1.362 | 14551 | 1.819 |
| 3615 | 0.452 | 7262 | 0.908 | 10894 | 1.362 | 14551 | 1.819 |
| 3614 | 0.452 | 7262 | 0.908 | 10894 | 1.362 | 14551 | 1.819 |
| 3614 | 0.452 | 7262 | 0.908 | 10893 | 1.362 | 14551 | 1.819 |
| 3614 | 0.452 | 7261 | 0.908 | 10893 | 1.362 | 14550 | 1.819 |
| 3614 | 0.452 | 7262 | 0.908 | 10894 | 1.362 | 14551 | 1.819 |
| 3614 | 0.452 | 7262 | 0.908 | 10894 | 1.362 | 14550 | 1.819 |
| 3615 | 0.452 | 7261 | 0.908 | 10894 | 1.362 | 14551 | 1.819 |
| 3615 | 0.452 | 7262 | 0.908 | 10893 | 1.362 | 14551 | 1.819 |
| 3614 | 0.452 | 7261 | 0.908 | 10893 | 1.362 | 14551 | 1.819 |


#!/usr/bin/env python3

# Simple demo of reading each analog input from the ADS1x15 and printing it to
# the screen.
# Author: Tony DiCola Modified 5/20/2020 R Tulloch
# License: Public Domain
import time
import board
import busio
from adafruit_ads1x15.analog_in import AnalogIn
import adafruit_ads1x15.ads1115 as ADS

i2c = busio.I2C(board.SCL, board.SDA)
logfile = "ASD1115.log"

# Choose a gain of 1 for reading voltages from 0 to 4.09V.
# Or pick a different gain to change the range of voltages that are read:
# - 2/3 = +/-6.144V
# - 1 = +/-4.096V
# - 2 = +/-2.048V
# - 4 = +/-1.024V
# - 8 = +/-0.512V
# - 16 = +/-0.256V
# See table 3 in the ADS1015/ADS1115 datasheet for more info on gain.
GAIN = 1

'''
Sample Rates
8
16
32
64
128
250
475
860
'''

adc = ADS.ADS1115(i2c, GAIN, 128)

# Or create an ADS1015 ADC (12-bit) instance.

print('Reading ADS1x15 values, press Ctrl-C to quit...')
# Print nice channel column headers.
print('| {0:>5} | {1:>5} | {2:>5} | {3:>5} | {4:>5} | {5:>5} | {6:>5} | {7:>5} |'.format("Raw-A0","Volts","Raw-A1","Volts","Raw-A2","Volts","Raw-A3","Volts"))
f = open(logfile, "w")
f.write('| {0:>5} | {1:>5} | {2:>5} | {3:>5} | {4:>5} | {5:>5} | {6:>5} | {7:>5} |'.format("Raw-A0","Volts","Raw-A1","Volts","Raw-A2","Volts","Raw-A3","Volts"))

f.write("\n")
f.close()
print('-' * 72)
f = open(logfile, "a")
f.write('-' * 72)
f.write("\n")
f.close()

# Main loop.
j = 0
R = True
while True:

# Read all the ADC channel values in a list.
valueRead = [0]*8
for i in range(4):

# Read the specified ADC channel using the previously set gain value and sampling rate.
chan = AnalogIn(adc, i)
#Extract the raw va;ue and voltage to the respective stores
valueRead[j] = chan.value
j = j + 1
valueRead[j] = chan.voltage
j = j + 1
if j > 7 :
j = 0

# Print the ADC values.
print('| {0:>5.0f} | {1:>5.3f} | {2:>5.0f} | {3:>5.3f} | {4:>5.0f} | {5:>5.3f} | {6:>5.0f} | {7:>5.3f} |'.format(*valueRead))
f = open(logfile, "a")
f.write('| {0:>5.0f} | {1:>5.3f} | {2:>5.0f} | {3:>5.3f} | {4:>5.0f} | {5:>5.3f} | {6:>5.0f} | {7:>5.3f} |'.format(*valueRead))
f.write("\n")
f.close()
# Pause for half a second.
time.sleep(0.5)
#f.close()

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Re: I2C device at address

by tultalk on Thu May 28, 2020 1:01 pm

Incomprehensible in my small mind:
config.txt
[all]
#dtoverlay=vc4-fkms-v3d
gpu_mem=76
enable_uart=0
#dtoverlay=ads1115

tultalk
 
Posts: 24
Joined: Thu May 14, 2020 7:00 pm

Please be positive and constructive with your questions and comments.