ICSP pins on the Arduino Uno???
Moderators: adafruit_support_bill, adafruit

ICSP pins on the Arduino Uno???

by pvalkovski on Sun Feb 12, 2012 11:28 pm

Hello,

I have a couple of basic questions regarding the Arduino Uno board. I bought the "Getting Started with Arduino" book and I have looked through the website but I could not find how to use the ICSP pins, the AREF pin, and the IOREF pin. Can someone give me the basics on what these pins are for and how are they used. For example, can I plug in a 3 pin female header servo motor directly into the ICSP pins? Any info is appreciated.

PS: I tried to post an image but apparently you cannot copy and paste into this forum...if you could also let me know how to post an image I created that would be awesome.
pvalkovski
 
Posts: 1
Joined: Sun Feb 12, 2012 11:03 pm

Re: ICSP pins on the Arduino Uno???

by westfw on Mon Feb 13, 2012 2:12 am

The ICSP pins are (mostly) for reprogramming the bootloader onto the ATmega CPU. This is an "Atmel Standard" connector for such purposes doing "In-circuit Serial Programming" of their chips.

AREF is an external reference voltage for the A to D converter ("analogRead()") In theory, if you have a sensor that puts out 0 to 2.047V instead of 0 to 5V, you could put a 2.048V reference on that pin and get greater accuracy of the smaller range. In practice, this seems to be relatively difficult to use.

IOREF is theoretically used to allow shields to run at the correct voltage to match the main Arduino (usually 3.3V or 5V.) Since there aren't any official 3.3V boards yet, it's not entirely clear how it is supposed to be used, but it won't be necessary for most users to deal with it.
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: ICSP pins on the Arduino Uno???

by philba on Mon Feb 13, 2012 2:44 am

The ICSP pins go to reset and 3 of the 4 SPI pins (MOSI, MISO and SCK). The SPI pins are on 11-13 of the Uno and reset comes out on the power header. So, there's really no benefit to the ICSP header other than being able to use standard connectors for programming the 328P.

You might want to look at tying aref to 3.3V for a better analog reference. The +5V rail on the arduino can have noise on it and affect your ADC readings. Also, the +5V rail (and to a lesser extent, the 3.3V rail as well) will move around if you have a variable load (regulators aren't perfect) and this will change the ADC reading. A dedicated reference is best - it has no other loads so it's likely to be pretty stable. Of course you'll have to take the aref voltage into account with your ADC readings. For example, an LSB with a 3.3V aref is 3.3V/1023. I don't think it's that hard to use. For 3.3V, it's one wire and a call to analogReference().
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 6:59 pm

Re: ICSP pins on the Arduino Uno???

by westfw on Mon Feb 13, 2012 4:35 am

I don't think it's that hard to use.

You didn't mention the part where you should change the A-D initialization to NOT set the reference to VCC, which would result in shorting VCC to AREF. See section 21.5.2. I rate anything where the user should change the core code as "difficult." (IMNSHO, this is a brain-dead VREF design on Atmel's part. But it does allow for an external decoupling cap on AREF.)
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: ICSP pins on the Arduino Uno???

by philba on Mon Feb 13, 2012 1:09 pm

I thought the issue was simply setting the ARef to external (via analogReference(EXTERNAL)) during init and never changing it while the pin is connected to something other than Vcc. Is there a fuse relating to ARef? I didn't think so though I could well be wrong. If there is, then I have to agree with you.

I do agree that it's a land mine waiting to be stepped on and needs a big caution. The reference page on analogReference() really should have a warning. Though, there are plenty of ways to destroy a microcontroller.
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 6:59 pm

Re: ICSP pins on the Arduino Uno???

by westfw on Mon Feb 13, 2012 7:20 pm

There isn't a fuse, but the existing init() code will set things to use VCC as AREF. I'm not sure that any actual damage would be likely to occur in the few microseconds between init() and setup() (where you can set it to use the external pin for AREF), but it makes me nervous.
Last edited by westfw on Tue Feb 14, 2012 2:45 am, edited 1 time in total.
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 1:01 pm
Location: SF Bay area

Re: ICSP pins on the Arduino Uno???

by philba on Mon Feb 13, 2012 7:41 pm

I guess it doesn't bother me. Getting a decent, stable, noise free aref is definitely a good thing. For a thermometer, it's not so critical but when you are controlling something it definitely called for.
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 6:59 pm

Re: ICSP pins on the Arduino Uno???

by samacumen on Wed Feb 06, 2013 2:56 pm

Hi,

I need an urgent help. I have arduino uno and trying to use these exact same ICSP header for interfacing the micro SD card shield. I know I can do it directly via 10,11,12,13 pins on arduino and this works, however I want to be able to do it using ICSP header pins (this as per documentation, supplies the MISO, MOSI, CLK, RESET, VCC and GND pins).

Any help will be appreciated! My email is: shyambs85@gmail.com

God bless!
samacumen
 
Posts: 3
Joined: Wed Feb 06, 2013 2:26 pm

Re: ICSP pins on the Arduino Uno???

by adafruit_support_bill on Wed Feb 06, 2013 3:03 pm

Pin 1 is closest to the AREF pin.
Attachments
icsp_6pin.png
icsp_6pin.png (2.42 KiB) Viewed 4725 times
User avatar
adafruit_support_bill
 
Posts: 30840
Joined: Sat Feb 07, 2009 10:11 am

Re: ICSP pins on the Arduino Uno???

by samacumen on Fri Feb 08, 2013 3:13 pm

thanks, it works wonderfully. However, when I used the ICSP pins, I could not use the CS pin directly. I configured one of the output pins on the board as the CS pin. The other 5 pins of the ICSP (MISO, MOSI, Vcc, GND, CLK) could be used.

Shyam
samacumen
 
Posts: 3
Joined: Wed Feb 06, 2013 2:26 pm