Skip to content

Commit d994272

Browse files
committed
Update and Add AmebaD Example Guides
- Modify e-Paper Examples .zip lib link - Add PowerSave example guides
1 parent af85d2a commit d994272

File tree

84 files changed

+832
-29
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+832
-29
lines changed
Lines changed: 156 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,156 @@
1+
Power Save - Deep Sleep Mode
2+
=============================
3+
4+
.. contents::
5+
:local:
6+
:depth: 2
7+
8+
Materials
9+
---------
10+
11+
- AmebaD [AMB21 / AMB22 / AMB23 / AMB25 / AMB26 / BW16 / AW-CU488 Thing Plus] x 1
12+
13+
Example
14+
-------
15+
16+
AmebaD supports 2 low power modes which are deep sleep mode and sleep mode. Deep Sleep mode turns off more power domain than sleep mode. The power consumptions of Deep Sleep mode is around 7μA to 8μA as compared to normal state which is around 22mA. This example describes how to enter Deep Sleep mode and configure the wakeup source.
17+
18+
Open “File” -> “Examples” -> “AmebaPowerSave” -> “DeepSleepMode”
19+
20+
|image01|
21+
22+
Set condition values as below.
23+
“DS_WAKEUP_SOURCE” is used to set the wakeup source, user can choose 3 wakeup sources,
24+
AON Timer (SET_DS_AON_TIMER_WAKEUP);
25+
AON GPIO pins (SET_AON_GPIO_WAKEUP_PAxx) with xx being the pin no.(e.g. SET_AON_GPIO_WAKEUP_PA25);
26+
RTC Timer(SET_DS_RTC_WAKEUP);
27+
28+
**Using AON Timer as wakeup source**
29+
30+
AON Timer can be set from 0 to 32760000ms range by AON_TIMER_SLEEP_DURATION.
31+
32+
**Using AON GPIO pins as wake up source**
33+
34+
For AMB21, there are 5 pins that can be set as AON pins and active high for wakeup, PA25(D16), PA26(D17), PA21(D26), PA20(D27), PA(D28).
35+
36+
For AMB23, there are 8 pins that can be set as AON pins and active high for wakeup, PA12(D9), PA13(D10), PA14(D11), PA15(D12), PA16(D13), PA18(D15), PA19(D16), PA21(D18).
37+
38+
For BW16/BW16 type C, there is only 6 pins that can be set as AON pin and active high for wakeup, PA_25 (D7), PA_26 (D8), PA_15 (D9), PA_14 (D10), PA_13 (D11), PA_12 (D12).
39+
40+
For AW-CU488 Thing Plus, there is only 10 pins that can be set as AON pin and active high for wakeup, PA_18(D0), PA_16(D1), PA_17(D2), PA_13(D3), PA_12(D4), PA_26(D5), PA_25(D6), PA_19(D8), PA_15(D28), PA_14(D29).
41+
42+
For AMB25 and AMB26, there is only 6 pins that can be set as AON pin and active high for wakeup, PA12(D3), PA13(D2), PA14(D1), PA15(D0), PA25(D7), PA26(D6).
43+
44+
**Wiring Diagram**
45+
46+
.. only:: amb21
47+
48+
|image02|
49+
50+
.. only:: end amb21
51+
52+
.. only:: amb23
53+
54+
|image03|
55+
56+
.. only:: end amb23
57+
58+
.. only:: amb25
59+
60+
|image07|
61+
62+
.. only:: end amb25
63+
64+
.. only:: amb26
65+
66+
|image08|
67+
68+
.. only:: end amb26
69+
70+
.. only:: bw16-typeb
71+
72+
|image04|
73+
74+
.. only:: end bw16-typeb
75+
76+
.. only:: bw16-typec
77+
78+
|image05|
79+
80+
.. only:: end bw16-typec
81+
82+
.. only:: aw-cu488
83+
84+
|image06|
85+
86+
.. only:: end aw-cu488
87+
88+
These AON pins can be set by using SET_AON_GPIO_WAKEUP_PA25 or the pin that you want to use as shown in the picture below.
89+
90+
|image09|
91+
92+
**Using RTC Timer as wakeup source**
93+
94+
RTC Timer wakeup source can wake up the RTOS from deep sleep mode using the time set in the RTC alarm, which including day, hour, minute, and sec. All 4 values can be set by DS_RTC_ALARM_DAY, DS_RTC_ALARM_HOUR, DS_RTC_ALARM_MIN, and DS_RTC_ALARM_SEC.
95+
96+
|image10|
97+
98+
When all the condition values are set, the system will run and switch between normal and deep sleep mode which is controlled by the wakeup source. The serial monitor will display the switching log as shown below.
99+
100+
**AON Timer**
101+
102+
|image11|
103+
104+
**AON GPIO Pin**
105+
106+
|image12|
107+
108+
**RTC Timer**
109+
110+
|image13|
111+
112+
Code Reference
113+
---------------
114+
115+
Please refer to the `API Documents <https://ameba-doc-arduino-sdk.readthedocs-hosted.com/en/latest/amb21/API_Documents/index.html>`_ PowerSave section for detail description of all API.
116+
117+
118+
.. |image01| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image01.png
119+
:width: 689 px
120+
:height: 704 px
121+
.. |image02| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image02.png
122+
:width: 699 px
123+
:height: 669 px
124+
.. |image03| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image03.png
125+
:width: 729 px
126+
:height: 694 px
127+
.. |image04| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image04.png
128+
:width: 423 px
129+
:height: 535 px
130+
.. |image05| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image05.png
131+
:width: 376 px
132+
:height: 392 px
133+
.. |image06| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image06.png
134+
:width: 235 px
135+
:height: 400 px
136+
.. |image07| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image07.png
137+
:width: 391 px
138+
:height: 400 px
139+
.. |image08| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image08.png
140+
:width: 450 px
141+
:height: 400 px
142+
.. |image09| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image09.png
143+
:width: 903 px
144+
:height: 651 px
145+
.. |image10| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image10.png
146+
:width: 665 px
147+
:height: 262 px
148+
.. |image11| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image11.png
149+
:width: 859 px
150+
:height: 369 px
151+
.. |image12| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image12.png
152+
:width: 1004 px
153+
:height: 461 px
154+
.. |image13| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_Mode/image13.png
155+
:width: 860 px
156+
:height: 370 px
Lines changed: 210 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,210 @@
1+
Power Save - Deep Sleep for DHT and E-Paper
2+
============================================
3+
4+
.. contents::
5+
:local:
6+
:depth: 2
7+
8+
Materials
9+
---------
10+
11+
- AmebaD [AMB21 / AMB22 / AMB23 / AMB25 / AMB26 / BW16 / AW-CU488 Thing Plus] x 1
12+
13+
- DHT11 or DHT22 or DHT21 x 1
14+
15+
- Waveshare 2.9inch E-Paper HAT (D) x 1
16+
17+
Example
18+
--------
19+
20+
Ameba-D supports low power modes which are deepsleep mode. Deepsleep mode turns off most of the system power domain. The power consumptions of core module in DeepSleep Mode are around 7uA to 8uA compared to normal state around 22mA. This example gives demo of system switch between “working” and “sleep”(power save).Using DHT sensor to read data and display on Eink screen when system is awake. After 5 seconds system auto enter DeepSleep Mode for power save. System will wake up by wakeup source.( Aon timer, Aon Pins or RTC timer).
21+
22+
There are 2 versions of DHT sensor, one with 4 pins and another one with 3 pins mounted to a small PCB. The PCB mounted version has included a 10K Ohm pull up resistor for the signal line. Take note that if you are using a DHT sensor that is not mounted on a PCB, you will have to add in a 10K Ohm pull up resistor. You may refer to the wiring diagrams below.
23+
24+
.. only:: amb21
25+
26+
**DHT sensor not mounted on PCB board**
27+
28+
|image01|
29+
30+
**DHT sensor mounted on PCB board**
31+
32+
|image02|
33+
34+
.. only:: end amb21
35+
36+
.. only:: amb23
37+
38+
**DHT sensor not mounted on PCB board**
39+
40+
|image03|
41+
42+
**DHT sensor mounted on PCB board**
43+
44+
|image04|
45+
46+
.. only:: end amb23
47+
48+
.. only:: amb25
49+
50+
**DHT sensor not mounted on PCB board**
51+
52+
|image05|
53+
54+
**DHT sensor mounted on PCB board**
55+
56+
|image06|
57+
58+
.. only:: end amb25
59+
60+
.. only:: amb26
61+
62+
**DHT sensor not mounted on PCB board**
63+
64+
|image07|
65+
66+
**DHT sensor mounted on PCB board**
67+
68+
|image08|
69+
70+
.. only:: end amb26
71+
72+
.. only:: bw16-typeb
73+
74+
**DHT sensor not mounted on PCB board**
75+
76+
|image09|
77+
78+
**DHT sensor mounted on PCB board**
79+
80+
|image10|
81+
82+
.. only:: end bw16-typeb
83+
84+
.. only:: bw16-typec
85+
86+
**DHT sensor not mounted on PCB board**
87+
88+
|image11|
89+
90+
**DHT sensor mounted on PCB board**
91+
92+
|image12|
93+
94+
.. only:: end bw16-typec
95+
96+
.. only:: aw-cu488
97+
98+
**DHT sensor not mounted on PCB board**
99+
100+
|image13|
101+
102+
**DHT sensor mounted on PCB board**
103+
104+
|image14|
105+
106+
.. only:: end aw-cu488
107+
108+
Download the Eink zip library, AmebaEink.zip, at https://github.com/ambiot/ambd_arduino/tree/master/Arduino_zip_libraries. Then install the AmebaEink.zip.
109+
110+
Open “File” -> “Examples” -> “AmebaPowerSave” -> “DeepSleep_DHT_Eink_Example”
111+
112+
|image15|
113+
114+
Set condition values as picture below.
115+
116+
“DS_WAKEUP_SOURCE” is used to set the wake-up source, user can choose from 3 wake up sources,
117+
118+
- AON Timer (SET_DS_AON_TIMER_WAKEUP);
119+
- AON GPIO pins (SET_AON_WAKEPIN_WAKEUP);
120+
- RTC Timer(SET_DS_RTC_WAKEUP);
121+
122+
**Using AON Timer as wakeup source**
123+
124+
AON timer can be set from 0 to 32760000 range (unit ms) by AON_TIMER_SLEEP_DURATION.
125+
126+
**Using AON GPIO pins as wake up source**
127+
128+
For AMB21/AMB22, there are 5 pins that can be set as AON pins and active high for wakeup, GPIOA25(D16), GPIOA26(D17), GPIOA21(D26), GPIOA20(D27), GPIOA(D28).
129+
130+
For AMB23, there are 8 pins that can be set as AON pins and active high for wakeup, GPIOA12(D9), GPIOA13(D10), GPIOA14(D11), GPIOA15(D12), GPIOA16(D13), GPIOA18(D15), GPIOA19(D16), GPIOA21(D18).
131+
132+
For BW16/BW16-TypeC, there is only 6 pins that can be set as AON pin and active high for wakeup, GPIOA_25 (D7), GPIOA_26 (D8), GPIOA_15 (D9), GPIOA_14 (D10), GPIOA_13 (D11), GPIOA_12 (D12).
133+
134+
For AW-CU488 Thing Plus, there is only 10 pins that can be set as AON pin and active high for wakeup, GPIOA_18(D0), GPIOA_16(D1), GPIOA_17(D2), GPIOA_13(D3), GPIOA_12(D4), GPIOA_26(D5), GPIOA_25(D6), GPIOA_19(D8), GPIOA_15(D28), GPIOA_14(D29).
135+
136+
For AMB25, there is only 6 pins that can be set as AON pin and active high for wakeup, GPIOA_12(D3), GPIOA_13(D2), GPIOA_14(D1), GPIOA_15(D0), GPIOA_25(D7), GPIOA_26(D6).
137+
138+
These AON pins can be set by using SET_AON_GPIO_WAKEUP_GPIOA25 or the pin that you want to use as shown in the picture below.
139+
140+
|image16|
141+
142+
**Using RTC Timer as wakeup source**
143+
144+
RTC Timer wakeup system is by setting alarm. The alarm has 4 values to be set, day, hour, min and sec. All 4 values can be set by DS_RTC_ALARM_DAY, DS_RTC_ALARM_HOUR, DS_RTC_ALARM_MIN, and DS_RTC_ALARM_SEC.
145+
146+
DHTPIN is used to set DHT sensor data pin. User can choose any GPIO pins.
147+
148+
DHTTYPE is used to set DHT sensor type. (DHT11, DHT22 and DHT33)
149+
150+
|image17|
151+
152+
When finished the condition values setting, system will run and switch between normal working mode and deepsleep mode controlled by wakeup source. Eink screen will display the temperature and humidity data measured from DHT sensor when system is awake.
153+
154+
Code Reference
155+
---------------
156+
157+
Please refer to the `API Documents <https://ameba-doc-arduino-sdk.readthedocs-hosted.com/en/latest/amb21/API_Documents/index.html>`_ PowerSave section for detail description of all API.
158+
159+
160+
.. |image01| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image01.png
161+
:width: 988 px
162+
:height: 400 px
163+
.. |image02| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image02.png
164+
:width: 800 px
165+
:height: 400 px
166+
.. |image03| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image03.png
167+
:width: 1105 px
168+
:height: 382 px
169+
.. |image04| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image04.png
170+
:width: 875 px
171+
:height: 400 px
172+
.. |image05| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image05.png
173+
:width: 1189 px
174+
:height: 572 px
175+
.. |image06| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image06.png
176+
:width: 835 px
177+
:height: 400 px
178+
.. |image07| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image07.png
179+
:width: 1099 px
180+
:height: 477 px
181+
.. |image08| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image08.png
182+
:width: 993 px
183+
:height: 496 px
184+
.. |image09| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image09.png
185+
:width: 962 px
186+
:height: 328 px
187+
.. |image10| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image10.png
188+
:width: 975 px
189+
:height: 320 px
190+
.. |image11| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image11.png
191+
:width: 975 px
192+
:height: 402 px
193+
.. |image12| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image12.png
194+
:width: 908 px
195+
:height: 400 px
196+
.. |image13| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image13.png
197+
:width: 940 px
198+
:height: 473 px
199+
.. |image14| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image14.png
200+
:width: 606 px
201+
:height: 400 px
202+
.. |image15| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image15.png
203+
:width: 689 px
204+
:height: 704 px
205+
.. |image16| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image16.png
206+
:width: 957 px
207+
:height: 647 px
208+
.. |image17| image:: ../../../../_static/amebad/Example_Guides/PowerSave/Power_Save_Deep_Sleep_For_DHT_Epaper/image17.png
209+
:width: 767 px
210+
:height: 624 px

0 commit comments

Comments
 (0)