Analog Read - Pin A7 linked to A0 and A1?

Hi, can anyone see if I am doing something wrong?
I feel like i have two issues:

  1. Analog read pin A7 is linked to A0 and A1.
  2. Analog read pin A0 does not work when used alone.

My set up:
I have a 10K and 1K resistor hooked up (series) between 3V3* pin and GND, and a jumper between these two that I use to test the analog pins. I have moved the spark core on the beard board and get the same results.

My results pins read every second and output. (note only one pin is connected at a time, see how the readings for A0 and A1 change when A7 is connected, and how pin A0 does not change when it’s hooked up.) also I addded the comments for easier reading…
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2014.03.17 05:02:57 =~=~=~=~=~=~=~=~=~=~=~=
-------------none attached to voltage divider---------------------------
A0=2089 A1=1699 A2=1950 A3=1915 A4=1981 A5=1891 A6=1983 A7=1887
A0=2009 A1=2000 A2=1663 A3=1929 A4=1981 A5=1912 A6=1985 A7=1866
A0=2100 A1=1667 A2=1951 A3=1923 A4=1964 A5=1890 A6=1972 A7=1868
A0=1978 A1=1981 A2=1686 A3=1928 A4=1976 A5=1901 A6=1983 A7=1872
A0=2093 A1=1817 A2=1835 A3=1932 A4=1993 A5=1924 A6=1988 A7=1843
A0=1988 A1=1966 A2=1645 A3=1904 A4=1981 A5=1866 A6=1974 A7=1863
A0=1996 A1=1981 A2=1673 A3=1931 A4=1974 A5=1907 A6=1989 A7=1863
A0=2090 A1=1674 A2=1927 A3=1902 A4=1967 A5=1856 A6=1962 A7=1891
A0=1975 A1=1953 A2=1736 A3=1917 A4=1975 A5=1885 A6=1972 A7=1867
A0=2091 A1=1694 A2=1985 A3=1960 A4=1995 A5=1922 A6=1983 A7=1881
A0=1989 A1=1996 A2=1667 A3=1943 A4=1985 A5=1923 A6=1992 A7=1873
-------------A7 attached to voltage divider---------------------------
A0=371 A1=916 A2=1960 A3=1922 A4=1971 A5=1880 A6=1964 A7=866
A0=368 A1=560 A2=1611 A3=1935 A4=1981 A5=1903 A6=1978 A7=871
A0=370 A1=668 A2=1928 A3=1955 A4=1996 A5=1933 A6=1985 A7=866
A0=370 A1=1102 A2=1966 A3=1922 A4=1975 A5=1908 A6=1988 A7=868
A0=364 A1=547 A2=1583 A3=1926 A4=1963 A5=1887 A6=1988 A7=861
-------------none attached to voltage divider---------------------------
A0=2089 A1=1710 A2=1921 A3=1927 A4=1991 A5=1914 A6=1979 A7=1855
A0=2086 A1=1977 A2=1674 A3=1940 A4=1981 A5=1911 A6=1976 A7=1879
A0=2089 A1=1672 A2=1971 A3=1931 A4=1965 A5=1884 A6=1976 A7=1871
-------------A6 attached to voltage divider---------------------------
A0=2090 A1=1679 A2=1995 A3=1932 A4=1979 A5=1892 A6=874 A7=1199
A0=2001 A1=2006 A2=1688 A3=1945 A4=1986 A5=1913 A6=874 A7=1178
A0=1975 A1=1956 A2=1653 A3=1899 A4=1961 A5=1880 A6=870 A7=1196
A0=1968 A1=1951 A2=1650 A3=1919 A4=1968 A5=1889 A6=872 A7=1206
A0=2090 A1=1688 A2=1980 A3=1966 A4=1998 A5=1924 A6=875 A7=1182
A0=2084 A1=1678 A2=1957 A3=1913 A4=1970 A5=1899 A6=874 A7=1209
-------------none attached to voltage divider---------------------------
A0=2090 A1=1801 A2=1837 A3=1917 A4=1964 A5=1929 A6=1963 A7=1875
-------------A5 attached to voltage divider---------------------------
A0=2100 A1=1672 A2=1965 A3=1935 A4=1969 A5=875 A6=1276 A7=1885
A0=2094 A1=1832 A2=1851 A3=1958 A4=1996 A5=869 A6=1315 A7=1855
A0=2095 A1=1670 A2=1959 A3=1925 A4=1969 A5=882 A6=1281 A7=1863
A0=2089 A1=1816 A2=1827 A3=1924 A4=1972 A5=881 A6=1288 A7=1866
A0=2089 A1=1689 A2=1988 A3=1960 A4=1986 A5=877 A6=1300 A7=1854
A0=1979 A1=1966 A2=1652 A3=1916 A4=1977 A5=872 A6=1292 A7=1857
-------------none attached to voltage divider---------------------------
A0=2099 A1=1674 A2=1952 A3=1919 A4=1986 A5=1861 A6=1983 A7=1875
A0=2091 A1=1666 A2=2012 A3=1941 A4=1975 A5=1889 A6=1976 A7=1884
-------------A4 attached to voltage divider---------------------------
A0=2091 A1=1708 A2=1976 A3=1960 A4=874 A5=1301 A6=1976 A7=1855
A0=1974 A1=1797 A2=1651 A3=1909 A4=1041 A5=1263 A6=1968 A7=1864
A0=2090 A1=1808 A2=1825 A3=1928 A4=870 A5=1281 A6=1984 A7=1861
A0=2111 A1=1687 A2=2001 A3=1943 A4=875 A5=1303 A6=1980 A7=1874
A0=2076 A1=1667 A2=1962 A3=1927 A4=874 A5=1088 A6=1975 A7=1878
A0=1975 A1=1962 A2=1674 A3=1917 A4=872 A5=1290 A6=1985 A7=1858
-------------none attached to voltage divider---------------------------
A0=2090 A1=1679 A2=1980 A3=1954 A4=1945 A5=1926 A6=1994 A7=1855
A0=2090 A1=1836 A2=1840 A3=1952 A4=1976 A5=1915 A6=1979 A7=1861
A0=2091 A1=1677 A2=1955 A3=2086 A4=1982 A5=1886 A6=1977 A7=1871
-------------A3 attached to voltage divider---------------------------
A0=1985 A1=1984 A2=1671 A3=881 A4=1272 A5=1910 A6=1986 A7=1816
A0=2089 A1=1687 A2=1979 A3=877 A4=1283 A5=1903 A6=1996 A7=1823
A0=1988 A1=1990 A2=1716 A3=868 A4=1295 A5=1905 A6=1981 A7=1828
A0=2086 A1=1670 A2=1955 A3=874 A4=1261 A5=1893 A6=1983 A7=1835
A0=2073 A1=1938 A2=1673 A3=873 A4=1282 A5=1906 A6=1985 A7=1832
-------------none attached to voltage divider---------------------------
A0=2092 A1=1685 A2=2007 A3=1878 A4=1997 A5=1898 A6=1982 A7=1872
A0=2090 A1=1989 A2=1668 A3=1932 A4=1984 A5=1904 A6=1983 A7=1861
-------------A2 attached to voltage divider---------------------------
A0=1974 A1=1949 A2=917 A3=1255 A4=1957 A5=1899 A6=1979 A7=1884
A0=2090 A1=1789 A2=734 A3=1297 A4=1973 A5=1899 A6=1989 A7=1882
A0=2113 A1=1691 A2=867 A3=1296 A4=1996 A5=1903 A6=1982 A7=1860
A0=2113 A1=1665 A2=870 A3=1296 A4=1967 A5=1886 A6=1985 A7=1851
A0=2091 A1=1675 A2=863 A3=1286 A4=1976 A5=1905 A6=1981 A7=1867
A0=1987 A1=1994 A2=753 A3=1300 A4=1967 A5=1907 A6=1982 A7=1870
-------------none attached to voltage divider---------------------------
A0=2091 A1=1674 A2=1949 A3=1965 A4=1979 A5=1902 A6=1984 A7=1853
A0=2090 A1=1664 A2=1966 A3=1943 A4=1965 A5=1908 A6=1986 A7=1859
-------------A1 attached to voltage divider---------------------------
A0=1918 A1=728 A2=1282 A3=1897 A4=1939 A5=1896 A6=1977 A7=1727
A0=1918 A1=1538 A2=1317 A3=1879 A4=1933 A5=1909 A6=1984 A7=1695
A0=1918 A1=901 A2=1294 A3=1866 A4=1937 A5=1899 A6=1978 A7=1727
A0=1919 A1=710 A2=1286 A3=1873 A4=1925 A5=1892 A6=1983 A7=1719
-------------none attached to voltage divider---------------------------
A0=1920 A1=1035 A2=1302 A3=1865 A4=1940 A5=1892 A6=1977 A7=1727
A0=2012 A1=2013 A2=1683 A3=1944 A4=1986 A5=1915 A6=1985 A7=1872
-------------A0 attached to voltage divider---------------------------
A0=2091 A1=1663 A2=1972 A3=1918 A4=1968 A5=1894 A6=1978 A7=1890
A0=2114 A1=1383 A2=1742 A3=1939 A4=1963 A5=1894 A6=1882 A7=1811
A0=2114 A1=1159 A2=1965 A3=1910 A4=1960 A5=1894 A6=1875 A7=1812
A0=2091 A1=1360 A2=1777 A3=1953 A4=1993 A5=1917 A6=1877 A7=1810
A0=2091 A1=1166 A2=1964 A3=1930 A4=1976 A5=1899 A6=1890 A7=1812
A0=1900 A1=1551 A2=1400 A3=1916 A4=1977 A5=1885 A6=1877 A7=1824
A0=2109 A1=1252 A2=1875 A3=1950 A4=1974 A5=1893 A6=1880 A7=1806
A0=2105 A1=1191 A2=1959 A3=1938 A4=1986 A5=1903 A6=1869 A7=1803
A0=1903 A1=1567 A2=1389 A3=1915 A4=1989 A5=1874 A6=1861 A7=1825
-------------none attached to voltage divider---------------------------
A0=2090 A1=1669 A2=1963 A3=1998 A4=1971 A5=1899 A6=1975 A7=1886
A0=1992 A1=1968 A2=1669 A3=1911 A4=1961 A5=1892 A6=1979 A7=1865
-------------A7 attached to voltage divider---------------------------
A0=370 A1=812 A2=1959 A3=1969 A4=1991 A5=1913 A6=1981 A7=861
A0=372 A1=1446 A2=1987 A3=1932 A4=1988 A5=1890 A6=1979 A7=866
A0=364 A1=914 A2=1968 A3=1926 A4=1972 A5=1904 A6=1994 A7=861
A0=370 A1=1446 A2=1984 A3=1936 A4=1973 A5=1893 A6=1981 A7=871
A0=369 A1=592 A2=1806 A3=1952 A4=1997 A5=1931 A6=1984 A7=870
-------------none attached to voltage divider---------------------------
A0=2091 A1=1698 A2=1964 A3=1922 A4=1972 A5=1930 A6=1997 A7=1836
A0=2091 A1=1715 A2=1914 A3=1927 A4=1968 A5=1907 A6=1985 A7=1891
A0=2089 A1=1699 A2=1915 A3=1925 A4=1975 A5=1898 A6=1980 A7=1885
A0=2078 A1=1957 A2=1685 A3=1935 A4=1963 A5=1894 A6=1976 A7=1866

