Arduino Micro PORTD problem.
Moderators: adafruit_support_bill, adafruit

Arduino Micro PORTD problem.

by aramsdell on Sun Jan 27, 2013 9:01 pm

Tonight I began trying to use PORT instructions on my Micro.
I set D0-D7 as OUTPUT. Then I tried the following.
PORTD = B11111111
It sets all of the D0-D7 EXCEPT D5. D5 remained low.
digitalWrite(5,HIGH) works just fine though.


DID I GET A DUD?
Is there a firmware prob?
Alan :?:
aramsdell
 
Posts: 4
Joined: Sun Jan 27, 2013 8:50 pm

Re: Arduino Micro PORTD problem.

by westfw on Sun Jan 27, 2013 9:35 pm

"Digital Pin 5" is NOT connected to port PD5. PD5 is the yellow TX led.
The other digital pins are probably not connected where you expect them, either. See the schematic. Arduinos in general are not set up to make port IO "easy."
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 12:01 pm
Location: SF Bay area

Re: Arduino Micro PORTD problem.

by aramsdell on Sun Jan 27, 2013 9:54 pm

I jsut found this. http://arduino.cc/en/uploads/Main/ardui ... ematic.pdf

Does this mean Port D bit 5 is not available?
aramsdell
 
Posts: 4
Joined: Sun Jan 27, 2013 8:50 pm

Re: Arduino Micro PORTD problem.

by westfw on Mon Jan 28, 2013 5:13 am

Correct. Port D bit 5 is not available.
This is apparently exactly compatible with Leonardo, btw.
User avatar
westfw
 
Posts: 1373
Joined: Fri Apr 27, 2007 12:01 pm
Location: SF Bay area

Re: Arduino Micro PORTD problem.

by aramsdell on Mon Jan 28, 2013 11:24 pm

Thank you for your help.
Alan
aramsdell
 
Posts: 4
Joined: Sun Jan 27, 2013 8:50 pm

Re: Arduino Micro PORTD problem.

by floresta on Thu Jan 31, 2013 10:01 pm

The other digital pins are probably not connected where you expect them, either. See the schematic. Arduinos in general are not set up to make port IO "easy."

The DC Boarduino is an exception, the eight bits of Port D are conveniently lined up along with a pair of power pins right next door. The pins for the other ports are grouped together as well.

Don
floresta
 
Posts: 221
Joined: Thu Jul 31, 2008 9:27 am
Location: Western New York, USA

Re: Arduino Micro PORTD problem.

by aramsdell on Fri Feb 01, 2013 8:38 pm

Hi Don, Thanks for posting. I figured how to do what I wanted with PORTD. I'm putting together a POV display and using the micro for brains. Luckily for me I was only planning on using a 5 x 7 character font. I used D0,1,2,3,4,6,7. I grabbed an example program from somewhere here online but the character deinitions were off. They must have been for a board with all of PORTD available. I rewrote the defs for my needs by shifting bit 5 and 6 up to positions 6 and 7 and not wanting to flash the Tx led I made that bit = 0 all the time. I will probably still have to edit a little once I get this going.
Alan
aramsdell
 
Posts: 4
Joined: Sun Jan 27, 2013 8:50 pm