I’ve recently acquired an Arduino Micro and I’m confused by the number of I/O pins stated on the website (20 pins) vs. what I’m able to see in the schematics and pin-out diagram (24 pins). Are the MOSI, SS, MISO and SCK-pins not useable for digital I/O?
Nothing in the datasheet hints in that direction and the pins_arduino.h file makes them useable for digtalWrite/Read etc. too and counts D23…0:
// Map SPI port to 'new' pins D14..D17
static const uint8_t SS = 17;
static const uint8_t MOSI = 16;
static const uint8_t MISO = 14;
static const uint8_t SCK = 15;
//[...]
// On the Arduino board, digital pins are also used
// for the analog output (software PWM). Analog input
// pins are a separate set.
// ATMEL ATMEGA32U4 / ARDUINO LEONARDO
//
// D0 PD2 RXD1/INT2
// D1 PD3 TXD1/INT3
// D2 PD1 SDA SDA/INT1
// D3# PD0 PWM8/SCL OC0B/SCL/INT0
// D4 A6 PD4 ADC8
// D5# PC6 ??? OC3A/#OC4A
// D6# A7 PD7 FastPWM #OC4D/ADC10
// D7 PE6 INT6/AIN0
//
// D8 A8 PB4 ADC11/PCINT4
// D9# A9 PB5 PWM16 OC1A/#OC4B/ADC12/PCINT5
// D10# A10 PB6 PWM16 OC1B/0c4B/ADC13/PCINT6
// D11# PB7 PWM8/16 0C0A/OC1C/#RTS/PCINT7
// D12 A11 PD6 T1/#OC4D/ADC9
// D13# PC7 PWM10 CLK0/OC4A
//
// A0 D18 PF7 ADC7
// A1 D19 PF6 ADC6
// A2 D20 PF5 ADC5
// A3 D21 PF4 ADC4
// A4 D22 PF1 ADC1
// A5 D23 PF0 ADC0
//
// New pins D14..D17 to map SPI port to digital pins
//
// MISO D14 PB3 MISO,PCINT3
// SCK D15 PB1 SCK,PCINT1
// MOSI D16 PB2 MOSI,PCINT2
// SS D17 PB0 RXLED,SS/PCINT0
Ahhh, I just noticed that the Leonardo – unlike the Micro – doesn’t lead the MISO, MOSI, SS and SCK pins to the outside (except for the ICSP-header). So probably just a simple copy&paste mistake in the description page?
Are the MOSI, SS, MISO and SCK-pins not useable for digital I/O?
Do you know what those abbreviations mean ?
Ahhh, I just noticed that the Leonardo – unlike the Micro – doesn’t lead the MISO, MOSI, SS and SCK pins to the outside (except for the ICSP-header). So probably just a simple copy&paste mistake in the description page?
No .it's not. they are on the ISCP 6-pin header on the end of the board opposite the end with the USB.
you can get a board labeled micro, nano or mini on e-bay and all get the exact same board. and not one having the pin-out that matches the official version.
google arduino micro and look at the official data sheet.
if your board does not look like that, exactly like that, then your 'clone' may be different and probably is.
that official data sheet will give you a clue to what you can do.
if your board is not an official board, then google arduino micro pin out and see what you might have.
as raschemmel pointed out, pins on the board may be connected to other pins. just because there is a separate connector does not mean is is a separate circuit.
Are the MOSI, SS, MISO and SCK-pins not useable for digital I/O?
Do you know what those abbreviations mean ?
Yes, they are for SPI. But I can’t find anything in the ATMega32U4’s datasheet telling me I can’t use them as simple digital I/Os. The SPI functions are just listed as „Alternate Functions of Port B“ in the I/O Chapter.
first off, are you talking official micro?
Yes.
Edit: Using an external programmer would restrict the use of those pins of course.
@Mike1,
What I mean is that if you know about SPI then you know those labels are irrelevant unless you included the SPI library in the sketch. Otherwise, they are just digital pins like any others. The flip side of that coin is you can't use them for anything else when
you're running a SPI app. Pin 10 is sometime s an SD chip select and it has to be reassigned if your using SPI.