My code:

// -----------------
// spit out readings every 1 second
// -----------------

// variables for read values and text for out put
int ina0 = 0;
String ta0 = "A0=";
int ina1 = 0;
String ta1 = "  A1=";
int ina2 = 0;
String ta2 = "  A2=";
int ina3 = 0;
String ta3 = "  A3=";
int ina4 = 0;
String ta4 = "  A4=";
int ina5 = 0;
String ta5 = "  A5=";
int ina6 = 0;
String ta6 = "  A6=";
int ina7 = 0;
String ta7 = "  A7=";
int ina8 = 0;
String ta8 = "  A8=";

void setup()
{
  Serial.begin(9600);   // open serial over USB -for debug
  // pins to be an input
  pinMode(A0, INPUT);
  pinMode(A1, INPUT);
  pinMode(A2, INPUT);
  pinMode(A3, INPUT);
  pinMode(A4, INPUT);
  pinMode(A5, INPUT);
  pinMode(A6, INPUT);
  pinMode(A7, INPUT);
}

void loop()
{
  // read pins
  ina0 = analogRead(A0);
  ina1 = analogRead(A1); 
  ina2 = analogRead(A2);
  ina3 = analogRead(A3);
  ina4 = analogRead(A4);
  ina5 = analogRead(A5);
  ina6 = analogRead(A6);
  ina7 = analogRead(A7);
  //concatenate and send out
  String aout = ta0 + ina0 + ta1 + ina1 + ta2 + ina2 + ta3 + ina3 + ta4 + ina4 + ta5 + ina5 + ta6 + ina6 + ta7 + ina7;
  Serial.println(aout);
  delay(1000);   // Wait for 1000mS = 1 second  
}

