I’m working up a Raspberry PI 3 add-on that gives the user a single 8 bit A/D channel. Over the last week I tried pushing this $2 adc chip as fast as possible via bit banging (no SPI here). Others have reported that they can toggle a GPIO pin fast enough to generate a clock in the high 20mhz range.
20khz at 600mv P-P
50khz
100khz
Here at 200khz you can see that data is starting to get lost
// The following code uses macros from http://elinux.org/RPi_GPIO_Code_Samples
for (samples=0 ; samples < kSampleCount ; ++samples)
{
GPIO_CLR = 1<<CS;
value = 0;
for (i=0 ; i < 16 ; ++i)
{
GPIO_SET = 1<<SCLK;
GPIO_CLR = 1<<SCLK;
if (i > 0 && i < 9)
{
bit = GET_GPIO(DIN) > 0 ? 1 : 0;
if (bit)
value |= 1 << (i-1);
}
}
GPIO_SET = 1<<CS;
sampleData[samples] = reverse(value); // Convert from MSB to LSB
}