What is the maximum of bits that an Arduino can read on the digital input, which model in the Arduino range can read the most bits?
-
A single digital pin can only ever be either on or off.Ignacio Vazquez-Abrams– Ignacio Vazquez-Abrams02/15/2016 09:20:22Commented Feb 15, 2016 at 9:20
-
3Sounds like an X-Y problem - what are you really trying to solve?Nick Gammon– Nick Gammon ♦02/15/2016 10:17:16Commented Feb 15, 2016 at 10:17
-
Ah, GrassHopper.... when you can answer my question, you will know the answer to your own... How big is a bit?lornix– lornix02/18/2016 06:52:48Commented Feb 18, 2016 at 6:52
2 Answers
What is the maximum of bits that an Arduino can read on the digital input, which model in the Arduino range can read the most bits?
A digital input is by nature binary (i.e. a single bit). The answer to your question is therefore one bit per digital input.
The total number of digital inputs depends on the board. It ranges from Arduino Micro (which has fewest less with than 10) to Arduino Mega which has the most with more than 60).
Another possible interpretation of your question is the resolution of an analog pin (ADC). The AVR has max 10 bit resolution.
Cheers!
Do you mean simultaneous read or write? The AVR processors are 8-bit processors and their I/Os are grouped into 8-bit registers. If you configure all of the bits in a register to the same direction - all inputs or all outputs - then the entire 8 bits could be read/written at once. in C/C++ you would use the `PORTWhich I/Os are assigned to which register is designed into the chip - but the data sheet describes which physical pins are connected to which I/O register. You can take advantage of that to make use of a single register's-worth of pins for up to 8 signals that need to be set or read simultaneously.