Hi @peetersm,

I'm not 100% sure if this is related, but there have been some great threads about weird readings from the ADC when reading from several analog pins in a row here:

Thanks!
David

Thanks Dave, but this is more than a low reading on a pin off by a constant, it’s strange behavior only for certain combinations of pins. I think some pictures will help me explain better. My assumption would be that an “empty” pin would read ~1900 and a pin connected would read ~860, is this wrong? I am using the Sparkweb site, but i thought the bugs in the web’s version of the firmware have been fixed? maybe I need to figure out how to get a more current firmware and flash without the web.

Setting the pins to inputs initially does nothing after you make your first analog read of each pin… they will be set as analog inputs then.

Any analog input left floating with nothing connected to it is going to give you strange results. You need to connect it to a voltage, preferably one with low impedance <10k.

The case where A0 is reading high when connected to the divider is strange.

Your correct readings should be 372 though, not 860… right? There should be about 0.3V on the input from the divider, so 0.3/3.3*4095 = 372.

1 Like

The webIDE version of the ADC analogRead() code is still behind the current master branch usually used for local builds. One of the symptoms of the bug is an odd mixing of data when you use two or more channels.

Either local build or waiting for the Sparkulator webIDE to update will fix a lot of problems!

1 Like

As @BDub said, leaving the pins floating (unconnected) is going to give you fluctuating readings. Especially with the Core connected to a breadboard: Because of the large strips of metal inside each row and the fact they’re thinly insulated, they have a fairly considerable capacitance (parasitic or otherwise) and inductance!

