Go Down

Topic: Arduino Micro PORTD problem (Read 647 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?
Al

retrolefty

#1
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
http://arduino.cc/en/uploads/Main/arduino-micro-schematic.pdf

Lefty

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

retrolefty

This appears even more useful:

http://arduino.cc/en/Hacking/PinMapping32u4

Lefty

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy