More hardware related information.
The ADC uses SPI mode 1
The output of the ADC is binary twos complement so the RAW output has been converted in software to bipolar binary twos complement format for the user library.

Kernel program header
Code: Select all
/*
* comedi/drivers/supermoon.c
*
* A special version for the TI ADS1220 SD ADC converter chip (and MCP3911 later) for low voltage sensing and
* solar panel panel light detection. +- 2.048, 1.024 and 0.512 voltage ranges @ 20 bits of usable resolution
* ADC is in single-shot conversion mode @20SPS, PGA disabled and gain from 1, 2 and 4 in differential
* signal detection mode, 50/60Hz rejection enabled. 500kHz SPI clock with direct RPi2 connection
* Analog +- 2.5VDC from Zener regulators for the bipolar input stage with external 2.5VDC Zener input
* signal protection.
*
* LEDs: + supply, - supply, DRDY__ LOW
*
* Board jumpers J1 Left to Right
* 1 3.3VDC digital supply for direct connection to RPi2 board
* 2 5.0VDC digital supply for optical interconnects for 5VDC or 3.3VDC SPI interfaces
* 3 Enable 5VDC power
*
* DIP8 Pins for MCP3002 header
* 25K22 RPi DIP8 header IDC 10 pin connector header ADS1220
* Pin 21 RB0 SPI Chip-Select Pin 1 8 CS 2
* Pin 22 RB1 SPI Clock Pin 7 7 SCK 1
* Pin 23 RB2 SPI Data In Pin 5 6 SDI 16
* Pin 24 RB3 SPI Data Out Pin 6 5 SDO 15
* Pin 8 Vss Pin 4 10 GND 4
* Pin 20 Vdd Pin 8 9 Vdd 3.3/5.0VDC 13
* Pin 2 RA0 ANA0 Pin 2 1 nc
* Pin 3 RA1 ANA1 Pin 3 2 nc
// The Comedi analog input framework contains the data needed to interface with user programs
// in a standard way by having variables and pointers to the needed functions to
// control, configure and read data
if (devpriv->ai_spi->device_type == ADS1220) {
/* we support single-ended (ground) & diff bipolar */
s->maxdata = (1 << thisboard->n_aichan_bits_ads1220) - 1;
s->range_table = &range_ads1220_ai;
s->n_chan = thisboard->n_aichan_ads1220;
s->len_chanlist = 1;
s->insn_config = daqgert_ai_insn_config;
if (devpriv->smp) {
s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND
| SDF_CMD_READ | SDF_COMMON;
s->do_cmdtest = daqgert_ai_cmdtest;
s->do_cmd = daqgert_ai_cmd;
s->poll = daqgert_ai_poll;
s->cancel = daqgert_ai_cancel;
} else {
s->subdev_flags = SDF_READABLE | SDF_DIFF | SDF_GROUND
| SDF_COMMON;
}
}
Early build construction: Input filter caps (mylar film) and metal film resistors to reduce thermal noise.
Sensor power is from 2 9volt batteries using a 3.3 LDO regulator for the digital and two 2.5volt Zeners for the +- analog input supply to the ADC. The other two chips are for a optical isolation circuit that's not used with the RPi and has it's own 5volt switcher regulator that's disabled here.
The two power indicators are LEDs in series with the Zener dropping resistors and the other LED flashes when a conversion is complete.
Module boot and loading syslog
Code: Select all
[ 3.181813] spi spi0.1: setting up native-CS1 as GPIO 7
[ 3.186151] spi spi0.0: setting up native-CS0 as GPIO 8
[ 3.192659] gpiomem-bcm2835 3f200000.gpiomem: Initialised: Registers at 0x3f200000
[ 3.373413] comedi: module is from the staging directory, the quality is unknown, you have been warned.
[ 3.373422] comedi: module is from the staging directory, the quality is unknown, you have been warned.
[ 3.377380] comedi: version 0.7.76 - http://www.comedi.org
[ 3.413526] daq_gert: module is from the staging directory, the quality is unknown, you have been warned.
[ 3.413676] daq_gert: module is from the staging directory, the quality is unknown, you have been warned.
[ 3.415490] spigert spi0.1: default setup: cd 1: 1000000 Hz: bpw 8, mode 0x3
[ 3.415814] spigert spi0.0: default setup: cd 0: 30000 Hz: bpw 8, mode 0x1
[ 3.416913] comedi comedi0: 4 cpu(s) online for threads
[ 3.416936] comedi comedi0: board setup: spi cd 1: 8000000 Hz: mode 0x3: assigned to dac devices
[ 3.417601] comedi comedi0: board setup: spi cd 0: 500000 Hz: mode 0x1: assigned to adc devices
[ 3.417641] comedi comedi0: Gertboard WiringPi pins setup
[ 3.417655] comedi comedi0: RPi new scheme rev a21041, serial 000000007678e2db, new rev 1
[ 3.417665] comedi comedi0: driver gpio board rev 3
[ 3.417679] comedi comedi0: Gertboard WPi pins set [0..7] to outputs
[ 3.417689] comedi comedi0: Gertboard spi slave device detection started, daqgert_conf option value 4
[ 3.418454] comedi comedi0: ADS1220 spi adc chip board detected, 5 channels, range code 0, device code 24, bits code 0, PIC code 1, detect Code 0
[ 3.418761] comedi comedi0: daq_gert attached: gpio iobase 0x3f200000, ioremaps 0xbb9c8000 0xf3003000, io pins 0x0, 1Mhz timer value 0x0:0x53f98d
[ 3.433189] comedi comedi0: driver 'daq_gert' has successfully auto-configured 'Gertboard'.
The brass plates are ground plane/shields for the input filter and are connected to the metal box for (some) electrostatic shielding. The resistor plugs are for the current/power calculations. The user program is calibrated for a 4.7k load across the balanced input terminals from a protection network on the panel MC4 connections to handle a voltage overload condition. (>2.5vdc)
Used my Omega CL511 calibrator set on 2000mV to dial the voltages in with signal software filtering off.
Linux software used to generate charts from the logged data.
