The datasheet says that ADC with DIG controller has 2 Msps speed at maximum. But how to use it to scan 8 channel?
The technical reference manual says that there is a pattern table to set each ADC conversion .but how to Configure it ?
Sorry for my poor English. really sorry.
---
本人大三,想用ESP32做个小示波器给自己玩=。=(真的是玩,不是毕设,我的专业不能做单片机毕设(逃))
esp32的datasheet说它有个2M sps 的ADC,应该能到8通道,每通道250k
但是没找到怎么配置啊=。=中文技术参考只说了它有个样式表可以配置测量规则,但是没说怎么去配置这个样式表呀=。=
How to Scan ADC's 8 Channal in High Speed?(maybe 100-250 ksps per channal?)
-
- Posts: 17
- Joined: Wed Jul 25, 2018 8:11 am
-
- Posts: 17
- Joined: Wed Jul 25, 2018 8:11 am
Re: How to Scan ADC's 8 Channal in High Speed?(maybe 100-250 ksps per channal?)
I found 2 function about pattern in file "rtc_module.c":
static esp_err_t adc_set_i2s_data_len(adc_unit_t adc_unit, int patt_len);
static esp_err_t adc_set_i2s_data_pattern(adc_unit_t adc_unit, int seq_num, adc_channel_t channel, adc_bits_width_t bits, adc_atten_t atten);
however,I can't find the header file of those function.
---
我在 "rtc_module.c" 文件里面找到两个关于测量样式表的函数:
adc_set_i2s_data_len
adc_set_i2s_data_pattern
但我找不到它们的头文件啊=。=要怎么用啊?
static esp_err_t adc_set_i2s_data_len(adc_unit_t adc_unit, int patt_len);
static esp_err_t adc_set_i2s_data_pattern(adc_unit_t adc_unit, int seq_num, adc_channel_t channel, adc_bits_width_t bits, adc_atten_t atten);
however,I can't find the header file of those function.
---
我在 "rtc_module.c" 文件里面找到两个关于测量样式表的函数:
adc_set_i2s_data_len
adc_set_i2s_data_pattern
但我找不到它们的头文件啊=。=要怎么用啊?
-
- Posts: 17
- Joined: Wed Jul 25, 2018 8:11 am
Re: How to Scan ADC's 8 Channal in High Speed?(maybe 100-250 ksps per channal?)
I'm trying using
SYSCON.saradc_sar1_patt_tab[0]=0x3f2f1f0f;
SYSCON.saradc_sar1_patt_tab[1]=0x7f6f5f4f;
SYSCON.saradc_sar1_patt_tab[2]=0x3f2f1f0f;
SYSCON.saradc_sar1_patt_tab[3]=0x7f6f5f4f;
to scan all channel in ADC1.
however,It only 500k sps , with
i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_ADC_BUILT_IN,
.sample_rate = 32766,
.bits_per_sample = 16,
.use_apll = 1,
.communication_format = I2S_COMM_FORMAT_I2S,
.channel_format = I2S_CHANNEL_FMT_ONLY_RIGHT,
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
.dma_buf_count = 2,
.dma_buf_len = 1024
};
where I did wrong?
SYSCON.saradc_sar1_patt_tab[0]=0x3f2f1f0f;
SYSCON.saradc_sar1_patt_tab[1]=0x7f6f5f4f;
SYSCON.saradc_sar1_patt_tab[2]=0x3f2f1f0f;
SYSCON.saradc_sar1_patt_tab[3]=0x7f6f5f4f;
to scan all channel in ADC1.
however,It only 500k sps , with
i2s_config_t i2s_config = {
.mode = I2S_MODE_MASTER | I2S_MODE_RX | I2S_MODE_ADC_BUILT_IN,
.sample_rate = 32766,
.bits_per_sample = 16,
.use_apll = 1,
.communication_format = I2S_COMM_FORMAT_I2S,
.channel_format = I2S_CHANNEL_FMT_ONLY_RIGHT,
.intr_alloc_flags = ESP_INTR_FLAG_LEVEL1,
.dma_buf_count = 2,
.dma_buf_len = 1024
};
where I did wrong?
-
- Posts: 17
- Joined: Wed Jul 25, 2018 8:11 am
Re: How to Scan ADC's 8 Channal in High Speed?(maybe 100-250 ksps per channal?)
I was trying to increase the sample_rate to 96000 in i2s_config .
the datarate had increased to 1368k/s.
however, all data from I2S are equals 0.
why?
the datarate had increased to 1368k/s.
however, all data from I2S are equals 0.
why?
-
- Posts: 17
- Joined: Wed Jul 25, 2018 8:11 am
Re: How to Scan ADC's 8 Channal in High Speed?(maybe 100-250 ksps per channal?)
␛[0;32mI (21020) i2s_read_buff: 00 70 00 70 00 60 00 60 00 50 00 50 00 40 00 40 ␛[0m
␛[0;32mI (21020) i2s_read_buff: 00 30 00 30 00 20 00 20 00 10 00 20 00 00 00 10 ␛[0m
␛[0;32mI (21030) i2s_read_buff: 00 70 00 00 00 60 00 70 00 50 00 60 00 50 00 50 ␛[0m
␛[0;32mI (21030) i2s_read_buff: 00 40 00 40 00 30 00 30 00 20 00 20 00 10 00 10 ␛[0m
上面是我抓取的部分I2S DMA数据 但为啥ADC读取的顺序和我在SYSCON.saradc_sar1_patt_tab中配置的不一样?
SYSCON.saradc_sar1_patt_tab[0]=0x3f2f1f0f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[1]=0x7f6f5f4f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[2]=0x3f2f1f0f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[3]=0x7f6f5f4f&0xf3f3f3f3;
(上面使用&0xf3使采样位数配置为9位)
上面的数据是当sample_rate被配置为12000*16时出现的。当我降低sample_rate后,顺序貌似正常了?(数据如下)
␛[0;32mI (105020) i2s_read_buff: 00 20 00 30 00 10 00 20 00 70 00 00 00 50 00 60 ␛[0m
␛[0;32mI (105020) i2s_read_buff: 00 30 00 40 00 10 00 20 00 70 00 00 00 50 00 60 ␛[0m
␛[0;32mI (105030) i2s_read_buff: 00 30 00 40 00 10 00 20 00 00 00 00 00 60 00 70 ␛[0m
␛[0;32mI (105030) i2s_read_buff: 00 40 00 50 00 20 00 30 00 00 00 10 00 60 00 70 ␛[0m
␛[0;32mI (21020) i2s_read_buff: 00 30 00 30 00 20 00 20 00 10 00 20 00 00 00 10 ␛[0m
␛[0;32mI (21030) i2s_read_buff: 00 70 00 00 00 60 00 70 00 50 00 60 00 50 00 50 ␛[0m
␛[0;32mI (21030) i2s_read_buff: 00 40 00 40 00 30 00 30 00 20 00 20 00 10 00 10 ␛[0m
上面是我抓取的部分I2S DMA数据 但为啥ADC读取的顺序和我在SYSCON.saradc_sar1_patt_tab中配置的不一样?
SYSCON.saradc_sar1_patt_tab[0]=0x3f2f1f0f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[1]=0x7f6f5f4f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[2]=0x3f2f1f0f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[3]=0x7f6f5f4f&0xf3f3f3f3;
(上面使用&0xf3使采样位数配置为9位)
上面的数据是当sample_rate被配置为12000*16时出现的。当我降低sample_rate后,顺序貌似正常了?(数据如下)
␛[0;32mI (105020) i2s_read_buff: 00 20 00 30 00 10 00 20 00 70 00 00 00 50 00 60 ␛[0m
␛[0;32mI (105020) i2s_read_buff: 00 30 00 40 00 10 00 20 00 70 00 00 00 50 00 60 ␛[0m
␛[0;32mI (105030) i2s_read_buff: 00 30 00 40 00 10 00 20 00 00 00 00 00 60 00 70 ␛[0m
␛[0;32mI (105030) i2s_read_buff: 00 40 00 50 00 20 00 30 00 00 00 10 00 60 00 70 ␛[0m
-
- Posts: 118
- Joined: Tue Jun 26, 2018 3:09 am
Re: How to Scan ADC's 8 Channal in High Speed?(maybe 100-250 ksps per channal?)
请参考 https://www.esp32.com/viewtopic.php?f=2 ... 550#p35550q515949148 wrote: ↑Fri Jul 27, 2018 5:56 am␛[0;32mI (21020) i2s_read_buff: 00 70 00 70 00 60 00 60 00 50 00 50 00 40 00 40 ␛[0m
␛[0;32mI (21020) i2s_read_buff: 00 30 00 30 00 20 00 20 00 10 00 20 00 00 00 10 ␛[0m
␛[0;32mI (21030) i2s_read_buff: 00 70 00 00 00 60 00 70 00 50 00 60 00 50 00 50 ␛[0m
␛[0;32mI (21030) i2s_read_buff: 00 40 00 40 00 30 00 30 00 20 00 20 00 10 00 10 ␛[0m
上面是我抓取的部分I2S DMA数据 但为啥ADC读取的顺序和我在SYSCON.saradc_sar1_patt_tab中配置的不一样?
SYSCON.saradc_sar1_patt_tab[0]=0x3f2f1f0f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[1]=0x7f6f5f4f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[2]=0x3f2f1f0f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[3]=0x7f6f5f4f&0xf3f3f3f3;
(上面使用&0xf3使采样位数配置为9位)
上面的数据是当sample_rate被配置为12000*16时出现的。当我降低sample_rate后,顺序貌似正常了?(数据如下)
␛[0;32mI (105020) i2s_read_buff: 00 20 00 30 00 10 00 20 00 70 00 00 00 50 00 60 ␛[0m
␛[0;32mI (105020) i2s_read_buff: 00 30 00 40 00 10 00 20 00 70 00 00 00 50 00 60 ␛[0m
␛[0;32mI (105030) i2s_read_buff: 00 30 00 40 00 10 00 20 00 00 00 00 00 60 00 70 ␛[0m
␛[0;32mI (105030) i2s_read_buff: 00 40 00 50 00 20 00 30 00 00 00 10 00 60 00 70 ␛[0m
wookooho
-
- Posts: 17
- Joined: Wed Jul 25, 2018 8:11 am
Re: How to Scan ADC's 8 Channal in High Speed?(maybe 100-250 ksps per channal?)
这就是我问的=。=ESP_houwenxiang wrote: ↑Sat Dec 15, 2018 5:23 am请参考 https://www.esp32.com/viewtopic.php?f=2 ... 550#p35550q515949148 wrote: ↑Fri Jul 27, 2018 5:56 am␛[0;32mI (21020) i2s_read_buff: 00 70 00 70 00 60 00 60 00 50 00 50 00 40 00 40 ␛[0m
␛[0;32mI (21020) i2s_read_buff: 00 30 00 30 00 20 00 20 00 10 00 20 00 00 00 10 ␛[0m
␛[0;32mI (21030) i2s_read_buff: 00 70 00 00 00 60 00 70 00 50 00 60 00 50 00 50 ␛[0m
␛[0;32mI (21030) i2s_read_buff: 00 40 00 40 00 30 00 30 00 20 00 20 00 10 00 10 ␛[0m
上面是我抓取的部分I2S DMA数据 但为啥ADC读取的顺序和我在SYSCON.saradc_sar1_patt_tab中配置的不一样?
SYSCON.saradc_sar1_patt_tab[0]=0x3f2f1f0f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[1]=0x7f6f5f4f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[2]=0x3f2f1f0f&0xf3f3f3f3;
SYSCON.saradc_sar1_patt_tab[3]=0x7f6f5f4f&0xf3f3f3f3;
(上面使用&0xf3使采样位数配置为9位)
上面的数据是当sample_rate被配置为12000*16时出现的。当我降低sample_rate后,顺序貌似正常了?(数据如下)
␛[0;32mI (105020) i2s_read_buff: 00 20 00 30 00 10 00 20 00 70 00 00 00 50 00 60 ␛[0m
␛[0;32mI (105020) i2s_read_buff: 00 30 00 40 00 10 00 20 00 70 00 00 00 50 00 60 ␛[0m
␛[0;32mI (105030) i2s_read_buff: 00 30 00 40 00 10 00 20 00 00 00 00 00 60 00 70 ␛[0m
␛[0;32mI (105030) i2s_read_buff: 00 40 00 50 00 20 00 30 00 00 00 10 00 60 00 70 ␛[0m
Re: How to Scan ADC's 8 Channal in High Speed?(maybe 100-250 ksps per channal?)
Hello,
is this possible in esp-idf 4 ? i see rtc_module.c has changed a lot and those functions are no longer there.
would it be possible to get an example of how to do this in esp 4? thank you
is this possible in esp-idf 4 ? i see rtc_module.c has changed a lot and those functions are no longer there.
would it be possible to get an example of how to do this in esp 4? thank you
Who is online
Users browsing this forum: Bing [Bot] and 302 guests