⚠️
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.wsdof.com/support. We’ll be fixing bugs / optimising the searching and tagging over the coming days.
4 posts / 0 new
Last post
nigelyang
Offline
Last seen:2 months 2 days ago
加入:2018-03-20 08:24
P2_4 GPIO operation

Hi Dialog

I would like to use P2_4 as GPIO, but found that the pin always stay low no matter what I config as GPIO or PWM output pin. From my understanding, the SWCLK function of P2_4 should be
release after user's code starts. I do not found any setting in P2_4 for other using. Please tell me how to implement the GPIO function of P2_4.

thanks for your help.

Device:
PM_Dialog
Offline
Last seen:1 day 4 hours ago
工作人员
加入:2018-02-08 11:03
Hi nigelyang,

Hi nigelyang,

As you mentioned correctly in your thread, the P2_4 is used for the SWCLK, and it is by default enabled by the boot loader. According to DA14680 datasheet, the P2_4 is pull-down enabled during and after reset, please check the datasheet for getting more information. Although, after the booting procedure, you can configurate it as a GPIO or as a PWM output, but you have to disable the debugger first. Please, check the DEBUGGER_ENABLE of the Table 182: SYS_CTRL_REG (0x50000012) from the datasheet If it is not set, the SWDIO and SW_CLK can be used as gpio ports. The debugger is by default enable it from the bootloader, so DEBUGGER_ENABLE is equal to 1. That you have to do in order to disable the debugger is to set it into zero. You can do it by using the REG_CLR_BIT definition of the sdk_def.h header file under this SDK path:sdk/bsp_include/ sdk_def.h.

REG_CLR_BIT(CRG_TOP, DEBUGGER_ENABLE , 0) // disable the debugger

Also, could you please clarify if you are using a custom board or our DA14680 development kit? In case you are using our Dev-Kit, you should displace the jumper of the header J14 in order to disable the JTAG connection. Please, try my recommendation and let me know if you have any other issues.

Thanks, PM_Dialog

mahmed106
Offline
Last seen:1 month 2 weeks ago
加入:2019-05-03所
HI dialog

HI dialog

I m having the same issue,, that i m not able to use ADC on this pin,,

But if i diasble debugger mode ,, where in the code should i use this command?

REG_CLR_BIT(CRG_TOP, DEBUGGER_ENABLE , 0) // disable the debugger

Can you please help me in this regard?

And if i disable the debugger by this bit ,, will i be able to program the SOC again via SWD pins or not?

PM_Dialog
Offline
Last seen:1 day 4 hours ago
工作人员
加入:2018-02-08 11:03
Hi mahmed106,

Hi mahmed106,

谢谢你的问题tion. I’ve already replied you in your new forum thread. Thanks for raising a new forum ticket.

https://support.dialog-semiconductor.com/forums/post/dialog-smartbond-bluetooth-low-energy-%E2%80%93-software/use-da14681-swd-pins-adc#comment-27970

Thanks, PM_Dialog