Esp32 Timer Problem

Any bugs you encounter with Flowcode should be discussed here.
Oscar_T
Posts: 89
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Esp32 Timer Problem

Post by Oscar_T »

Hi

I can't compile the program. I found that if I remove the timer component the program compiles.

Kind regards
Attachments
Flowcode1.fcfx
(17.43 KiB) Downloaded 163 times

LeighM
Valued Contributor
Posts: 398
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 70 times
Been thanked: 212 times

Re: Esp32 Timer Problem

Post by LeighM »

Hi,
Looks like the Timer component is not yet compatible with ESP.
Can I suggest that you use a Timer Interrupt instead.
That can then call a macro/function that increments global variables to give you your timed events.

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, now it's working!

Can you explain the timer period parameter (256 and 1000) what it refers to?

Now I have set 256 and seconds

Kind regards

LeighM
Valued Contributor
Posts: 398
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 70 times
Been thanked: 212 times

Re: Esp32 Timer Problem

Post by LeighM »

Glad you have it working :D
It's a generic drop box, but you can enter any value for the time period (time between interrupts), as you have found.

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

Now i've another question

I am trying to use the esp32 module to create a small test station. I need to generate a sine wave and I succeeded.

the problem is that the output is not stable and therefore every few seconds I find a glitch on the sinus. I tried to generate the wave in different ways but even putting it in the main loop I always have the same problem.

It almost seems that the output of the dac stops ...

LeighM
Valued Contributor
Posts: 398
Joined: Mon Dec 07, 2020 1:00 pm
Has thanked: 70 times
Been thanked: 212 times

Re: Esp32 Timer Problem

Post by LeighM »

I think the problem here could be that ESP runs an RTOS.
That's not ideal for signal generation due to task scheduling.
I think that DMA might be possible, but I've not tried it.

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 »

Do you think we can test for DMA channels?

BenR
Matrix Staff
Posts: 1734
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 439 times
Been thanked: 603 times

Re: Esp32 Timer Problem

Post by BenR »

Hello,

What are you using the output the sine wave, is it the internal DAC or PWM or is it via an external comms device?

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 Ben

Internal Dac!

Kind regards

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 have a strange problem with esp32 boards.

It looks like they are programmed but fail to boot ...

I have 3 boards (1 wroom-32 and 2 wroom-32d) and all three are doing the same joke

The version is esp32_devkitc_v4, clicking the two physical buttons nothing happens.

Post Reply