BBAI-64 and the ADC onboard...

Hey There,

Me again…is it possible to make sure I am reading the correct current of the ADC from GND or AGND on the BBAI-64? I always thought you guys kept the ADC at 1.8v but I distinctly remember a vague and quick update a while back. It had to do with variable readings from the ADC at various locations on the pin header.

Now, I may be making this up. But, I am sure there was some chat about it.

The reason I am asking is because of the ADC I tested earlier this morning.

Seth

P.S. On the BBAI-64, it seems that AGND (P9.32) and an ADC pin (P9.33) reads negative while the GND (P9.01) and an ADC pin (P9.33) reads 4.4v or 4.5v.

So, is this source related or DTS related or just my hardware reading variable currents? Either/or/and…I just think maybe source is the only way to handle this already stacked board. I do not want to see the board go away like rubbish. It is an awesome board. The BBB stayed for many years…

Update

I want to see this board and other boards stick around!

Just a heads up here…

For me, I would like to test out the ADC more. I can put a whopper of a micro sd card on this board.

Probably 21 days of recording…

Anyway, I was thinking something. Do I need extra circuitry or should I wait until later?

Seth

Myself, use an AtoD with either spi or i2c. Much simpler to parse and process the code. Also your measurements will be more accurate. The SoC temp is up and down like a yo-yo for one. The other issue is leakage paths. If you just need general voltage the on chip should be perfect. You can grab and process the data from the bus using python and use tkinter to display on the screen.

Right…okay,

So, maybe the circuit can be made instead of using transfers of source from/to/from/to and then again. I figured the circuit could take the place of transfers.

Anyway, it is your choice. I will see if this circuit can be made easily! hardware!

Seth

P.S. I am no source champion. I have a lot to learn and this is the main reason I am building more circuits than not these days. I sort of understand SMBus protocol but not completely. I am sure my logic is always going to be way off. I have been reading a book on Python(3) programming and it is interesting at times. Right now, the book(s) are teaching me how to build programs/libs. and then test them for “goodness.” And about SPI, I am not even sure I ever wrote a SPI program to this day.

I tested some but never started from scratch to run good logic on a sensor or multiple sensors.

Here is the easy part

import tkinter as tk
import random
import netifaces

class AtoDConverterGUI:
    def __init__(self, root):
        self.root = root
        self.root.title("AtoD Converter")

        # AtoD Data Section
        self.data_frame = tk.Frame(root, padx=10, pady=10)
        self.data_frame.pack(pady=10)

        self.data_label = tk.Label(self.data_frame, text="AtoD Data:", font=("Arial", 14))
        self.data_label.grid(row=0, column=0, sticky="w")

        self.data_value = tk.Label(self.data_frame, text="0.0", font=("Arial", 14), fg="blue")
        self.data_value.grid(row=0, column=1, sticky="e")

        # Network Info Section
        self.network_frame = tk.Frame(root, padx=10, pady=10)
        self.network_frame.pack(pady=10)

        self.ip_label = tk.Label(self.network_frame, text="Target IP Address (Ethernet):", font=("Arial", 12))
        self.ip_label.grid(row=0, column=0, sticky="w")

        self.hostname_label = tk.Label(self.network_frame, text="Hostname:", font=("Arial", 12))
        self.hostname_label.grid(row=1, column=0, sticky="w")

        # Get Ethernet IP and Hostname
        ethernet_ip = self.get_ethernet_ip()
        hostname = ethernet_ip.get('hostname', "Unknown")
        ip_address = ethernet_ip.get('ip', "Unknown")

        self.ip_value = tk.Label(self.network_frame, text=ip_address, font=("Arial", 12), fg="green")
        self.ip_value.grid(row=0, column=1, sticky="e")

        self.hostname_value = tk.Label(self.network_frame, text=hostname, font=("Arial", 12), fg="green")
        self.hostname_value.grid(row=1, column=1, sticky="e")

        # Start Updating AtoD Data
        self.update_data()

    def update_data(self):
        # Simulate data variation (e.g., random float between 0 and 10)
        new_value = round(random.uniform(0.0, 10.0), 2)
        self.data_value.config(text=str(new_value))

        # Schedule the next update
        self.root.after(500, self.update_data)

    @staticmethod
    def get_ethernet_ip():
        import socket

        eth_interface = None

        # Find a likely Ethernet interface
        for iface in netifaces.interfaces():
            if iface.startswith("eth") or iface.startswith("en"):
                eth_interface = iface
                break

        if eth_interface:
            addrs = netifaces.ifaddresses(eth_interface)
            if netifaces.AF_INET in addrs:
                ip_info = addrs[netifaces.AF_INET][0]
                ip_address = ip_info.get('addr', None)
                hostname = socket.gethostname()
                return {'ip': ip_address, 'hostname': hostname}

        return {'ip': "No Ethernet IP Found", 'hostname': "Unknown"}

# Create the main application window
if __name__ == "__main__":
    root = tk.Tk()
    app = AtoDConverterGUI(root)
    root.mainloop()

1 Like