Topics

DRAWS GPIO/Accessory connector #draws #accessory #adc

Ryan Reid
 

I'm not one much for understanding schematics, but I'm trying to figure out on the accessory connector you have an Ain2 and an Ain3. Are those auxiliary inputs, or analog inputs? I'm looking for an analog input so that I can monitor external battery voltage. And I'm not sure if the board has an ADC built into it or if I have to connect one externally.

Also I noticed on there that one of the pins is labeled rx and one is labeled tx.  Do those forward through to the serial port on the raspberry pi, or are they for something else?

Thank you,

Ryan
K1BLU

 



On Sun, Dec 16, 2018, 08:04 Ryan Reid <blupanthr2@... wrote:
I'm not one much for understanding schematics, but I'm trying to figure out on the accessory connector you have an Ain2 and an Ain3. Are those auxiliary inputs, or analog inputs? I'm looking for an analog input so that I can monitor external battery voltage. And I'm not sure if the board has an ADC built into it or if I have to connect one externally.

If you are monitoring the supply voltage, that is already handled on the 9-15 VDC input for powering the HAT (and Pi). 

There is also a second ADC exposed on the accessory jack. 

Also I noticed on there that one of the pins is labeled rx and one is labeled tx.  Do those forward through to the serial port on the raspberry pi, or are they for something else?

Those are for a serial port, it is /dev/ttySC1. The ttySC0 is to the GPS.


Thank you,

Ryan
K1BLU

 

image.png
I will let Anna or Bryan characterize the pins in more detail.


--


John D. Hays
Edmonds, WA
K7VE

   

Annaliese McDermond
 

On Dec 16, 2018, at 3:18 AM, Ryan Reid <@blupanthr2> wrote:

I'm not one much for understanding schematics, but I'm trying to figure out on the accessory connector you have an Ain2 and an Ain3. Are those auxiliary inputs, or analog inputs? I'm looking for an analog input so that I can monitor external battery voltage. And I'm not sure if the board has an ADC built into it or if I have to connect one externally.
The DRAWS has an ADC built into it. You are correct that those are brought out on pins “Ain2” and “Ain3”. You can access the values of these in a variety of ways through the lmsensors/hwmon (see https://github.com/lm-sensors/lm-sensors) subsystem in linux. If you type “sensors” on a running system, you’ll get something that looks like this:

ads1015-i2c-1-48
Adapter: bcm2835 I2C adapter
User ADC Differential: +0.00 V
+12V: +12.02 V
User ADC 1: +0.01 V
User ADC 2: +0.00 V

The “+12V” input is hooked to the DC input of the DRAWS. You can do various scaling on the User ADC values by using the sensors configuration file for DRAWS located at /etc/sensors.d/draws.

Note that there are also some scaling factors available as “dtparam” settings in config.txt.

These pins are also connected to pins 22 and 24 on the Broadcom SoC for doing digital inputs or outputs. Incidentally these are the “BCM” pin numbers. You’ll *never* hear me referring to wiringPi’s pin numberings.

I’ll let Bryan speak to the electrical characteristics of these pins, but I’m sure that if you try to measure a few thousand volts on them you’ll have a bad day.

Also I noticed on there that one of the pins is labeled rx and one is labeled tx. Do those forward through to the serial port on the raspberry pi, or are they for something else?
They do not connect to the /dev/ttyAMA0 port on the Pi. We don’t bring that out on draws. They connect to an additional serial port, /dev/ttySC1, which is on the I2C serial chip we use to access the GPS.

Thank you,

Ryan
K1BLU

--
Annaliese McDermond, J.D. (NH6Z)
nh6z@...

Ryan Reid
 

Thank you all!!

Just what I was looking for.

Ryan
K1BLU

On Sun, Dec 16, 2018, 09:32 Annaliese McDermond <nh6z@... wrote:


> On Dec 16, 2018, at 3:18 AM, Ryan Reid <blupanthr2@...> wrote:
>
> I'm not one much for understanding schematics, but I'm trying to figure out on the accessory connector you have an Ain2 and an Ain3. Are those auxiliary inputs, or analog inputs? I'm looking for an analog input so that I can monitor external battery voltage. And I'm not sure if the board has an ADC built into it or if I have to connect one externally.

The DRAWS has an ADC built into it.  You are correct that those are brought out on pins “Ain2” and “Ain3”.  You can access the values of these in a variety of ways through the lmsensors/hwmon (see https://github.com/lm-sensors/lm-sensors) subsystem in linux.  If you type “sensors” on a running system, you’ll get something that looks like this:

ads1015-i2c-1-48
Adapter: bcm2835 I2C adapter
User ADC Differential:  +0.00 V 
+12V:                  +12.02 V 
User ADC 1:             +0.01 V 
User ADC 2:             +0.00 V 

The “+12V” input is hooked to the DC input of the DRAWS.  You can do various scaling on the User ADC values by using the sensors configuration file for DRAWS located at /etc/sensors.d/draws.

Note that there are also some scaling factors available as “dtparam” settings in config.txt.

These pins are also connected to pins 22 and 24 on the Broadcom SoC for doing digital inputs or outputs.  Incidentally these are the “BCM” pin numbers.  You’ll *never* hear me referring to wiringPi’s pin numberings.

I’ll let Bryan speak to the electrical characteristics of these pins, but I’m sure that if you try to measure a few thousand volts on them you’ll have a bad day.

> Also I noticed on there that one of the pins is labeled rx and one is labeled tx.  Do those forward through to the serial port on the raspberry pi, or are they for something else?

They do not connect to the /dev/ttyAMA0 port on the Pi.  We don’t bring that out on draws.  They connect to an additional serial port, /dev/ttySC1, which is on the I2C serial chip we use to access the GPS.

> Thank you,
>
> Ryan
> K1BLU


--
Annaliese McDermond, J.D. (NH6Z)
nh6z@...




Ryan Reid
 

Maybe I'm missing something, but Sensors is not seeing it...
The hat is installed, and connected through the +12v Input.

root@compass:~# sensors
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
root@compass:~#  sensors-detect
# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)
# Kernel: 4.14.79-v7+ armv7l
# Processor: ARMv7 Processor rev 4 (v7l) (//)
 
This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.
 
Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): yes
modprobe: FATAL: Module cpuid not found in directory /lib/modules/4.14.79-v7+
Failed to load module cpuid.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             No
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No
 
Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): yes
Sorry, no supported PCI bus adapters found.
 
