When the chip wakes from the extende sleep, it begin to advertise, but the I2C doesn't work.

8 posts / 0 new
Last post
wzh16622
Offline
Last seen:3 years 3 months ago
加入:2014-09-10 08:28
When the chip wakes from the extende sleep, it begin to advertise, but the I2C doesn't work.

I make the DA14580 into extended sleep, the BLE stop advertising. When I use WAKEUP TIMER driver to wake up the system via the button(I have add the periph_init()), and it start to advertising. The smartphone can use the APP to connect to the chip, and communicate(The chip can return the data, which sent from the smartphone APP, to the smartphone.).But when I send the command to make the chip to read the senser via the I2C, it doesn't work. I missed some important details? Thanks a lot.

Keywords:
Device:
MT_dialog
Offline
Last seen:1 month 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi whz16622,

Hi whz16622,

Before the da falls into sleep are you able to read the sensor? can you monitor the I2C bus to check the traffic? maybe the da sends the command but the sensor doesn't respond. Are your peripherals properly initialized after waking up from sleep ?

Thanks MT_dialog

wzh16622
Offline
Last seen:3 years 3 months ago
加入:2014-09-10 08:28
Thanks for your reply. Before

Thanks for your reply. Before the da falls into sleep(perform the function app_set_extended_sleep()), the da can read the sensor. Now it works, due to I add the function app_disable_sleep() before read the sensor.Why?

MT_dialog
Offline
Last seen:1 month 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi wzh16622,

Hi wzh16622,

Please make sure that your peripherals and pins are properly initialized after each wake up and before you perform reading on the sensor. There is no problem in reading the sensor when your device is waking up from sleep mode.

Thanks MT_dialog

wzh16622
Offline
Last seen:3 years 3 months ago
加入:2014-09-10 08:28
The peripherals and pins are

The peripherals and pins are properly initialized after each wake up. Now, I want to make sure that if the function app_disable_sleep() is indispensable.
Thanks WZH.

hardy.chen
Offline
Last seen:1年9个月前
加入:2015-03-13 04:20
Hi,

Hi,

Is calling 'periph_init' enough before read to I2C device while waking up from sleep?

MT_dialog
Offline
Last seen:1 month 2 weeks ago
工作人员
加入:2015-06-08 11:34
Hi hardy.chen,

Hi hardy.chen,

The periph_init will enable all the peripherals on the da and you will be able interact with the i2c but if you dont enable the BLE you will be operating with the RC16.

Thanks MT_dialog

hardy.chen
Offline
Last seen:1年9个月前
加入:2015-03-13 04:20
逢l noted and Thanks!

逢l noted and Thanks!

Topic locked