Page 2 of 2

Re: Esp32 Timer Problem

Posted: Tue May 25, 2021 9:25 am
by BenR
Hello,

Please can you post your program and we will investigate for you.

I've looked at DMA for the DAC and it looks possible, however you have to do it via the I2S DMA and we already know this has a problem at the moment. It's on our road map to fix this and get this working nicely so we will try and add DAC DMA support at the same time.

Re: Esp32 Timer Problem

Posted: Tue May 25, 2021 9:36 am
by LeighM
The ESP32 debug monitor might help.
To run it ...
Attach the ESP board to your PC USB.
Determine the COM port that is uses (see Device Manager)
Run the ESP-IDF Command prompt (should be on your PC desktop)
cd to your Flowcode project directory
type and run: idf.py -p COMx monitor
where COMx is your COM port e.g. COM10
You should then see debug output from the ESP board that should help you

Re: Esp32 Timer Problem

Posted: Tue May 25, 2021 1:51 pm
by Oscar_T
Thanks Leigh

i got confused with com ports. I keep the programming com port open with another program and this created the problem.

Once all the programs that used the com ports were closed everything was back to normal

Re: Esp32 Timer Problem

Posted: Tue May 25, 2021 2:43 pm
by Oscar_T
I'm sampling a signal with the adc port and sending the sampled signal as a float via uart. I also want to save the same value inside the esp32. (this way I can recover it if I have a problem with the pc)

I tried to use the lut table but without success..It appears that no new values ​​are added to the lut and it always remains blank

Re: Esp32 Timer Problem

Posted: Tue May 25, 2021 3:44 pm
by LeighM
Hi,
Lookup tables (LUT) are intended for fixed, not variable data.
You would need to use a data array, or a circular buffer.

Re: Esp32 Timer Problem

Posted: Tue May 25, 2021 5:41 pm
by Oscar_T
Hi Leigh

Yes, I have now implemented a circular buffer and everything works.

Is there a way to save data in esp32 (type eeprom) or do I have to use an external memory chip?

Re: Esp32 Timer Problem

Posted: Tue May 25, 2021 11:39 pm
by BenR
Hello,

It looks like you can use the ESP32 flash memory like EEPROM, I've found a library that does this so I'll have a go at porting this into Flowcode so you can do this using the EEPROM component.

Re: Esp32 Timer Problem

Posted: Wed May 26, 2021 12:18 pm
by BenR
Hello,

I've added some basic EEPROM functionality now to the ESP range of devices using the EEPROM component. Please note that the initial values property doesn't currently work and so I advise to keep this blank until if/when we can get this working too.

I've tested it and it seems to work well but let us know how you get on.

At the moment you can store 16-bit numbers, however there is scope to be able to store much more so let us know what else you would like to see.

Re: Esp32 Timer Problem

Posted: Wed Jul 20, 2022 11:25 pm
by MJU20
BenR wrote:
Wed May 26, 2021 12:18 pm
Hello,

I've added some basic EEPROM functionality now to the ESP range of devices using the EEPROM component. Please note that the initial values property doesn't currently work and so I advise to keep this blank until if/when we can get this working too.

I've tested it and it seems to work well but let us know how you get on.

At the moment you can store 16-bit numbers, however there is scope to be able to store much more so let us know what else you would like to see.
Great! Thank you.

I want to store a Float but these are 32bits.
Is there a way to do this with current component? There is a "WriteFloat" macro for the EEPROM in the making?

Re: Esp32 Timer Problem

Posted: Thu Jul 21, 2022 5:06 pm
by BenR
Hello,

You can use the type conversion component to take a float and then get two 16-bit or four 8-bit binary values which you can store into the EEPROM.

To pull back out from the EEPROM do the oppsite, load the binary values and then pass back through the type conversion component to regain your float value.