Chat freely about anything...

User avatar
By Bill Gray
#47567 Hi,

I know I'm not the only one here looking to build projects that require reasonable strict timing for one reason or another.

I'm really interested in frequency measurement and waveform generation.

This appears to be difficult to do on the esp8266 in a high fidelity way... or at least I haven't found examples that make it clear how to do these things. For example, PWM appears to be limited to a base frequency of 1kHz. I guess this is cool for dimming leds, but it leaves quite a lot to be desired.

I've been poking around on this question, and I've found an example that claims to be able to play MP3s streamed over the internet using the I2S module.

https://github.com/espressif/ESP8266_MP3_DECODER

I've not super familiar with I2s generally, but based on my reading it appears that in order to use I2S you need to be able to generate output with strict timing. The example claims to work with bitrates of 320kBits/s. This translates to an I2S clock-rate of 2.5Mhz! Much better than 1kHz.

Ok, so this indicates that the ESP8266 is fully capable of generating and reading signals with pretty good timing characteristics, but as I read through the I2S example, I can't see how they are doing it?

Does anyone have any idea what is going on here? Has anyone figured out how to do things (like read from an SPI ADC) regularly and repeatably?

Thanks so much.

Bill
User avatar
By lethe
#47585
Bill Gray wrote:I've not super familiar with I2s generally, but based on my reading it appears that in order to use I2S you need to be able to generate output with strict timing. The example claims to work with bitrates of 320kBits/s. This translates to an I2S clock-rate of 2.5Mhz! Much better than 1kHz.

Actually it's much faster than that, apparently it can run at up to 80MHz...

Ok, so this indicates that the ESP8266 is fully capable of generating and reading signals with pretty good timing characteristics, but as I read through the I2S example, I can't see how they are doing it?

You should check out cnlohr's stuff, he abused the I2S hardware for all sorts of fun hacks:
http://hackaday.com/2016/04/01/ethernet ... e-esp8266/
https://github.com/cnlohr/espthernet
https://github.com/cnlohr/esp8266duplexi2s
https://github.com/cnlohr/channel3
https://github.com/cnlohr/esp8266ws2812i2s