Direct Port & Register Manipulation

If you have to toggle I/O pins, a write to PINx with the bits to toggle is the fastest way.

The register access is halfed, there is no if involved and the code is much smaller.

Thanks man

i also attach some nice articles

http://tronixstuff.com/2011/10/22/tutorial-arduino-port-manipulation/

Get yourself a cheap chinese clone of the analyzer to look at the timing yourself.

You can get them below 7 € shipping included and they work very good, at least mine does.

Whandall , what an incredible change ! very happy with the results.

i have a part in my code that does analogRead A6 and A7

for example
#define rssiPinA A6
#define rssiPinB A7

for (uint8_t i = 0; i < RSSI_READS; i++)
{
analogRead(rssiPinA);
rssiA += analogRead(rssiPinA);
analogRead(rssiPinB);
rssiB += analogRead(rssiPinB);
}

is there any possibility to use the manipulation in order to Read those pins Even Faster?

They are analog input only, they have to go thru the analog mux to get a reading. They don't have a digital input to take advantage of direct port manipulation.

You can take some steps to read them with less resolution, like 8 bits vs 10, if you are only looking for a high/low input.

what about that.....

http://www.microsmart.co.za/technical/2014/03/01/advanced-arduino-adc/