Hi Rocco, hi guys.
The application of Camilo is tricky and his short video is really impressive but the answer to the Rocco's question is still "no". A HC9S08 cannot perform 40kHz sample 8bit FFT "real time" at any clock speed up to 40 or 50MHz (20/25MHz busclock).
Camilo instead shown it may perform a "live" Audio Analyzer with 20 kHz band and 64x8bit samples giving 16 or 32 frequency output lines up to 20kHz windowed or unwindowed.
To do that you do not either need a lot of resources: any small 9S08 MCU with at least 512B RAM and 8kB flash can do the job at 20MHz busclock or even at 10MHz, so much less powerful than a 9S08GT60 at full speed. I guess than a 1.12$ (Digikey/100pcs) 16 pin 9S08SH8CTG running at 20MHz or even a less powerful 0.88$ (Digikey/100pcs) 16 pin 9S08QB8CTG running at 10MHz could do the job, in the same electrical diagram of Camilo, with some pins left unused... I will explain how.
-------------------
Performing a basic 256x8bit FFT on a 20MHz BusClock 9S08 MCU requires at least:
- 6.4ms sample time (256 samples, 40ks/s)
- ~25ms FFT calculation elapsing time (full 8 bit signed precision, 37-40dB dynamic range on output)
- 512B RAM (+256Bytes if the output array should not cover the input data which isn't usually required)
- <1kB FLASH ROOM, including tables
To perform the same duty with 64 samples, some process and LCD display on 2x16ch display you'll need approx (same clock):
- 1.6ms sample time (64 samples, 40ks/s)
- ~5ms (25/(2*2*(8/7)*(7/6)) FFT calculation elapsing time for 32 sample output frequency lines 0-20kHz
- ~1ms output processing and formatting
- ~2.5ms LCD display
- 256B RAM keeping separate 4x64B input, output and elaboration vectors
- <1kB FLASH ROM, including tables for FFT and <2kB for the whole application
From this calculation you may easily see you need some 10ms for a full upgrade of the display. Being the display vs. sample time some 4:1 this is not "real time" (there is some 3/4 of the time in which the input is ignored) but a real "live" application which is not practically discernible from "real time" for our purpose. I do not take in count massive processing during the ADC sample time which cannot anyway make a real difference (less than 10%).
From my experience there is not a visible improvement on upgrading an alphanumeric display more than 10 times/s, i.e.. every 100ms. From this derives that even slowing the busclock to 10MHz or even 5MHz you may be able to display 20 or 10 screens/s with "a lot of time" to perform other tasks. Obviously the sample time would be only 1/35 or 1/70 of the "real time" but nevertheless for practicaly anybody you would not see any difference from 100%.
All assumptions are valid for good Assembly program. I do not know how C would perform, but I would not be surprised that it was (badly?) worse if not very well designed...
Salvatore