Can this pin:USBP/P2_2 control the LED as general gpio?
⚠️ Hi there.. thanks for coming to the forums. Exciting news! we’re now in the process of moving to our new forum platform that will offer better functionality and is contained within the main Dialog website. All posts and accounts have been migrated. We’re now accepting traffic on the new forum only - please POST any new threads at//www.xmece.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
According to DA14683 datasheet and section 32.5 SPECIAL I/O CONSIDERATIONS :
" To use P1_1 or P2_2 in GPIO mode, USBPAD_REG[USBPAD_EN] must be set. However, the allowed levels on this pins are 0V and the voltage on V33 rail. If 1.8V is selected as the pin supply, then a current of 150 uA is to be expected. Moreover, these pins should not be used in sleep modes because the USBPAD_REG will be powered off (belongs to the peripheral power domain). "
Both can be used with the 3.3V supply rail only, so both cannot be powered in sleep mode.
Additionally, when these pins are used as GPIOs make sure that USB logic is deactivated.
Hi xuguodong,
According to DA14683 datasheet and section 32.5 SPECIAL I/O CONSIDERATIONS :
" To use P1_1 or P2_2 in GPIO mode, USBPAD_REG[USBPAD_EN] must be set. However, the allowed levels on this pins are 0V and the voltage on V33 rail. If 1.8V is selected as the pin supply, then a current of 150 uA is to be expected. Moreover, these pins should not be used in sleep modes because the USBPAD_REG will be powered off (belongs to the peripheral power domain). "
Both can be used with the 3.3V supply rail only, so both cannot be powered in sleep mode.
Additionally, when these pins are used as GPIOs make sure that USB logic is deactivated.
Thanks, PM_Dialog
Hi Dialog,
USBPAD_REG[USBPAD_EN] must be set.
Can you support the code?
Thanks.
Hi xuguodong,
Yes, USBPAD_REG[USBPAD_EN] must be set. You could do it in your application code.
Thanks, PM_Dialog
USBPAD_REG[USBPAD_EN] must be set.
can you give me the above example code.
Hi xuguodong,
To use P1_1 or P2_2 in GPIO mode, USBPAD_REG[USBPAD_EN] must be set.
REG_SET_BIT(CRG_PER, USBPAD_REG, USBPAD_EN);
Additionally, when these pins are used as GPIOs make sure that USB logic is deactivated.
#define dg_configUSE_USB_ENUMERATION (0)
#define dg_configUSE_USB (0)
Then, you should configure them in the SW as normal GPIOs.
Hi Dialog,
After applied the follow code, The battery charge detection function has failed.
#define dg_configUSE_USB_ENUMERATION (0)
#define dg_configUSE_USB (0)
Hi xuguodong,
If the P1_1 or P2_2 in GPIO mode, then the USB logic is deactivated.
Thanks, PM_Dialog