Exploring the ADC of the CH32 Microcontroller: Single and Multi-Channel Acquisition
0:05 ADC Overview: The CH32 microcontroller features 10 ADC channels: 8 external (accessible via GPIO pins) and 2 internal. The ADC covers the full voltage range (0 to 3.3V in this case).
1:33 Single Channel Acquisition: The video demonstrates how to initialize and configure the ADC for single channel acquisition. It focuses on reading voltage from channel 2, which is connected to GPIO pin PC4.
10:09 Printing ADC Voltage: A function print_ADC_voltage is created to retrieve the raw ADC value and convert it to a human-readable voltage format.
11:38 Voltage Calculation: The function calculate_voltage converts the raw ADC value to voltage using the formula: (Vref * ADC_bits) / 1024.
17:49 Oversampling for Higher Resolution: The video explains how oversampling can improve the effective resolution of the ADC. By averaging 16 samples, the effective resolution can be increased from 10 bits to 12 bits.
23:45 Implementing Oversampling: A function get_oversampled_ADC_reading is implemented to perform oversampling and return the averaged ADC value.
29:34 Multi-Channel Acquisition: The video demonstrates how to configure the ADC for multi-channel acquisition using DMA (Dynamic Memory Access).
35:46 DMA Initialization: A function initialize_DMA is created to configure DMA for transferring ADC data to memory.
44:09 Printing Multi-Channel Data: A function print_multichannel_ADC_data is implemented to iterate through the ADC buffer and print the voltage readings for each channel.
49:02 Resources and Support: The video encourages viewers to visit the creator's website for code snippets, affiliate links to hardware, and to subscribe to the channel for future updates.