⚠️
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.
4 posts / 0 new
Last post
ethsiplab
Offline
最后一次露面:1个月2周前
Joined:2019-09-13 12:58
无法输出XTAL32K

Hi there,

I am trying to output XTAL32K on P0_14 to be able to connect it to external sensors. However, until now I was not successful in trying to do so. I have always set P0_14 to output mode and tried the following:

1. I have set P0_14 function to HW_GPIO_FUNC_CLOCK function and set GPIO_CLK_SEL_REG[FUNC_CLOCK_EN]
2. Alternatively, I have set GPIO_CLK_SEL_REG[FUNC_CLOCK_EN] while setting P0_14 function to HW_GPIO_FUNC_GPIO. At the same time I have set USBPAD_REG[USBPAD_EN] as instructed on p.294 of the datasheet (40.2.5 Special I/O Considerations)

I have also tried various combinations of the above approaches but could not get it to work.

Can you tell me what I am doing wrong?

上面的两种方法之间有什么区别?

On p.294 of the datasheet (40.2.5 Special I/O Considerations) it says, that P0_14 should not be used in sleep mode. Does this mean, that I cannot output XTAL32K in sleep mode?

谢谢你的帮助!

Device:
PM_DIALOG.
Offline
最后一次露面:15 hours 53 min ago
Staff
Joined:2018-02-08 11:03
Hi Christian,

Hi Christian,

Let me check it and I will get back to you as soon as possible.

谢谢,PM_DIALOG.

ethsiplab
Offline
最后一次露面:1个月2周前
Joined:2019-09-13 12:58
Any news on this? By now I

Any news on this? By now I have found "5.4.3 Generating a Clock Output from DA1469x" in the DA1469x Application Hardware Design Guidelines which answers questions 2 and 3 from above. However, it is still not working. Here is how I configure things:

在system_init()中,我设置了sleep_mode pm_mode_idle to keep the processor in active state:

pm_sleep_mode_set(pm_mode_idle);

Afterwards I configure the pins following the two methods (both of which do not work for me).

Method 1:

hw_gpio_set_pin_function(HW_GPIO_PORT_1, HW_GPIO_PIN_2, HW_GPIO_MODE_OUTPUT, HW_GPIO_FUNC_CLOCK); GPIO->GPIO_CLK_SEL_REG = GPIO->GPIO_CLK_SEL_REG | 0x08; //FUNC_CLOCK_EN

Method 2:

hw_gpio_set_pin_function(HW_GPIO_PORT_0, HW_GPIO_PIN_14, HW_GPIO_MODE_OUTPUT, HW_GPIO_FUNC_CLOCK) GPIO->GPIO_CLK_SEL_REG = GPIO->GPIO_CLK_SEL_REG | 0x10;//XTAL32K_OUTPUT_EN

PM_DIALOG.
Offline
最后一次露面:15 hours 53 min ago
Staff
Joined:2018-02-08 11:03
Hi Christian,

Hi Christian,

My apologies for the delay. According to datasheet, P0_14 is used for the USB and specifically for Analog USB Full Speed D+ signal (USBp). Please check Table 2: DA14691/5 Pin Description from the datasheet. There are two options for exporting the XTAL32K to a GPIO.

  1. 将XTAL32K导出到P0_14。

Hardware modifications are needed in the DA1469x daughter board card. Suppose that you are using the DA14695 daughter board VFBGA86. Schematics can be found in the link below:

https://www.dialog-seminile.com/sites/default/files/da14695-db-vfbga86_vd-sch.pdf.

默认情况下,R7(0 OHM)和R8(0欧姆)电阻未填充。如果将XTAL32K导出到P0_14,则应填充两个电阻,但您不再具有USB功能。在HW修改后,请执行以下SW修改。出于演示目的,您应该在SDK的FreertOS_Retarget项目中修改prvsetuphardware(),如下:

#define AUTOMATIC_CLOCK_OUTPUT ( 1 ) static void prvSetupHardware( void ) { /* Init hardware */ pm_system_init(periph_init); uint32_t val = GPIO->GPIO_CLK_SEL_REG; #if !AUTOMATIC_CLOCK_OUTPUT REG_SET_FIELD(GPIO, GPIO_CLK_SEL_REG, FUNC_CLOCK_SEL, val, 0 ); REG_SET_FIELD(GPIO, GPIO_CLK_SEL_REG, FUNC_CLOCK_EN, val, 1 ); #else REG_SET_FIELD(GPIO, GPIO_CLK_SEL_REG, XTAL32K_OUTPUT_EN, val, 1 ); #endif GPIO->GPIO_CLK_SEL_REG = val; val = 0; val = GPREG->USBPAD_REG; REG_SET_FIELD(GPREG, USBPAD_REG, USBPAD_EN, val, 1); GPREG->USBPAD_REG = val; hw_gpio_set_pin_function(HW_GPIO_PORT_0, HW_GPIO_PIN_14, HW_GPIO_MODE_OUTPUT, HW_GPIO_FUNC_CLOCK); hw_gpio_pad_latch_enable(HW_GPIO_PORT_0, HW_GPIO_PIN_14); }

The are two different ways to set the registers. The code snippet is working with AUTOMATIC_CLOCK_OUTPUT set to 0 as well.

The default sleep mode is extended sleep mode, so you will see the XTAL32K exported to P0_14 for around 8sec. After 8sec the device will go to extended sleep and the configurations will be lost. If you would like to have the XTAL32K exported to P0_14 continuedly, disable the extended sleep mode(pm_mode_extended_sleep) to active mode(pm_mode_active).

  1. 将XTAL32K导出到另一个GPIO,例如P0_28

In this case, you should not need to do any hardware modifications. Just use the following code snippets in freertos_retarget project.

static void prvSetupHardware( void ) { /* Init hardware */ pm_system_init(periph_init); uint32_t val = GPIO->GPIO_CLK_SEL_REG; REG_SET_FIELD(GPIO, GPIO_CLK_SEL_REG, FUNC_CLOCK_SEL, val, 0 ); REG_SET_FIELD(GPIO, GPIO_CLK_SEL_REG, FUNC_CLOCK_EN, val, 1 ); GPIO->GPIO_CLK_SEL_REG = val; hw_gpio_set_pin_function(HW_GPIO_PORT_0, HW_GPIO_PIN_28, HW_GPIO_MODE_OUTPUT, HW_GPIO_FUNC_CLOCK); hw_gpio_pad_latch_enable(HW_GPIO_PORT_0, HW_GPIO_PIN_28); }

谢谢,PM_DIALOG.