Ports C D & E

I think, but I am not sure, that I can use all bits of the three ports as input and output?

Port B has 6 bits
Port C has 6 bits
Port D has 8 bits

Is that true? I don't need MISO and MOSI etc so presumably those 4 bits become free for me to use in Port B.

Basically my question is, can I use all bits of all three ports as digital IO as long as I configure them properly, or is there some hardware of the Arduino which prohibits this?

You can use all of those ports for digital IO as long as they are not being used for something else (Port D pins 0 and 1 are connected the hardware serial port)

You can easily access all of those ports as arduino pins 0 through 19

Many thanks for the help.

And my subject line was inaccurate too. Port E indeed!

Have you seen this:-

I don't need MISO and MOSI etc so presumably those 4 bits become free for me to use in Port B.

These are B3 and B4 so they are counted already. You can't use B6 & B7 as they are used for the crystal. And there is only C0 to C5 brought out.
So there is no 8 bit port at all.

Thanks for that link, it was just what I wanted.

So, for the Arduino DueMilaNove
Port B the lower six bits are available for digital IO
Port C the lower six bits are available for digital IO and analog input
Port D the upper six bits are available for digital IO

It seems that sometimes the docs say pin0 when they mean bit0...?

It seems that sometimes the docs say pin0 when they mean bit0...?

Pin0 is bit0 on port D

Is there a reason you are not using the Arduino pin numbers?

I'm not yet using the Arduino pin numbers because I'm thinking in general about data sizes and so on.