Arduino Micro board

Hello Guys,

I need 20 Digital I/O pins for my project, but the board should be as small as possible.I have chosen Arduino Micro. If you see the Arduino Micro product page, it says it has 20 digital I/O pins. My doubt is it has MISO, Rx-LED MISC, and SCI. Can I use them as Digital I/O pins? If I want to use them for blink program what pin number should use them in program? Weather LED blink program works with those pins or not?

please help me out and give me some suggestions. My project needs 20 Digial I/O and 3 Analog pins.

http://www.arduino.cc/en/Main/arduinoBoardMicro

Capture.PNG

So you need PB0,1,2,3
According to this, they are 8-9-10-11

http://pighixxx.com/micropdf.pdf

So, I can connect any sensors or LEDs to those pins? Any example codes please? I really appreciate your help.

I don’t see “MISC” or “SCI”. And you didn’t list MISO or SCK. :slight_smile:

Yes you can use them as generic inputs or outputs. No, they are not 11-12-13 like they are on the UNO. The pin numbers that Crossroads gave are the physical pin numbers on the actual ATMega32U4 chip, which is not very useful for the Arduino programmer.

What is useful, is the Arduino environment defines macros for SCK, MISO, MOSI and SS. You can use these names to refer to those pins, for example, digitalRead(SCK). Neat! You can actually call it by the label which is on the board. This also works for the analog pins: digitalRead(A0)

The only part where this labelling falls down is TX and RX, You must call them 1 and 0, like they are labelled on all the big Arduino boards.

You might find yourself in the situation where you need 21 pins. Then you need a port expander or shift register. Or maybe find a display that works by serial or I2C insteadl of taking up a lot of pins for the LCD.

It took me a while to track down the TX LED macros. If you aren't transmitting serial data over the USB then it can be used as an indicator LED. Since it's not available on any external pin (unlike the RX LED, which is the SS pin) then digitalWrite() has no mappings for it.

But the variant header file does define some macros that will let you use it. TXLED0 turns it off and TXLED1 turns it on. Here's a Blink sketch which uses that LED:

void setup() {
}
void loop() {
  TXLED1;                   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  TXLED0;                   // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}

You don't need to tell pinMode() to make it an output, because that's done by the background Arduino code.

Hi,

So, I can connect any sensors or LEDs to those pins? Any example codes please? I really appreciate your help.

What sensors are you aiming to use?
What is your application that needs such a small physical footprint.

Tom.... :slight_smile: