Go Down

Topic: Arduino Micro PORTD problem (Read 785 times) previous topic - next topic


I have a Micro that seems to work ok, that is until I tried using port instructions.

I set D0-D7 to OUTPUT.
My D5 pin doesn't respond when written to with  PORTD = B11111111;
I back-tracked and digitalWrite(5,255)    works just fine.
Is there a problem in firmware?
Did I get a Dud from Radio-Shack?


Jan 28, 2013, 02:54 am Last Edit: Jan 28, 2013, 05:21 am by retrolefty Reason: 1
On your arduino Micro board the chip ( 32U4 ) the arduino pin 5 maps from port C bit 6, not the D port. At least that is what the schematic drawing shows.

Edit: corrected link


James C4S

Lefty, I think you pasted the wrong link.

Did I get a Dud from Radio-Shack?

Since digitalWrite() eventually uses the same registers you are trying to use to "write" to the ports, I don't see how it could be a "dud".

Of course as Lefty points out, digital pin 5 isn't on PORTD.  It's on PORTC.

Is there a problem in firmware?

What firmware?
Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com


This appears even more useful:



Go Up