1 Like

ok, thanks everyone! I will try to make a better testing set up so those inputs are not flapping in the breeze. :slight_smile: and try to get V2 firmware loaded. Stand by… I am not having much luck figuring out how to update/load firmware from a win7 machine, feeling like i need to get that Ubuntu box rolling so I can use what everyone else is using. So far not finding the magical post thread or read me.Still really enjoying this thing, can’t wait till I know enough to be dangerous.

I’d expect that this does not really have anything to do with this problem, but just to throw in one thought - since it’s a weird coincidence, that pins A0 & A1 behave oddly.
I just recently came across the fact that pins A0/A1 are also used as CTS/RTS lines for USART2 (Core TX/RX).
Both the ADC and USART flow control are alternate functions of PA0/PA1, so there might be a chance that USART2 interferes with the ADC.
At least this is how I understand the footnote (4) of the STM32 datasheet pin description (page 32).

ok I have made sure I am on V2 firmware and made sure to have all pins connected to something.
AND and feel more confused than ever,what I am misunderstanding here. Seems like pins are connected together - interfering, etc
See picture and data below.
My process was to move the read pin from Ground to 3V3* for about 5 seconds and back zero.

=~=~=~= PuTTY log 2014.03.23 12:37:35 =~=~=~=~=~=~=
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
-------------A0 attached to 3v3* out--------
A0=0 A1=140 A2=140 A3=0 A4=0 A5=0 A6=0 A7=0
A0=204 A1=1023 A2=409 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=1023 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=1023 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=1023 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=1024 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
----all input to ground---------------------------
A0=0 A1=421 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
-------------A1 attached to 3v3* out--------
A0=0 A1=375 A2=608 A3=2 A4=0 A5=0 A6=0 A7=0
A0=0 A1=1842 A2=1228 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=2252 A2=1228 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=1023 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=204 A2=1228 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=614 A2=1228 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=205 A2=1229 A3=0 A4=0 A5=0 A6=0 A7=0
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=1 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=2
-------------A2 attached to 3v3* out--------
A0=0 A1=0 A2=2661 A3=1228 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=2252 A3=1228 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=2661 A3=1228 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=2661 A3=1228 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=2662 A3=1228 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=2661 A3=1228 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=1292 A3=619 A4=0 A5=0 A6=0 A7=0
----all input to ground---------------------------
A0=0 A1=0 A2=835 A3=604 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=1 A3=0 A4=0 A5=1 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=1 A5=0 A6=0 A7=0
-------------A3 attached to 3v3* out--------
A0=0 A1=0 A2=0 A3=1253 A4=600 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=2661 A4=1228 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=2661 A4=1228 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=2661 A4=1228 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=2661 A4=1228 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=2661 A4=1842 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=2661 A4=1228 A5=0 A6=0 A7=0
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=1255 A4=602 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=2 A5=1 A6=0 A7=1
A0=0 A1=1 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=1 A5=0 A6=0 A7=1
-------------A4 attached to 3v3* out--------
A0=0 A1=0 A2=0 A3=0 A4=1330 A5=620 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=2661 A5=1228 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=2661 A5=1228 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=2661 A5=1228 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=2661 A5=1228 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=2661 A5=1228 A6=0 A7=0
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=0 A4=874 A5=630 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
-------------A5 attached to 3v3* out--------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=902 A6=619 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=2661 A6=1228 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=2661 A6=1228 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=2661 A6=1228 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=2662 A6=1228 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=2661 A6=1228 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=2661 A6=1228 A7=0
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
-------------A6 attached to 3v3* out--------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=2252 A7=1228
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=2661 A7=1228
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=2661 A7=1228
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=2661 A7=1228
A0=0 A1=0 A2=1 A3=1 A4=0 A5=0 A6=2660 A7=1228
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=836 A7=487
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
-------------A7 attached to 3v3* out--------
A0=1619 A1=325 A2=0 A3=0 A4=1 A5=0 A6=1 A7=753
A0=4094 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=2661
A0=3685 A1=2866 A2=0 A3=0 A4=0 A5=0 A6=0 A7=2661
A0=3684 A1=2866 A2=0 A3=0 A4=0 A5=0 A6=0 A7=2661
A0=4094 A1=2047 A2=0 A3=0 A4=0 A5=0 A6=0 A7=2661
A0=4094 A1=2047 A2=1 A3=0 A4=0 A5=0 A6=0 A7=2661
A0=4094 A1=2456 A2=0 A3=0 A4=0 A5=0 A6=0 A7=2661
----all input to ground---------------------------
A0=1665 A1=500 A2=0 A3=0 A4=0 A5=0 A6=0 A7=1034
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0

