找回密码
 立即注册

微信扫码登录

查看: 155|回复: 6

[ADC] Use same pin as ADC Input and a Digital Input

[复制链接]

4

主题

4

回帖

60

积分

不屈白银

积分
60
发表于 2025-7-30 13:31:46 | 显示全部楼层 |阅读模式 来自 广东
Information
说明:   建议参照本版块置顶帖内容输入必要信息
芯片型号: 8208
驱动SDK版本:
本帖最后由 ManRam 于 2025-7-31 22:48 编辑

1. Is it possible to switch the function of a GPIO from being used for Analog Input (Vbat detection) to an input pin connected to a switch (refert the sample circuit below)
2. Are there specific methods required for this, or would simply changing the GPIO configuration before and after the battery measurement suffice?
image.png

0

主题

21

回帖

88

积分

不屈白银

积分
88
发表于 2025-7-31 20:27:44 | 显示全部楼层 来自 上海
The maximum voltage range for GPIO I/O is between 3.3V and 3.6V, while the VBAT voltage can reach up to 4.2V, which presents a potential risk. If the VBAT voltage can be maintained below 3.3V, measurements can be made using either an external VBAT connection or by outputting a high level from the GPIO.

4

主题

4

回帖

60

积分

不屈白银

积分
60
 楼主| 发表于 2025-7-31 22:48:42 | 显示全部楼层 来自 广东东莞
I think my question was not made clear. i have update my early post. can you go through it again?

0

主题

21

回帖

88

积分

不屈白银

积分
88
发表于 2025-8-6 16:00:46 | 显示全部楼层 来自 上海
It's possible, but the megawatt-level voltage divider circuit is not recommended. It is suggested to replace it with a kilo-hundred level one. The reason is that during the operation of the ADC in the chip, there is a dynamic current, which can be regarded as a dynamic resistor with a megawatt-level resistance value.For resistors and capacitors of the 100k level, it is recommended to use values ranging from 0.1 to 1 uf.
企业微信截图_20250806155949.png

4

主题

4

回帖

60

积分

不屈白银

积分
60
 楼主| 发表于 2025-8-7 10:15:32 | 显示全部楼层 来自 广东
本帖最后由 ManRam 于 2025-8-7 10:24 编辑
TL_BL 发表于 2025-8-6 16:00
It's possible, but the megawatt-level voltage divider circuit is not recommended. It is suggested to ...

okay. so let me get clear again, first i need to replace the resistor with kilo-hundred value resistor and add capacitor.

so about reading the button state. by default do i need to configure the pin as a gpio where by default is use to detect the button state? then when come to read the baterry level, i switch the gpio func by initialize the adc gpio init everytime and change back to as gpio once done reading the battery value?

0

主题

21

回帖

88

积分

不屈白银

积分
88
发表于 2025-8-7 18:40:47 | 显示全部楼层 来自 上海
ManRam 发表于 2025-8-7 10:15
okay. so let me get clear again, first i need to replace the resistor with kilo-hundred value resis ...

There is a vbat detection mode, which can be considered for use. If you want to use the GPIO mode, just try to restore the IO state as much as possible. In the init API, there are operations to change the IO.

4

主题

4

回帖

60

积分

不屈白银

积分
60
 楼主| 发表于 2025-8-8 10:26:25 | 显示全部楼层 来自 广东
TL_BL 发表于 2025-8-7 18:40
There is a vbat detection mode, which can be considered for use. If you want to use the GPIO mode, ...

But in normal gpio mode, there will be still the present of voltage from the voltage divider at the gpio pin. wont this trigger a false press? how do i overcome this.
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Telink forum ( 沪ICP备17008231号-1 )

GMT+8, 2025-8-18 03:11 , Processed in 0.103288 second(s), 24 queries .

Powered by Telink 隐私政策

泰凌微电子版权所有 © 。保留所有权利。 2024

快速回复 返回顶部 返回列表