- Fri Feb 02, 2018 3:31 am
#73643
wogoos wrote:Why not use a single chip Atmega328 as General purpose IO controller and hook that one up to an ESP. All Your have all possible interfaces available and can do the prepossessing on the Atmega. Simple and easy.
I have considerded this several times over the past few times. I have some 328's lying around and also a programmer (no Arduino in this house!). I have been maintaining a suitable firmware for it as well, that can read and interprete a variety of i2c sensors.
Why didn't I persuit this path: the esp8266 can do everything I need. It lacks quite a bit that a 328 has in hardware, but the faster cpu core (32 bits 80 or 160 Mhz vs. 8 bits 8-20 Mhz) makes up for that.
I made an implementation of PWM in software that just as good as the hardware implemention in the 328, in most situations. Besides that, you can get to choose your GPIO's freely and you can have up to 32 channels, where the 328 can only have two at 16 bits and two at 8 bits. For a reasonable speed at 16 bits with the 328, you need to have the cpu running at 16-20 Mhz, which it can do only at 5 V. The esp8266 has no trouble there.
The same goes for the I2C interface. I made an implementation in software and it works really great. In no way it has less functionality than the hardware implementation of the 328 and is more flexible and easier to use. I only think the 328's I2C clock can be cranked up even more, the highest I can get is somewhere around 500 kHz (which is already too fast for normal and fast I2C), the 328 might be able to get that to some 2 Mhz.
So then the question remains, what are we still missing that the esp8266 can't implement in software?