HI @peetersm

How are you building your code? Are you using the webIDE or doing a local build via git clone, make all, etc?

The compile-server2 branch of the code used by the webIDE for analogRead() has a bug that mixes channels. This bug is fixed on the master branch that you would generally use for local build via git clone, make all. When all the updates in the master branch are tested fully, the Spark team will move master to compile-server2, but it has not happened yet.

When you say your are on v2 firmware, what do you mean exactly?

Ah, I am using the webIDE to load my program.
When I say V2 I mean I followed this process(see link below). I thought all I needed was to have that firmware updated, now I understand I should be complieing my code locally…is there a good “how to” on doing that?

link to the firmware upgade

Here is the main post:

You should think of the master branch as somewhat experimental with the latest fixes but it has not undergone full testing.

You may need more help if you use Windows–there are posts for that too.

thanks goodness the new firmware was put in the webIDE today. it’s like night and day…and I also applaud the beginning of a “know issues” area (yet to appear but promised) since this might have helped me not feel like I was losing my mind.

check out these results with the new webIDE upload…they are just beautiful!!

=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2014.03.25 20:05:14 =~=~=~=~=~=~=~=~=~=~=~=
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=1 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
-------------A0 attached to 3v3* out--------
A0=1741 A1=0 A2=3 A3=0 A4=2 A5=0 A6=1 A7=2
A0=4094 A1=1 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=4094 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=4094 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=4094 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
----all input to ground---------------------------
A0=1968 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=1 A3=1 A4=1 A5=0 A6=3 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
-------------A1 attached to 3v3* out--------
A0=0 A1=4094 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=4094 A2=0 A3=0 A4=1 A5=0 A6=0 A7=0
A0=0 A1=4094 A2=1 A3=0 A4=1 A5=0 A6=0 A7=0
A0=0 A1=4094 A2=0 A3=0 A4=2 A5=0 A6=1 A7=0
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=1 A4=0 A5=0 A6=0 A7=0
-------------A2 attached to 3v3* out--------
A0=0 A1=3 A2=4094 A3=0 A4=0 A5=0 A6=2 A7=0
A0=0 A1=0 A2=4094 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=4094 A3=0 A4=1 A5=0 A6=0 A7=0
A0=0 A1=0 A2=4094 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=4094 A3=0 A4=0 A5=1 A6=0 A7=0
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=1
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
-------------A3 attached to 3v3* out--------
A0=0 A1=0 A2=0 A3=4094 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=4094 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=4094 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=4094 A4=0 A5=0 A6=0 A7=1
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=1565 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
-------------A4 attached to 3v3* out--------
A0=0 A1=0 A2=0 A3=0 A4=4094 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=4095 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=2 A4=4094 A5=0 A6=0 A7=0
A0=0 A1=1 A2=0 A3=0 A4=4094 A5=0 A6=0 A7=0
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=0 A4=1895 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=1 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
-------------A5 attached to 3v3* out--------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=2078 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=4094 A6=0 A7=0
A0=1 A1=0 A2=2 A3=1 A4=1 A5=4094 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=4094 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=1 A5=4094 A6=0 A7=0
----all input to ground---------------------------
A0=0 A1=1 A2=0 A3=0 A4=0 A5=2109 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=3 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
-------------A6 attached to 3v3* out--------
A0=0 A1=0 A2=0 A3=0 A4=1 A5=0 A6=4094 A7=0
A0=0 A1=1 A2=0 A3=0 A4=0 A5=0 A6=4094 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=4093 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=4094 A7=0
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=1310 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=2 A1=0 A2=0 A3=3 A4=0 A5=0 A6=0 A7=3
-------------A7 attached to 3v3* out--------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=1432
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=4094
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=4094
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=4094
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=4094
----all input to ground---------------------------
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=1374
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0
A0=0 A1=0 A2=0 A3=0 A4=0 A5=0 A6=0 A7=0

1 Like

Thanks @peetersm for testing it out and posting the results!

There is indeed a placeholder for know issues now at: http://docs.spark.io/#/troubleshooting/known-issues
We will continue to keep it updated.

1 Like