Configuring Digital I/O on Mega 2560

I want to configure Port A,pins 0-7, as digital inputs - WITH THE INTERNAL PULL-UP RESISTOR. I want to do a byte write to the DDRA, and then a byte write to PINA The Pseudo code to do this is:

write 00h, DDRA ; write 0's in all bits of DDRA, config IC pins as inputs write ffh, PORTA ; write 1's in all bits of PORTA, configure the internal pullups on the 2560

How do I do this in Arduino speak?

Thank you....

-J

Why? That would take much more code.

Anyhow, you need pinMode() and digitalWrite() and a loop.

Have a look at direct port manipulation

madworm: Why? That would take much more code.

Anyhow, you need pinMode() and digitalWrite() and a loop.

I see that it is inefficient, which is why I asked the question.

Um, digitalWrite() ???? does doing that enable the PU? if so, can you point me to where that is documented?

Thanks J

AWOL:
Have a look at direct port manipulation

A little help…WHERE is the reference of which you speak?

TY

-J

Have you thought of using the search facilities?

three_jeeps:

AWOL: Have a look at direct port manipulation

A little help....WHERE is the reference of which you speak?

TY

-J

This gives the basic commands to use:

http://www.arduino.cc/playground/Learning/PortManipulation

This mapping shows the port/pin numbers Vs Arduino pin numbers:

https://spreadsheets.google.com/pub?key=rtHw_R6eVL140KS9_G8GPkA&gid=0

Lefty

retrolefty: This gives the basic commands to use:

http://www.arduino.cc/playground/Learning/PortManipulation

This mapping shows the port/pin numbers Vs Arduino pin numbers:

https://spreadsheets.google.com/pub?key=rtHw_R6eVL140KS9_G8GPkA&gid=0

Lefty

Much appreciated! TY! -J

AWOL: Have you thought of using the search facilities?

Of course, but it would be more efficient (and a little more helpful) if the person/expert who knows where the definitive reference is located to offer a pointer, thereby reducing the number of dead ends global searching tends to uncover.

In any case, thank you for your 'help'.

-J

You were given pretty precise search terms. More 'efficient' for who?

AWOL: You were given pretty precise search terms. More 'efficient' for who?

For me of course, because I am relatively new with this programming language and some of the very strange wording for some of the concepts (e.g. 'shields'!?!?!?!?), and had no clue that your words were so precise. Perhaps a less laconic answer would have been more direct: e.g. search the arduino site for "direct port manipulation."