Search found 64 matches

by jcolebaker
Sun Sep 29, 2024 7:29 pm
Forum: ESP-IDF
Topic: How to temporarily PAUSE Bluetooth / BLE
Replies: 5
Views: 1550

Re: How to temporarily PAUSE Bluetooth / BLE

Sounds like a task well suited for the RMT peripheral using DMA. That's a good suggestion. I tried and the RMT peripheral does sample the signal nicely. However, we are using the ESP32 which doesn't support DMA for the RMT peripheral, so we can only sample a max of 512 cycles (high/low) which is no...
by jcolebaker
Thu Sep 26, 2024 12:55 am
Forum: ESP-IDF
Topic: How to temporarily PAUSE Bluetooth / BLE
Replies: 5
Views: 1550

Re: How to temporarily PAUSE Bluetooth / BLE

chegewara wrote:
Mon Sep 23, 2024 2:42 am
Did you try to do sampling on second core, or even better to use second core only for sampling task?
How would I do this? The work is done in the input capture interrupt callback (as set by "mcpwm_capture_channel_register_event_callbacks"). How would I set which CPU this is done on?
by jcolebaker
Mon Sep 23, 2024 2:10 am
Forum: ESP-IDF
Topic: How to temporarily PAUSE Bluetooth / BLE
Replies: 5
Views: 1550

How to temporarily PAUSE Bluetooth / BLE

Hi, We have an ESP32 project which uses Bluedroid to implement some services (BLE, plus a Bluetooth classic serial port). The BLE advertises some services, and also we support connections for a BT classic serial port. We also have a data sampling task which has to (periodically) sample from a digita...
by jcolebaker
Mon Sep 02, 2024 12:49 am
Forum: ESP-IDF
Topic: SOLVED: Overriding Compiler Options in a Component
Replies: 2
Views: 2870

WORKAROUND: Overriding Compiler Options in a Component

I have finally found a solution to this problem. I have been able to add extra compiler flags with (for example): target_compile_options(${COMPONENT_LIB} PRIVATE -Wunused-function -Werror) However, it didn't work for some errors (such as unused function) because the ESP-IDF build system had already ...
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: 1189

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: 1189

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: 7
Views: 14011

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). FIX / WORKAROUND: I have found a hacky work-around which is working well for us so far: * Modi...
by jcolebaker
Wed Dec 06, 2023 11:34 pm
Forum: ESP-IDF
Topic: WORKAROUND: ADC in continuous mode MISSING SAMPLES - 255 Sample LIMIT
Replies: 7
Views: 14011

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: 7
Views: 14011

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: 7
Views: 14011

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