Next adapter: bcm2835 I2C adapter (i2c-1)
Do you want to scan it? (YES/no/selectively): yes
Client found at address 0x18
Handled by driver `tlv320aic32x4_i2c' (already loaded), chip type `tlv320aic32x4'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x48
Probing for `National Semiconductor LM75'...                No
Probing for `National Semiconductor LM75A'...               No
Probing for `Dallas Semiconductor DS75'...                  No
Probing for `National Semiconductor LM77'...                No
Probing for `Analog Devices ADT7410/ADT7420'...             No
Probing for `Analog Devices ADT7411'...                     No
Probing for `Maxim MAX6642'...                              No
Probing for `Texas Instruments TMP435'...                   No
Probing for `National Semiconductor LM73'...                No
Probing for `National Semiconductor LM92'...                No
Probing for `National Semiconductor LM76'...                No
Probing for `Maxim MAX6633/MAX6634/MAX6635'...              No
Probing for `NXP/Philips SA56004'...                        No
Probing for `SMSC EMC1023'...                               No
Probing for `SMSC EMC1043'...                               No
Probing for `SMSC EMC1053'...                               No
Probing for `SMSC EMC1063'...                               No
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Probing for `EDID EEPROM'...                                No
 
Sorry, no sensors were detected.
Either your system has no sensors, or they are not supported, or
they are connected to an I2C or SMBus adapter that is not
supported. If you find out what chips are on your board, check
http://www.lm-sensors.org/wiki/Devices for driver status.
root@compass:~# uname -a
Linux compass 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux

Ryan Reid
 

Answered my own question... forgot to change dtoverlay from udrc to draws.

 

Try the command

sensors

Instead of sensors-detect


On Mon, Dec 17, 2018 at 2:50 PM Ryan Reid <blupanthr2@...> wrote:
Maybe I'm missing something, but Sensors is not seeing it...
The hat is installed, and connected through the +12v Input.

root@compass:~# sensors
No sensors found!
Make sure you loaded all the kernel drivers you need.
Try sensors-detect to find out which these are.
root@compass:~#  sensors-detect
# sensors-detect revision 6284 (2015-05-31 14:00:33 +0200)
# Kernel: 4.14.79-v7+ armv7l
# Processor: ARMv7 Processor rev 4 (v7l) (//)
 
This program will help you determine which kernel modules you need
to load to use lm_sensors most effectively. It is generally safe
and recommended to accept the default answers to all questions,
unless you know what you're doing.
 
Some south bridges, CPUs or memory controllers contain embedded sensors.
Do you want to scan for them? This is totally safe. (YES/no): yes
modprobe: FATAL: Module cpuid not found in directory /lib/modules/4.14.79-v7+
Failed to load module cpuid.
Silicon Integrated Systems SIS5595...                       No
VIA VT82C686 Integrated Sensors...                          No
VIA VT8231 Integrated Sensors...                            No
AMD K8 thermal sensors...                                   No
AMD Family 10h thermal sensors...                           No
AMD Family 11h thermal sensors...                           No
AMD Family 12h and 14h thermal sensors...                   No
AMD Family 15h thermal sensors...                           No
AMD Family 16h thermal sensors...                           No
AMD Family 15h power sensors...                             No
AMD Family 16h power sensors...                             No
Intel digital thermal sensor...                             No
Intel AMB FB-DIMM thermal sensor...                         No
Intel 5500/5520/X58 thermal sensor...                       No
VIA C7 thermal sensor...                                    No
VIA Nano thermal sensor...                                  No
 
