Is the Micro kinda weird?

My wife bought me a Radio Shack version of the Arduino Micro for Valentine's Day ( a woman who really knows my heart). When I saw its small size and ready adaptability to solder right to a circuit board, I decided to replace an Uno in my current project with the Micro. Of course, there are differences in interrupts, timers, etc. and I figured those out to the extent I needed to migrate my software..

But what is weird to me that digital pin 3 wont accept a 100 Hz blink routine (according to oscilloscope), while pin 13 does. The software used was the same, except for renaming the pin from 3 to 13. I had some problem with pin 5 also, which didn't seem to want to function as a digital output. (And yes, I established output with pinMode()).

Of course, various pins have multiple functions, but with the Uno, every digital pin is first and foremost a digital pin. So I'm wondering if the Micro requires some additional instructions to establish the function of some pins.

Thanks in advance for any insights.

John Doner

@John, I move between the 328 and the 32U4 fairly often and I have not seen this problem. The pins_arduino.h should map digital and analog pins so that the two separate uCs generally should be compatible.

Maybe some other members will have additional insight.

Ray

Posting your code for us look at, might speed up the help we can give.

The code was dead simple:

void setup() { pinMode(3, OUTPUT); }

void loop() { digitalWrite(3, HIGH(|); delay(5); digitalWrite(3, LOW); delay(5); }

which didn't work. But when '13' is substituted for '3', it did deliver a 100 Hz. square wave.

Change digitalWrite(3, HIGH(|); To digitalWrite(3, HIGH);

Are you sure you are counting the pins correctly?

D0, D1, D2, D3 . . .

digitalWrite(3, HIGH(|); won't even compile, so this is not the actual code.


Rob