Wake up by UART data transfer.

18 posts / 0 new
Last post
chungtran
Offline
Last seen:5 years 1 month ago
加入:2015-01-21 05:57
Wake up by UART data transfer.

Hi you all,

I am working on DSPS source code and am dealing with an issue that how to wake up from extendded sleep mode by UART. I have already defined extended sleep mode by adding #define CFG_EXT_SLEEP in da14580_config.h . As the result, I saw that I just receive some discrete data from UART ( it might causes by sleep mode ). My target is how I still could receive normal data from UART even when I have defined " CFG_EXT_SLEEP ". Any reply will be greatly appreciated .

Regards,

Chung Tran.

Device:
chungtran
Offline
Last seen:5 years 1 month ago
加入:2015-01-21 05:57
Could someone help me with

Could someone help me with this question? Regards!

MT_dialog
Offline
Last seen:3 months 6 days ago
Staff
加入:2015-06-08 11:34

Hi chungtran

如果我正确地理解它,你是trying to set your peripheral in extended sleep. To our understanding this happens when
a) the device is idle and not connected or
b) it is connected, between the communication events with the remote.
In both cases you should wake up the device from your external processor (the one that connects to the 580 UART). For this you need
to implement a wake up mechanism. There are two options you can implement this:

Sol1) You can use Hardware flow control and RTS/CTS in order to wake up from sleep.
Sol2) You can use Rx/Tx. In this case a software flow control should exist.
Set your Tx in 0, after a flow off command to signal that the device is sleeping. To wake the device up toggle the Rx. Wait for TX to become high and to receive
a Flow On command before sending actual data, to give time to your device to wakeup.
We recommend to use Sol1.

Thanks MT_dialog

chungtran
Offline
Last seen:5 years 1 month ago
加入:2015-01-21 05:57
嗨MT_Dialog,

嗨MT_Dialog,

Thanks for your usefully answer! But could you tell me in detail about what I have to do with RTS/CTS signals? Is it use a Wakeup timer and Quadrature decoder driver?

Regards,

Chung tran.

imalamoud
Offline
Last seen:3 months 4 weeks ago
加入:2014-11-16 21:34
Hello,

Hello,

How do I put 14580 into the extended sleep mode by RTS/CTS?

I have configured device as #define CFG_EXT_SLEEP

However current draw is about 600uA regardless.

MT_dialog
Offline
Last seen:3 months 6 days ago
Staff
加入:2015-06-08 11:34
Hi chungtran

Hi chungtran

I 'm sorry but it seems that i misunderstood your question.

Can you please tell me exactly what are you trying to do? What do you mean in your first post " received some discrete data" and what normal data means to you? Are you having issues with the existing reference design or you are trying to do something else ?

Thanks MT_dialog

chungtran
Offline
Last seen:5 years 1 month ago
加入:2015-01-21 05:57
嗨MT_Dialog,

嗨MT_Dialog,

Oh well , Here is my situation :D

I am working on DSPS reference design. I have already tested extended sleep mode by defining CFG_EXT_SLEEP in da14580_config.h. I realized DSPS worked fine in extended sleep mode but I can not recieve data that send from my android device to Da14580.( I am thinking this could be caused by sleep mode ). So that, Could I sent Data from android device to DA14580 with defining extended sleep mode? I mean that the chip will sleep at all time and just wake up from sleep mode when there have incoming data (external wake up events).

Regards,

Chung Tran.

MT_dialog
Offline
Last seen:3 months 6 days ago
Staff
加入:2015-06-08 11:34
Hi chungtran,

Hi chungtran,

I though that your were trying to modify the reference design. Sorry about the mix-up.

Of course you can send data from your android device, this isn't something extended sleep is responsible for, please check the connections on your dev-kit and see the User Manual UM-B-038. The da sleeps and awakens in every connection interval and not every time there are incoming data.

Thanks MT_dialog

chungtran
Offline
Last seen:5 years 1 month ago
加入:2015-01-21 05:57
Hi MT_dialog,

Hi MT_dialog,

Thank you so much for clearly answer! I got it! So if I want to use uart comunication to trigger (wake-up) the DA, is it possible for that? My idea is I will use the Wakeup timer and Quadrature decoder driver to handle uart pin_port. Here is my code which I have added into app_sps_device_project.c and It seems work for me :