Lastly, we can probe the I2C/SMBus adapters for connected hardware
monitoring devices. This is the most risky part, and while it works
reasonably well on most systems, it has been reported to cause trouble
on some systems.
Do you want to probe the I2C/SMBus adapters now? (YES/no): yes
Sorry, no supported PCI bus adapters found.
 
Next adapter: bcm2835 I2C adapter (i2c-1)
Do you want to scan it? (YES/no/selectively): yes
Client found at address 0x18
Handled by driver `tlv320aic32x4_i2c' (already loaded), chip type `tlv320aic32x4'
    (note: this is probably NOT a sensor chip!)
Client found at address 0x48
Probing for `National Semiconductor LM75'...                No
Probing for `National Semiconductor LM75A'...               No
Probing for `Dallas Semiconductor DS75'...                  No
Probing for `National Semiconductor LM77'...                No
Probing for `Analog Devices ADT7410/ADT7420'...             No
Probing for `Analog Devices ADT7411'...                     No
Probing for `Maxim MAX6642'...                              No
Probing for `Texas Instruments TMP435'...                   No
Probing for `National Semiconductor LM73'...                No
Probing for `National Semiconductor LM92'...                No
Probing for `National Semiconductor LM76'...                No
Probing for `Maxim MAX6633/MAX6634/MAX6635'...              No
Probing for `NXP/Philips SA56004'...                        No
Probing for `SMSC EMC1023'...                               No
Probing for `SMSC EMC1043'...                               No
Probing for `SMSC EMC1053'...                               No
Probing for `SMSC EMC1063'...                               No
Client found at address 0x50
Probing for `Analog Devices ADM1033'...                     No
Probing for `Analog Devices ADM1034'...                     No
Probing for `SPD EEPROM'...                                 No
Probing for `EDID EEPROM'...                                No
 
Sorry, no sensors were detected.
Either your system has no sensors, or they are not supported, or
they are connected to an I2C or SMBus adapter that is not
supported. If you find out what chips are on your board, check
root@compass:~# uname -a
Linux compass 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux



--


John D. Hays
Edmonds, WA
K7VE

   

Basil Gunn
 

Answered my own question... forgot to change dtoverlayfrom udrc to draws.
If you use the current beta image for draws the dtoverlay is set up properly.
http://nwdig.net/downloads/

/Basil

Ryan Reid
 

Is there a changelog between the beta image, and modifying the last Compass release?  Wondering if it is worth overwriting any settings/other modifications I have done so far.

Ryan
K1BLU


On Mon, Dec 17, 2018 at 4:44 PM Basil Gunn <basil@...> wrote:

> Answered my own question... forgot to change dtoverlayfrom udrc to draws.

If you use the current beta image for draws the dtoverlay is set up properly.
http://nwdig.net/downloads/

/Basil



KB5ZUR
 


I can't seem to get the sensor readings to work. says" command not found". tried that and lm-sensors command as well, same thing. Do I need to install something? What am I missing?
I'm using this version of  compass:
Linux compass 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux
debian_version 9.6
This is I think the first beta image released. 
Also, what is the range of the ADC's? I would like to read two 0-5VDC signals from my SWR bridge from Kits and Parts. Are the inputs isolated?
 

 

sudo apt-get install lm-sensors

sensors

On Wed, Dec 19, 2018, 08:42 KB5ZUR <kb5zur@... wrote:

I can't seem to get the sensor readings to work. says" command not found". tried that and lm-sensors command as well, same thing. Do I need to install something? What am I missing?
I'm using this version of  compass:
Linux compass 4.14.79-v7+ #1159 SMP Sun Nov 4 17:50:20 GMT 2018 armv7l GNU/Linux
debian_version 9.6
This is I think the first beta image released. 
Also, what is the range of the ADC's? I would like to read two 0-5VDC signals from my SWR bridge from Kits and Parts. Are the inputs isolated?
 

 

All about the Ain inputs on the accessory connector.

Each input connects to a Pi IO Pin and an ADC input. Clearly you can’t use both. There is also an ESD protection diode and 33ohm series resistor to reduce the chance of damaging the input.

To use the ADC set the corresponding GPIO to input with pulldown.

The max input is 3.3V so use a resistor divider above that voltage. The PS Input is scaled with 48.7k and 10.0k 1% this gives a range of:

0-19.7V

The actual installed ADC is a TI I2C 4CH 12Bit Device It is SW compatible with the ads1015 with a few less features.

Datasheet:


The resistor values are set into SW so the sensor command displays the voltage correctly.

pi@compass:~ $ sensors
ads1015-i2c-1-48
Adapter: bcm2835 I2C adapter
User ADC Differential:  +0.00 V  
+12V:                  +13.77 V  
User ADC 1:             +0.00 V  
User ADC 2:             +0.00 V  

If you put 10.0k and 10.0k in your signal path, you can read sensors and multiply User ADC by 2.

It is possible, but not trivial, to change the file so it reads directly with your values. This will be documented in a future APP Note.

Bryan K7UDR