Porting to ESP32

Post Reply
User avatar
thornogson
Posts: 60
Joined: Sun Mar 15, 2020 10:04 am
Location: United Kingdom
Been thanked: 1 time

Porting to ESP32

Post by thornogson »

Hi guys, I have been thinking about the ideal next gen,all-singing, all-dancing plug and play inverter brain (particularly for Toyota inverters) whilst fiddling about with a number of microprocessors, has anyone considered porting Johanes's software to the ESP32 chip ?
Because ....
it has 2 separately addressable cores,
runs at 160 or 240 MHz ,
has 448 KB ROM and 520 KB SRAM
Built in Analog to digital and digital to Analog converters
Onboard Bluetooth, UART and wifi,
masses of IO pins , and it's absurdly cheap

There seems to be plenty of hardware real estate for future developments in a tidy $10 package
We are all ignorant, just about different things. If y'aint learnin', y'aint livin'
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Porting to ESP32

Post by johu »

Just skimmed over the data sheet, specifically the timer.
Also checked libopencm3, that doesn't support it. Well it's not a CM3 so no surprise. So either that is added or some other HAL is used.

The timer is capable, it has 6 outputs with deadtime generation. It has two ADCs so one could be used for the scan channels and the other one-shot triggered for resolver.

I think it also has CAN, just they call it TWAI :) probably to circumvent license fees.

Also the web interface could be integrated on chip.

So it's definitely possible and quite interesting :)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
collin80
Posts: 110
Joined: Sun Aug 30, 2020 3:28 pm
Location: United States, Michigan
Been thanked: 4 times
Contact:

Re: Porting to ESP32

Post by collin80 »

thornogson wrote: Fri Apr 09, 2021 8:25 am Because ....
it has 2 separately addressable cores,
runs at 160 or 240 MHz ,
has 448 KB ROM and 520 KB SRAM
Built in Analog to digital and digital to Analog converters
Onboard Bluetooth, UART and wifi,
masses of IO pins , and it's absurdly cheap
Two cores? Check! Though, you will have trouble with wifi if you start trying to use them both too heavily.
Lots of RAM and FLASH? Check!
Built in ADC and DAC? Yeah, pretty much all processors do
Onboard BT, UART, Wifi? Yep. You can even do BT and WiFi at the same time
Masses of... wait... Are we talking about the same chip here? It has a PITIFUL number of I/O pins. Most all of them get used up by the need for external FLASH and a few other things. My biggest complaint about the ESP32 is how pin limited it really is. I have never heard anyone say that they think the ESP32 has a lot of I/O pins.
Absurdly cheap? Yes, yes it is.
davefiddes
Posts: 211
Joined: Mon Jan 18, 2021 12:39 pm
Location: Edinburgh, Scotland, UK
Has thanked: 14 times
Been thanked: 35 times

Re: Porting to ESP32

Post by davefiddes »

I've used the ESP32 for a few projects. It's a great chip but has many limitations. In particular it's really difficult to get hard real-time deterministic interrupt handling. This is because of the SPI connected program flash and layers of cleverness to make it transparent. You have to carve out chunks of SRAM and copy your code there. The ADC and DAC are pretty basic and noisy. It's really aimed at IoT applications.

An ESP32 would make a good secure multi-CAN/serial interface though.
User avatar
johu
Site Admin
Posts: 5681
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 959 times
Contact:

Re: Porting to ESP32

Post by johu »

Ok, that does not sound too promising. In-deterministic latency in a real time application is asking for trouble. Noisy ADCs don't help either.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Post Reply