Esp32 Timer Problem

Any bugs you encounter with Flowcode should be discussed here.
BenR
Matrix Staff
Posts: 1707
http://meble-kuchenne.info.pl
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Esp32 Timer Problem

Post 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.

LeighM
Valued Contributor
Posts: 394
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 69 times
Been thanked: 208 times

Re: Esp32 Timer Problem

Post 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

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: Esp32 Timer Problem

Post 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

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: Esp32 Timer Problem

Post 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

LeighM
Valued Contributor
Posts: 394
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 69 times
Been thanked: 208 times

Re: Esp32 Timer Problem

Post 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.

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: Esp32 Timer Problem

Post 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?

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Esp32 Timer Problem

Post 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.

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Esp32 Timer Problem

Post 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.

MJU20
Posts: 237
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 75 times
Been thanked: 50 times

Re: Esp32 Timer Problem

Post 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?

BenR
Matrix Staff
Posts: 1707
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 435 times
Been thanked: 598 times

Re: Esp32 Timer Problem

Post 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.

Post Reply