void app_uart_data_trans_incoming(void)
{
// Init System Power Domain blocks: GPIO, WD Timer, Sys Timer, etc.
if(GetBits16(SYS_STAT_REG, PER_IS_DOWN))
// Re-initiate peripheral after exiting from sleep modes
periph_init();

//Trigger when appear incoming data
wkupct_register_callback (app_uart_data_trans_idle); // uart event resister
wkupct_enable_irq(0x20, 0x00, 1, 0); // P0_5 (UART Rx) , polarity high (0 high & 1 low ) 1 event, debouncing time = 0

app_uart_status = 1;

if( ke_state_get(TASK_APP) == APP_CONNECTABLE )
{
//Wakeup BLE here

app_ble_force_wakeup();
app_ble_ext_wakeup_off();

//SetBits32(GP_CONTROL_REG, BLE_WAKEUP_REQ, 1);

ke_msg_send_basic(APP_WAKEUP_MSG, TASK_APP, NULL);
}
}

Thanks

Chung Tran.

MT_dialog
Offline
Last seen:3 months 6 days ago
Staff
加入:2015-06-08 11:34
Hi chungtran

Hi chungtran

What are you trying to do? You want to wake up the da in-between the connection events in order to achieve a quicker response? You want to disconnect the peripheral from the central and set the da in permanent sleep until new data arrive in da's uart and then wake-up?

Thanks MT_dialog

chungtran
Offline
Last seen:5 years 1 month ago
加入:2015-01-21 05:57
Hi MT Dialog,

Hi MT Dialog,

Yes, my target is I want to set the DA in permanent sleep until new data arrive in da's uart and then wake-up. Regards,

Chungtran.

MT_dialog
Offline
Last seen:3 months 6 days ago
Staff
加入:2015-06-08 11:34
Hi chungtran

Hi chungtran

In your code you are using the Rx pin in order to wake up the the chip (in my undestanding), does your chip wakes up and transmits but you experience corrupted data in the output ? You will have to consider that the chip needs some time in order to wake up from sleep, please advice post #3.

Thanks MT_dialog

chungtran
Offline
Last seen:5 years 1 month ago
加入:2015-01-21 05:57
Hi MT_dialog,

Hi MT_dialog,

Yes It does, I mean that DA seems wake-up and transmits data but sometime when I debug my code again then it does not work! Could you tell me in detail about the time that DA needs to wakeup from sleep? Is it possible to set to zero because I want it wakes up right after there are incoming datas.

Regards,

Chungtran.

MT_dialog
Offline
Last seen:3 months 6 days ago
Staff
加入:2015-06-08 11:34
Hi chungtran

Hi chungtran

The chip finishes the wake up proccess in about 3-4ms ( but it depends on the SDK and if its 581 or 580 chip, you can count the wake up time from smart sniippets) there is no way to override that....thats why you have to toggle Rx and wait before you transmit anything throught bluetooth.

Thanks MT_dialog

chungtran
Offline
Last seen:5 years 1 month ago
加入:2015-01-21 05:57
Hi MT_dialog,

Hi MT_dialog,

Thank you so much for your help! But could you tell me exactly what I have to do with 2 solutions that you have recommended for me. How I can use CTS/RTS signal to resolve my issue?

Regards,

Chungtran

chungtran
Offline
Last seen:5 years 1 month ago
加入:2015-01-21 05:57
Hi MT_dialog,

Hi MT_dialog,

In solution 2 which you said " Set your Tx in 0, after a flow off command to signal that the device is sleeping. To wake the device up toggle the Rx. Wait for TX to become high and to receive
a Flow On command before sending actual data, to give time to your device to wakeup." I am confusing with this ! Could you give me an example code or any reference design that have defined this?

Ragards,

Chung Tran.

MT_dialog
Offline
Last seen:3 months 6 days ago
Staff
加入:2015-06-08 11:34
Hi chungtran,

Hi chungtran,

Sorry there is no implementation code for the above scenario.

Thanks MT_dialog

chungtran
Offline
Last seen:5 years 1 month ago
加入:2015-01-21 05:57
Hi MT_dialog,

Hi MT_dialog,

I got it. Thanks

Chung Tran.

Topic locked