Hi Dialog,
Q1 I try to use P2_0 and P2_1 (I do not use 32K xtal) as Button use. I found the two different current consumption results when I config P2_0 and P2_1 as button respectively.
using P2_0 as button, I got 3 uA at hibernation mode; However,using P2_1 as button, got 15 uA at hibernation mode. I config the same thing in P2_0 and P2_1(using macro
AD_GPIO_INTR_INSTANCE(.........)). Is there any hardware difference between the two pins? moreover, SWDIO and SWCLK have same result(power consumption of SWCLK is higher than
SWDIO ).
Q2。使用32K Xtal和Internal RC 32K为LP_CLK的系统之间有什么区别?不同的功耗?
Q3. is it possible to share QSPI pins(P00~P05) to be GPIO for controlling external devices without affecting the flash code executing?
thanks for your help.
Device:
Hi nigelyang,
Q1 : The P2_0 and P2_1 are GPIO but they can be multiplexed with the XTAL. Where did you find the AD_GPIO_INTR_INSTANCE macro?Also, Please try to describe what you are trying to accomplish.
Q2: The RCX is an easy way to have a low power clock without adding an external crystal oscillator into your board. The RCX is not as stable as the external XTAL, and the power consumption is higher when using the RCX.
Q3: No, it is not possible to share the QSPI pins, because they are dedicated for the QSPI Controller. When using the QSPI Controller, you don’t need to configure these pins.
Thanks, PM_Dialog
Q1:我在WRBL项目中找到了它并在我的应用程序中引用,如下所示
/**
* \brief Entry for gpio interrupt
*
* \param [in] _name name that will be later used to refer to instance
* \ param [in] _port触发引脚的端口ID
* \param [in] _pin pin id of triggering pin
* \param [in] _press_callback function to be called when GPIO is asserted
* \ param [in] _release_callback函数被调用时gpio被解除断言
*/
#define AD_GPIO_INTR_INSTANCE(_name, _port, _pin, _press_callback, _release_callback) \
static INITIALISED_PRIVILEGED_DATA ad_gpio_intr_config dev_##_name = { \
.index = CONV_PORT_PIN_TO_INDEX((_port << 4) | (_pin & 0x0F)), \
.pressed = false, \
.press_cb = _press_callback, \
.release_cb = _release_callback, \
.next_element = NULL, \
}; \
静态ad_gpio_intr_config * const _name = &dev_ # #_name;
Hi nigelyang,
Could you please clarify which project you are using? Are you using the wearable project or a project from SDK example? In case you are using the wearable project, did you buy the wearable hardware? Otherwise, if you are using an SDK example, why did you get code from the wearable reference design?
Thanks, PM_Dialog
hi Dialog,
I am developing my application code based on SDK project, but I read and used parts of the WRBL project code in my project, especially Button setting part. Is there any problem for my button settings result in high current if using P2_1 and P2_4 as input? If no any hardware difference, this may be PCB design problem?! However, my two PCB both have this kind of phenomenon. thanks for your help.
Hi nigelyang,
Sorry but I am a little bit confused with your description. Could you please describe exactly what you are trying to implement? If I am able to understand correctly, do you have a custom board? Please, let me know about the button’s settings and I will provide you the proper code snippet with the configurations.
Thanks, PM_Dialog
Hi Dialog,
Yes, I am implementing in the custom board(my own board). I ever tried a lot of time to catch a low to high signal for triggering my system from sleep, but fail. So I tried to imitate the button setting in wrbl project in order to save the problem. To simplify my question, is there any wrong in my below code about external wakeup pin? (to catch low to high trigger)
hw_gpio_configure_pin(STATUS_PORT, STATUS_PIN, HW_GPIO_MODE_INPUT, HW_GPIO_FUNC_GPIO, 0); //0: act as Low Pin : P2_3
hw_wkup_init(null);
hw_wkup_configure_pin(STATUS_PORT, STATUS_PIN, 1 , HW_WKUP_PIN_STATE_HIGH); // trigger @high
hw_wkup_register_interrupt(status_wkup_handler,1);
/* Status_wkup_handler */
static void FP_Status_wkup_handler(void)
{
printf(“这是status_wkup_handler \ r \ n”);
hw_wkup_reset_interrupt();
notify_task_verify_ok(); //
}
Hi nigelyang,
您会发现附加的一个示例代码片段,演示了通过按下按钮来唤醒如何唤醒。
Thanks, PM_Dialog