Robin2:
casemod:
I figured that out the hard way 
I don't understand your comment ???
It wasnt simple to find all the required information in one place. Even the AVR foruns base most of the examples in a single sampling. There are also commands that work on the AVR compiler but not on the arduino, so i spent a lot of time digesting all the information - In Short as you say its not easy to understand without spending some time looking at it, then there's the fact the code wasnt finished. Check below.
Robin2:
casemod:
I was. Aparently the free running mode is only suitable for one channel. Long story:
SNIP
resets it back to zero and the whole cycle begins again.
And when you do explain what you are doing it is easy to make sense of your code
Of course, but I could not explain 100% until I had the code finished. Got to keep my options open and try it different ways.
Robin2:
casemod:
As with many of my projects the intent is to see how far I can optimize the arduino code for whatever it might take. Sampling 6 analog channels in a row consumes a LOT of time.
On this particular case it is to make a rudimentar square wave signal generator (this topic, right) but i certainly will have better uses for this in the future.
The problem I have is that it makes little sense to read 6 analog channels to drive a square wave generator.
I suspect if you tell everyone what the ultimate "better uses ... in the future" will be you would get the best advice.
Jiggy-Ninja:
I still say you don't need to sample the pots that quickly if this is part of a human interface. Sampling each pot every 100 ms is good enough.
I have found an issue that bothered me with the arduino libraries. Some people are fine with that, I am not.
So it only made sense to find for a solution, which I could not find. So the next step is to make my own code, which i did. Why not acept the contribution to the forum and be happy with that?
I dont plan to read 6 channels. I posted a code that can read 6 channels and could easily be modified by changing the ADC_CHANNELS field, just dont mix this function with the arduino Analogueread. The code also allows oversampling and I found a few threads on the forum with people looking at how to implement that.
The better uses is up to the judgement of the designer. I can think of a whole lot of applications where I need fast sampling and cant afford to stop my code until the ADC results are retrieved. It also serves as a programming exercise. Arduino is cool, but i dont plan to use it forever. I am happy that I can made a quick and dirty "sketch", but the layer of abstraction is something i like to understand, and if necessary, be given the option to avoid as it locks many functions under the hood.
Robin2:
And people had been trying to assist with your square wave generator (the Thread title) when the goal posts move and the problem of the time to read ADCs interfering with square wave timing is introduced.
True I should have opened another thread.
Jiggy-Ninja:
Use the timers and interrupts for your square wave generation code. That way you won't have to bother with micros timing in your loop, and it won't be affected by the A/D conversions.
Thats today's exercise. One thing at a time 