Search found 1605 matches

by MicroController
Thu Oct 03, 2024 7:15 pm
Forum: Hardware
Topic: ESP32 GPIO Interrupts Missing
Replies: 7
Views: 412

Re: ESP32 GPIO Interrupts Missing

To get the maximum resolution out of an encoder the example counts all 4 edges that occur for each full step of the encoder. To do this, it sets up two channels. One channel counts the edges of signal A and uses the corresponding level of signal B at every edge of A to determine the direction. The o...
by MicroController
Thu Oct 03, 2024 6:19 pm
Forum: ESP-IDF
Topic: Esp32S3 : Is it possible to configure a pin in output open drain with pullup and configure it as a peripheral pin?
Replies: 1
Views: 270

Re: Esp32S3 : Is it possible to configure a pin in output open drain with pullup and configure it as a peripheral pin?

Yes, it is possible. But not via the public (GPIO) API.
You can configure the pin as GPIO, then 'manually' reconnect the peripheral signal to that pin. Like this.
by MicroController
Thu Oct 03, 2024 4:05 pm
Forum: General Discussion
Topic: run a task every 0.25 us
Replies: 10
Views: 734

Re: run a task every 0.25 us

On a 240MHz core, I would have expected that I could easily enter an ISR, toggle a Port Pin and return in 60 cycles, I know. But there's more going on in terms of setting up the context for running an ISR function written in C than one would expect: https://github.com/espressif/esp-idf/blob/46acfdc...
by MicroController
Thu Oct 03, 2024 1:59 pm
Forum: ESP-IDF
Topic: KSZ8863 driver sharing I2C with other chips
Replies: 8
Views: 651

Re: KSZ8863 driver sharing I2C with other chips

twompark wrote:
Wed Oct 02, 2024 4:10 pm
It seems the KSZ8863 driver uses the older I2C routines that don't have the built-in locking.
The "legacy" I2C driver also handles mutual exclusion for each I2C port: https://github.com/espressif/esp-idf/bl ... 2c.c#L1551
by MicroController
Thu Oct 03, 2024 1:39 pm
Forum: General Discussion
Topic: run a task every 0.25 us
Replies: 10
Views: 734

Re: run a task every 0.25 us

greycon wrote:
Thu Oct 03, 2024 1:20 pm
I would just use one of the ESP32 timers, set to contintually countdown, and reload.
... And calculate the values for 25 uS?
OP needs 4MHz, i.e. 0.25us intervals, not 25us.
0.25us corresponds to 60 CPU clock cycles @ 240 MHz; that's barely enough to even enter an ISR.
by MicroController
Thu Oct 03, 2024 1:22 pm
Forum: Hardware
Topic: ESP32 GPIO Interrupts Missing
Replies: 7
Views: 412

Re: ESP32 GPIO Interrupts Missing

To efficiently count edges, you may want to look into the Pulse Counter peripheral.
by MicroController
Thu Oct 03, 2024 12:39 pm
Forum: Hardware
Topic: ESP32 GPIO Interrupts Missing
Replies: 7
Views: 412

Re: ESP32 GPIO Interrupts Missing

You're not missing interrupts. Your handler code just doesn't toggle the output pin on one interrupt out of every three.
by MicroController
Thu Oct 03, 2024 11:17 am
Forum: Hardware
Topic: ESP32 GPIO Interrupts Missing
Replies: 7
Views: 412

Re: ESP32 GPIO Interrupts Missing

To capture both edges, use GPIO_INTR_ANYEDGE instead of GPIO_INTR_POSEDGE.

And instead of

Code: Select all

if (outputValue++ >1) outputValue=0;
gpio_set_level(OUTPUT_PIN_A,outputValue);
Try

Code: Select all

outputValue = outputValue ^ 1;
gpio_set_level(OUTPUT_PIN_A,outputValue);
by MicroController
Wed Oct 02, 2024 6:04 pm
Forum: General Discussion
Topic: Can esp32 s3 WROOM N8R8 does all of this ?
Replies: 2
Views: 300

Re: Can esp32 s3 WROOM N8R8 does all of this ?

espNewAddict wrote:
Tue Oct 01, 2024 5:21 pm
Is this chip capable of handling all of this?
Yes, any ESP32 should easily handle this, even the single-cores. (Using PWM or PDM for the (2x3?) 'analog' signals for the LED strips.)

The key to avoiding timing 'disruptions' is to not do things in software which the hardware can do.
by MicroController
Wed Oct 02, 2024 5:47 pm
Forum: General Discussion
Topic: Event Loop Base issues
Replies: 2
Views: 249

Re: Event Loop Base issues

See e.g. the example at https://github.com/espressif/esp-idf/tree/v5.3.1/examples/system/esp_event/default_event_loop It uses the provided macros to declare and define event bases. Notice that an "event base" is not a string but actually only a pointer, i.e. a memory address. An event base is identi...