Invoking sleep with UART in receive mode

⚠️
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.
6 posts / 0 new
Last post
Max44
Offline
Last seen:9 months 2 weeks ago
加入:2016-02-08 15:58
Invoking sleep with UART in receive mode

I'm field testing a custom board with a DA14580 and an external MCU managing sensors. When connected (to an Android tablet in my case), the external MCU sends sensor data once per second to the DA14580 via UART. Upon disconnect, I'm invoking extended sleep mode pending a wakeup on a GPIO pin toggled by the external MCU. Functionally, this is working great but we're not seeing the expected low power when we're supposed to be in sleep mode. I wanted to make sure that having the UART sitting there in receive mode when the tablet disconnects is not preventing extended sleep from happening.
I looked over the UART driver and I don't see a function to cancel receive or to turn the UART off. Any advice on how to handle this properly would be much appreciated.
谢谢你,马克斯

Device:
PM_Dialog
Offline
Last seen:6 days 13 hours ago
工作人员
加入:2018-02-08 11:03
Hi Max44,

Hi Max44,

Could you please let me know about how much power consumption you are getting since the device enters the extended sleep mode? Also, could you please clarify if the device enters the extended sleep? If the DA14580 enters the sleep, the most possible reason that you get an unexpected power consumption is why you probably have a power leakage into your custom board. I am not able to understand what you mean with that:“I wanted to make sure that having the UART sitting there in receive mode when the tablet disconnects is not preventing extended sleep from happening.?Could you please try to explain your question? Be aware that since the device enters the extended sleep all the peripheral blocks including the UART are powered off.

Thanks, PM_Dialog

Max44
Offline
Last seen:9 months 2 weeks ago
加入:2016-02-08 15:58
PM,

PM,

Thanks for the reply. Sorry, I was attempting to keep it simple and not to burden you with extraneous details on the system operation. And I do realize the power consumption is likely to be from elsewhere on the custom board. I'm just trying to eliminate possibilities. We're seeing something like 1.5 mA when the DA14580 and external MCU are supposed to be in a low power state. We're expecting a much lower current draw and unfortunately I don't have connectors to isolate modules for power analysis on the custom board.

When the tablet disconnects, in user_app_disconnect I invoke arch_set_extended_sleep() and app_easy_wakeup_set. At this time, however, uart2_read(uint8_t *bufptr, uint32_t size, void (*callback) (uint8_t)) is in progress waiting for a data packet from the external microcontroller.

From what you said above, it sounds like setting extended sleep will power off the UART. Is that correct? And this will happen regardless of the uart2_read state?

谢谢你,马克斯

PM_Dialog
Offline
Last seen:6 days 13 hours ago
工作人员
加入:2018-02-08 11:03
Hi Max44,

Hi Max44,

Please try to review your custom PCB, and check if the increased power consumption comes from your board. The most possible reason is why you have a leakage into you board. As I can see from your post, the device enters the extended sleep. If I am able to understand correctly, since the device is disconnected, you put it on extended sleep and then you are trying to wake it up by sending data through UART? Did I understand correctly?

Thanks, PM_Dialog

Max44
Offline
Last seen:9 months 2 weeks ago
加入:2016-02-08 15:58
No, I'm waking up the DA14580

No, I'm waking up the DA14580 with a GPIO toggle from the external MCU, which acts just like a button push. Then uart2 is initialized as part of the periph_init() routine invoked during wakeup. As I said, functionally this is working well.

From our discussion, I'm going to assume that setting extended sleep turns the UART off and, as you suggested, examine elsewhere on the board.

谢谢你,马克斯

PM_Dialog
Offline
Last seen:6 days 13 hours ago
工作人员
加入:2018-02-08 11:03
Hi Max44,

Hi Max44,

Since your device enters the extended sleep mode, all the peripherals modules are off. Regarding the DA14580 datasheet, all power domains are off except for the PD_AON, the programmed PD_RRx and the PD_SR. Please check the datasheet for getting more information about sleep modes.

Thanks, PM_Dialog