Hello friends
I have an ESP32 dev board (DEVKIT V1). I'm pretty new to the espressif framework. I've looked into the examples but I could not find an example that will suffic my needs.
What I'm trying to do:
establish two PWM signals at 4KHz, and at each PWM cycle i need an interrupt to be raised where two ADC values from two separate ADC channels will be aquired (the two ADC conversions must start and end within the same PWM cycle that triggered the conversion).
After the ADC values were aquired, a very efficient code will be executed to manipute the PWM duty cycle by those ADC values.
This cycle goes on forever.
Where I'm at:
Two PWM signals generated at about 4KHz -> Done
Use capture module (CAP0) to raise interrupts on each PWM cycle, by connecting the PWM signal to the pin that is config'ed for CAP0. -> Done.
What i'm struggling with:
Having a fast ADC conversion of two channels. this should occur as parallel as possible (i.e. the two conversions should take place as close together as possible). The sampling resolution must be at least 12bits.
I don't understand, this seems to be fairly a simple thing to do.
I tried the slow ADC conversions but it is, well slow, which means i need the DMA module to help me.
I tried using the I2S ADC DMA example to maybe do something similar to what i require. I just let it sample at about 8000KHz, keeping only the last values in global variables, and access those when i need to. This was only successful with sampling a single channel and I don't know how to sample two channels or more at once.
Please assist..
Thanks in advance!
Two channels fast ADC sampling
-
- Posts: 1
- Joined: Tue Jan 26, 2021 2:46 pm
Jump to
- English Forum
- Explore
- News
- General Discussion
- FAQ
- Documentation
- Documentation
- Sample Code
- Discussion Forum
- Hardware
- ESP-IDF
- ESP-BOX
- ESP-ADF
- ESP-MDF
- ESP-WHO
- ESP-SkaiNet
- ESP32 Arduino
- IDEs for ESP-IDF
- ESP-AT
- ESP IoT Solution
- ESP RainMaker
- Rust
- ESP8266
- Report Bugs
- Showcase
- Chinese Forum 中文社区
- 活动区
- 乐鑫活动专区
- 讨论区
- 全国大学生物联网设计竞赛乐鑫答疑专区
- ESP-IDF 中文讨论版
- 《ESP32-C3 物联网工程开发实战》书籍讨论版
- ESP-AT 中文讨论版
- ESP-BOX 中文讨论版
- ESP IoT Solution 中文讨论版
- ESP-ADF 中文讨论版
- ESP Mesh 中文讨论版
- ESP Cloud 中文讨论版
- ESP-WHO 中文讨论版
- ESP-SkaiNet 中文讨论版
- ESP 生产支持讨论版
- 硬件问题讨论
- 项目展示
Who is online
Users browsing this forum: Bing [Bot] and 279 guests
- All times are UTC
- Top
- Delete cookies
About Us
Espressif Systems is a fabless semiconductor company providing cutting-edge low power WiFi SoCs and wireless solutions for wireless communications and Internet of Things applications. ESP8266EX and ESP32 are some of our products.