客户需要MD ADC 16通道DMA配置问题?帮分析
-
const dma_transfer_config_t adcTransferConfig = { .srcAddr = (uint32_t)&ADC0->FIFO,
.destAddr = (uint32_t)&g_adc_result[0U],
.destOffset = 0x02U,
.srcOffset = 0x00U,
.srcTransferSize = DMA_TRANSFER_SIZE_2B,
.destTransferSize = DMA_TRANSFER_SIZE_2B,
.srcModulo = DMA_MODULO_OFF,
.destModulo = DMA_MODULO_OFF,
.transferLoopByteCount = (SEQ_LEN * 2),
.loopTransferConfig = &adcLoopTransferConfig,
.destLastAddrAdjust = -(SEQ_LEN * 2),
.interruptEnable = false };const dma_transfer_config_t adcTransferConfig1 = { .srcAddr = (uint32_t)&ADC0->FIFO,
.destAddr = (uint32_t)&g_adc_result1[0U],
.destOffset = 0x02U,
.srcOffset = 0x00U,
.srcTransferSize = DMA_TRANSFER_SIZE_2B,
.destTransferSize = DMA_TRANSFER_SIZE_2B,
.srcModulo = DMA_MODULO_OFF,
.destModulo = DMA_MODULO_OFF,
.transferLoopByteCount = (SEQ_LEN * 2),
.loopTransferConfig = &adcLoopTransferConfig,
.destLastAddrAdjust = -(SEQ_LEN * 2),
.interruptEnable = false };DMA_DRV_ConfigLoopTransfer(0U, &adcTransferConfig);
DMA_DRV_StartChannel(0U);
ADC_DRV_ConfigConverter(0, &adc_config0);
// DMA_DRV_ConfigLoopTransfer(1U, &adcTransferConfig);
//DMA_DRV_StartChannel(1U);while (i--) { ADC_DRV_Start(ADC_INST); OSIF_TimeDelay(500); PRINTF("=======\r\n"); for (uint8_t j = 0; j < SEQ_LEN; j++) { PRINTF("ADC0 CH %d=%d\r\n", j, g_adc_result[j]); } } DMA_DRV_ConfigLoopTransfer(1U, &adcTransferConfig1); DMA_DRV_StartChannel(1U); ADC_DRV_ConfigConverter(0, &adc_config1); i=2; while (i--) { ADC_DRV_Start(ADC_INST); OSIF_TimeDelay(500); PRINTF("=======\r\n"); for (uint8_t j = 0; j < SEQ_LEN; j++) { PRINTF("ADC1 CH %d=%d\r\n", j, g_adc_result1[j]);[链接文本]([Adc_Dma_Demo.zip](https://yt-static-media.oss-cn-hangzhou.aliyuncs.com/nodebb/61/c9fbf02d-b42c-4f54-8b63-5c31de071c9f.zip) 链接地址) } }
ADC0 CH 0=1884
ADC0 CH 1=1906
ADC0 CH 2=1892
ADC0 CH 3=663
ADC0 CH 4=4084
ADC0 CH 5=4094
ADC0 CH 6=4094
ADC0 CH 7=4047ADC1 CH 0=0
ADC1 CH 1=0
ADC1 CH 2=0
ADC1 CH 3=0
ADC1 CH 4=0
ADC1 CH 5=0
ADC1 CH 6=0 -
帮助没办法联网的电脑使用YCT
帮助改进和优化YT CONFIG TOOL,有机会抽取YTM32B1ME0 EVB哦...