Search found 60 matches

by jcolebaker
Thu Feb 22, 2024 11:01 pm
Forum: ESP-IDF
Topic: SOLVED: MCPWM - cap_edge in interrupt callback is sometimes WRONG
Replies: 3
Views: 552

Re: MCPWM - cap_edge in interrupt callback is sometimes WRONG

Hi. Thanks for the reply. Yes, I think you are correct. I'm guessing that there is some small noise in the signal which causes the edge capture input to trigger several times when it is close to the threshold, e.g. instead of just Low -> High, it goes Low -> High -> Low -> High. Each of these captur...
by jcolebaker
Tue Feb 20, 2024 3:15 am
Forum: ESP-IDF
Topic: SOLVED: MCPWM - cap_edge in interrupt callback is sometimes WRONG
Replies: 3
Views: 552

SOLVED: MCPWM - cap_edge in interrupt callback is sometimes WRONG

Hi, I've set up my ESP32 (WROVER board) to capture the rising and falling edges from a signal which is varying between 2 KHz and 4 KHz. I want to capture edge times and also whether the edge was rising or falling. I have the code working, but the edge value ( event_data->cap_edge ) in the interrupt ...
by jcolebaker
Sun Jan 07, 2024 7:12 pm
Forum: ESP-IDF
Topic: WORKAROUND: ADC in continuous mode MISSING SAMPLES - 255 Sample LIMIT
Replies: 6
Views: 8985

Re: ADC in continuous mode MISSING SAMPLES - 255 Sample LIMIT

@davidribeiro Interesting result... I suspect SYSCON.saradc_ctrl2.meas_num_limit isn't implemented, which is why it is reserved (i.e. the ADC will always reset after N samples due to hardware limitations). I have found a hacky work-around which is working well for us so far: * Modify esp-idf\compone...
by jcolebaker
Wed Dec 06, 2023 11:34 pm
Forum: ESP-IDF
Topic: WORKAROUND: ADC in continuous mode MISSING SAMPLES - 255 Sample LIMIT
Replies: 6
Views: 8985

Re: ADC in continuous mode MISSING SAMPLES - 255 Sample LIMIT

Any update to this? Has anyone had success by setting "SYSCON.saradc_ctrl2.meas_num_limit = 0" as @ESP_Sprite suggested?

This did not work for me - the ADC "conversion done" callback doesn't occur if the bit is set to 0.
by jcolebaker
Fri Dec 01, 2023 2:58 am
Forum: ESP-IDF
Topic: WORKAROUND: ADC in continuous mode MISSING SAMPLES - 255 Sample LIMIT
Replies: 6
Views: 8985

Re: ADC in continuous mode MISSING SAMPLES - 255 Sample LIMIT

I have tried setting this bit to 0 (by modifying the code in adc_ll.h ), but then the ADC didn't work at all (at least, when using the ADC API, I did not receive the "on_conv_done" callback). It may be worth experimenting some more. However, the TRM does say that the 0 value for this bit is reserved...
by jcolebaker
Thu Nov 30, 2023 12:09 am
Forum: ESP-IDF
Topic: WORKAROUND: ADC in continuous mode MISSING SAMPLES - 255 Sample LIMIT
Replies: 6
Views: 8985

Re: ADC in continuous mode MISSING SAMPLES - 255 Sample LIMIT

UPDATE: I found this in esp32\include\hal\adc_ll.h : #define ADC_LL_DEFAULT_CONV_LIMIT_EN 1 #define ADC_LL_DEFAULT_CONV_LIMIT_NUM 10 These settings are used to set bits in register APB_SARADC_CTRL2_REG: APB_SARADC_MAX_MEAS_NUM (8 bit) APB_SARADC_MEAS_NUM_LIMIT (1 bit). According to comments in the ...
by jcolebaker
Mon Nov 27, 2023 2:28 am
Forum: ESP-IDF
Topic: WORKAROUND: ADC in continuous mode MISSING SAMPLES - 255 Sample LIMIT
Replies: 6
Views: 8985

WORKAROUND: ADC in continuous mode MISSING SAMPLES - 255 Sample LIMIT

Hi, I've set up the ADC in continuous (DMA) mode to store samples to a 1024 byte buffer with 256 byte frame size. The sample rate is 40 kHz and the resolution is 12 bits. I'm feeding a 2.2v, 1 kHz sine wave to the input (input looks good on the scope). I've set up the code with a task which is woken...
by jcolebaker
Wed Nov 15, 2023 7:42 pm
Forum: ESP-IDF
Topic: Max sample rate with ADC in DMA mode
Replies: 0
Views: 610

Max sample rate with ADC in DMA mode

Hi, I am using the ADC in continuous (DMA) mode to read a signal. Ideally we would like to sample at over 1 MS/s. Using ESP-IDF 4.4.4, with ESP32-WROVER-B module. I have followed the steps here to set up the ADC controller in DMA mode: https://docs.espressif.com/projects/esp-idf/en/v4.3/esp32c3/api-...
by jcolebaker
Thu Nov 02, 2023 11:45 pm
Forum: ESP-IDF
Topic: xQueueSendToBackFromISR causes Interrupt watchdog timeout
Replies: 3
Views: 807

Re: xQueueSendToBackFromISR causes Interrupt watchdog timeout

Hmm, the stack trace etc above seems to indicate there is a problem on the UART Transmit side. When I push messages to a queue, they eventually trigger another task to send a reply on the UART. I expected the receive interrupt handler to complete once the message was pushed to a queue, so I was hopi...
by jcolebaker
Thu Nov 02, 2023 6:47 pm
Forum: ESP-IDF
Topic: xQueueSendToBackFromISR causes Interrupt watchdog timeout
Replies: 3
Views: 807

Re: xQueueSendToBackFromISR causes Interrupt watchdog timeout

Here is the error info printed out by the monitor command: Guru Meditation Error: Core 0 panic'ed (Interrupt wdt timeout on CPU0). Core 0 register dump: PC : 0x4008492a PS : 0x00050035 A0 : 0x401a486a A1 : 0x3ffbebc0 0x4008492a: _xt_lowint1 at C:/Users/Jeremycb/esp-idf/components/freertos/port/xtens...