Thank you for your replies.
As to my background, I learnt electronics; I used to fix electronic circuits and I used to design electronic circuits but very many years ago. Now I develop software.
I know to look at the Internet and read documents however this takes time. Before I start spending the time I wanted to know the capabilities of this microcontroller called Arduino.
With respect to my needs (or what circuit I want to build), at this stage my questions were general in nature just to better understand this device. To the best of my understanding Arduino really works in a loop, one pin at time which due to the frequency appears to be simultaneous control. Please correct me if this is wrong.
A general question - what if my external electronic circuit requires a parallel bus as input so that all pins change simultaneously. In this case all output pins need to change at the same micro second. Is this achievable with Arduino (perhaps with additional 'add-on' boards)?
"The Mega has 54 digital pins" -->> The Mega has 70 digital pins. 16 of them may also be used as analog inputs. Up to 8 can be changed at one time with a PORTx statement:
PORTx = 0b01010101; // binary bits
PORTx = 0x55; // or hex
PORTx = yourValue; // variable from somewhere
PORTx= yourArray[index]; // element from an array
"my external electronic circuit requires a parallel bus as input so that all pins change simultaneously" This board, controlled by a 328P (same chip as the Uno) has 96 outputs for example.
You load the 12 bytes for the output, and a 2nd clock signal updates all outputs together. It is hardwired for SPI.transfer:
digitalWrite (ssPin, LOW);
for (x=0; x<12; x=x+1){
SPI.transfer[yourArray[0]]); // array of 12 bytes
}
digitalWrite (ssPin, HIGH); // all outputs update on this rising edge
spycatcher2k has me beat with 500. I've done another design for up to 45 shift registers, with 360 outputs.
So yes, lots of outputs can be updated simultaneously. The board above is daisychainable, so many more outputs can be controlled by the one processor.
Menashay:
A general question - what if my external electronic circuit requires a parallel bus as input so that all pins change simultaneously. In this case all output pins need to change at the same micro second. Is this achievable with Arduino (perhaps with additional 'add-on' boards)?
You can change 8 pins of the "bigger" AVR's in a single 62 ns cycle. In 1 us you can change 4 ports and have cycles left over.
Still at high frequency events the AVR's hit limits. Minimalist sketches can run loop() at over 110K but not much faster.
We have 2 clock functions that return 32-bit unsigned values, millis() and micros(). Micros() is good to 4 us, it takes that long to get the 4 times word length value --- which should serve to show practical limits of the chip. You can time closer counting fixed-cycle loops but that's it.
If you write tight code you could get reasonable responses to inputs started in 100 us or less. I have some serial input code that tasks in on average <40 us steps, no big surprise as that's 640 cycles on an 8-bit RISC cpu.
If you need much more speed, look into the ARM chip Arduinos and compatibles. Some run well under $20.