This repository has been archived on 2023-07-17. You can view files and clone it, but cannot push or open issues or pull requests.
bl_mcu_sdk/examples/adc/adc_continuous_differential
2022-03-21 14:59:16 +08:00
..
cdk [chore][cdk] update header file path 2021-12-17 16:05:45 +08:00
CMakeLists.txt first commit 2021-04-13 19:27:30 +08:00
main.c [refactor] remove bflb_platform.h from bl602 and bl702 driver,include it in anywhere used 2021-10-19 20:04:23 +08:00
readme.md [doc] update build cmd 2022-03-21 14:59:16 +08:00

编译指令


$ make APP=adc_continuous_differential BOARD=bl706_iot

基本配置

此示例需要将对应board目录下的pinmux_config文件中的GPIO11与GPIO12配置为ADC复用功能 并且将对应board目录下的clock_config.h文件中的ADC时钟配置为相应的时钟。

基本原理

此示例会通过将GPIO11与GPIO12用作ADC的差分输入端实时将差分结果打印到串口。

关键参数

正端通道配置 posChList 数组 负端通道配置 negChList 数组

通道与GPIO映射表 bl70x系列如下

GPIO Channel
GPIO_PIN_8, CH0 IO
GPIO_PIN_15, CH1 IO
GPIO_PIN_17, CH2 IO
GPIO_PIN_11, CH3 IO
GPIO_PIN_12, CH4 IO
GPIO_PIN_14, CH5 IO
GPIO_PIN_7, CH6 IO
GPIO_PIN_9, CH7 IO
GPIO_PIN_18, CH8 IO
GPIO_PIN_19, CH9 IO
GPIO_PIN_20, CH10 IO
GPIO_PIN_21, CH11 IO

操作流程

1、 首先注册ADC设备将其命名为adc_one_diff

2、 配置ADC设备的基本参数配置为差分连续模式

3、 判断通道对应的gpio是否配置为ADC复用功能

4、 开始ADC转换

5、 读取ADC的结果并打印在LOG口

运行结果

差分转换结果会打印在UART的LOG口