Page 1 of 2

Esp32 Timer Problem

Posted: Thu May 20, 2021 8:33 am
by Oscar_T
Hi

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

Kind regards

Re: Esp32 Timer Problem

Posted: Thu May 20, 2021 9:16 am
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.

Re: Esp32 Timer Problem

Posted: Thu May 20, 2021 10:14 am
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

Re: Esp32 Timer Problem

Posted: Thu May 20, 2021 11:06 am
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.

Re: Esp32 Timer Problem

Posted: Thu May 20, 2021 1:33 pm
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 ...

Re: Esp32 Timer Problem

Posted: Thu May 20, 2021 3:59 pm
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.

Re: Esp32 Timer Problem

Posted: Thu May 20, 2021 5:28 pm
by Oscar_T
Do you think we can test for DMA channels?

Re: Esp32 Timer Problem

Posted: Fri May 21, 2021 9:56 am
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?

Re: Esp32 Timer Problem

Posted: Fri May 21, 2021 11:06 am
by Oscar_T
Hi Ben

Internal Dac!

Kind regards

Re: Esp32 Timer Problem

Posted: Mon May 24, 2021 6:46 pm
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.