Skip to content

Commit 57bcb8a

Browse files
committed
package test
1 parent c69ff05 commit 57bcb8a

File tree

337 files changed

+75777
-11581
lines changed

Some content is hidden

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

337 files changed

+75777
-11581
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ TODO: update instructions that use UF2 instead, should be possible to use a scri
4040
TODO: consider a self packaged C# exe or python script?
4141

4242
TODO: look into using openocd for flashing bootloader
43+
TODO: fork adafruit bootloader to have low power operation enabled by default, bootloader blocks startup below 2.2v right now. in theory device can operate to 1.9v before display cuts out
4344

4445
# Licensing
4546

Untitled-2.md

Lines changed: 87 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,87 @@
1-
TODO:
2-
validate clock toggle rate is 30hz and fix counters as needed
3-
need phillips screws for the back
4-
need more heat set inserts
5-
need more 470/480 ohm 805 resistors
6-
7-
8-
9-
https://forum.arduino.cc/t/samd21-power-consumption-too-high-in-active-mode/668966/2
10-
11-
12-
Generic clock generator 0 8 division factor bits - DIV[7:0]
13-
Generic clock generator 1 16 division factor bits - DIV[15:0]
14-
Generic clock generators 2 5 division factor bits - DIV[4:0]
15-
Generic clock generators 3 - 8 8 division factor bits - DIV[7:0]
16-
17-
rtc will be on anyways for time keeping
18-
19-
add BOD33 disable in bootloader flashing scripts?
20-
21-
condition where NVM RWS being 1 in bootloader will prevent startup below 2.1v
22-
which is in theory near the end of useful battery life anyways
23-
24-
add ability for poweroff requiring push button reset?
25-
from system menu and for when battery is low
26-
- how to do this? disable all clocks?
27-
28-
29-
display says it operates down 2.7v
30-
- max frame frequency of 65hz?
31-
- claims EXTCOMIN should be below framerate frequency, does not indicate why
32-
- extcom freq of 54-65hz
33-
34-
3) A still image should be displayed less than two hours, if it is necessary to display still image longer than two
35-
hour, display image data must be refreshed in order to avoid sticking image on LCD panel
36-
37-
Memory LCDs do not generate this signal internally. It must be supplied using one of two methods:
38-
software, or external clock...
39-
When the software clock is selected [EXTMODE = L], bit V of the command bit string sets the state of VCOM.
40-
See Figure 2. This bit must toggle (by writing to the panel) at least once per second.
41-
42-
Power Scenario 1
43-
1hz write 1hz refresh
44-
Here all of the pixels will be written to the panel once per second. For the 1.35-inch panel, the quiescent
45-
current for the panel is 2.1μA. Each write to the panel (assuming that the entire panel is written), takes
46-
360μA; and lasts for about 5.38ms (assuming a 2 MHz SPI clock speed).
47-
If averaged over a second, this amounts to an “average” currant draw of approximately 2μa. Therefore, the
48-
panel would have an average power draw of 20.5μW (5V operation). Note that a VCOM toggle can be done
49-
whenever the panel is written to, including a data write.
50-
51-
Power Scenario 2
52-
30 sec write, 1hz refresh
53-
Here, we write all the pixels to the panel only every 30 seconds. The current required to write to the panel
54-
“averaged” over that time is approximately 0.1μA. If VCOM is toggled once a second (using the Change
55-
VCOM command), the additional power draw for this action (assuming that it is done 29 times) is an average
56-
of 0.1μA. Therefore the average power draw over the 30-second period becomes 11.5μW. See Figure 10.
57-
Applying these conditions to the 2.7-inch panel: writing all pixels to the whole panel once a second takes an
58-
average of 485μW. Writing all pixels once every 30 seconds (with a 1-second VCOM toggle) takes 135μW.
59-
60-
61-
62-
63-
uint32_t userWord0 = *((uint32_t *)NVMCTRL_USER); // Read fuses for user word 0
64-
uint32_t userWord1 = *((uint32_t *)(NVMCTRL_USER + 4)); // Read fuses for user word 1
65-
NVMCTRL->CTRLB.bit.CACHEDIS = 1; // Disable the cache
66-
NVMCTRL->ADDR.reg = NVMCTRL_AUX0_ADDRESS / 2; // Set the address
67-
NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_EAR | // Erase the auxiliary user page row
68-
NVMCTRL_CTRLA_CMDEX_KEY;
69-
while (!NVMCTRL->INTFLAG.bit.READY) // Wait for the NVM command to complete
70-
NVMCTRL->STATUS.reg |= NVMCTRL_STATUS_MASK; // Clear the error flags
71-
NVMCTRL->ADDR.reg = NVMCTRL_AUX0_ADDRESS / 2; // Set the address
72-
NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_PBC | // Clear the page buffer
73-
NVMCTRL_CTRLA_CMDEX_KEY;
74-
while (!NVMCTRL->INTFLAG.bit.READY) // Wait for the NVM command to complete
75-
NVMCTRL->STATUS.reg |= NVMCTRL_STATUS_MASK; // Clear the error flags
76-
*((uint32_t *)NVMCTRL_USER) = userWord0 & ~FUSES_BOD33_EN_Msk; // Disable the BOD33 enable fuse in user word 0
77-
*((uint32_t *)(NVMCTRL_USER + 4)) = userWord1; // Copy back user word 1 unchanged
78-
NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_WAP | // Write to the user page
79-
NVMCTRL_CTRLA_CMDEX_KEY;
80-
while (!NVMCTRL->INTFLAG.bit.READY) // Wait for the NVM command to complete
81-
NVMCTRL->STATUS.reg |= NVMCTRL_STATUS_MASK; // Clear the error flags
82-
NVMCTRL->CTRLB.bit.CACHEDIS = 0; // Enable the cache
1+
TODO:
2+
validate clock toggle rate is 30hz and fix counters as needed
3+
need phillips screws for the back
4+
need more heat set inserts
5+
need more 470/480 ohm 805 resistors
6+
7+
8+
9+
https://forum.arduino.cc/t/samd21-power-consumption-too-high-in-active-mode/668966/2
10+
11+
12+
Generic clock generator 0 8 division factor bits - DIV[7:0]
13+
Generic clock generator 1 16 division factor bits - DIV[15:0]
14+
Generic clock generators 2 5 division factor bits - DIV[4:0]
15+
Generic clock generators 3 - 8 8 division factor bits - DIV[7:0]
16+
17+
rtc will be on anyways for time keeping
18+
19+
add BOD33 disable in bootloader flashing scripts?
20+
21+
condition where NVM RWS being 1 in bootloader will prevent startup below 2.1v
22+
which is in theory near the end of useful battery life anyways
23+
24+
add ability for poweroff requiring push button reset?
25+
from system menu and for when battery is low
26+
- how to do this? disable all clocks?
27+
28+
29+
display says it operates down 2.7v
30+
- max frame frequency of 65hz?
31+
- claims EXTCOMIN should be below framerate frequency, does not indicate why
32+
- extcom freq of 54-65hz
33+
34+
3) A still image should be displayed less than two hours, if it is necessary to display still image longer than two
35+
hour, display image data must be refreshed in order to avoid sticking image on LCD panel
36+
37+
Memory LCDs do not generate this signal internally. It must be supplied using one of two methods:
38+
software, or external clock...
39+
When the software clock is selected [EXTMODE = L], bit V of the command bit string sets the state of VCOM.
40+
See Figure 2. This bit must toggle (by writing to the panel) at least once per second.
41+
42+
Power Scenario 1
43+
1hz write 1hz refresh
44+
Here all of the pixels will be written to the panel once per second. For the 1.35-inch panel, the quiescent
45+
current for the panel is 2.1μA. Each write to the panel (assuming that the entire panel is written), takes
46+
360μA; and lasts for about 5.38ms (assuming a 2 MHz SPI clock speed).
47+
If averaged over a second, this amounts to an “average” currant draw of approximately 2μa. Therefore, the
48+
panel would have an average power draw of 20.5μW (5V operation). Note that a VCOM toggle can be done
49+
whenever the panel is written to, including a data write.
50+
51+
Power Scenario 2
52+
30 sec write, 1hz refresh
53+
Here, we write all the pixels to the panel only every 30 seconds. The current required to write to the panel
54+
“averaged” over that time is approximately 0.1μA. If VCOM is toggled once a second (using the Change
55+
VCOM command), the additional power draw for this action (assuming that it is done 29 times) is an average
56+
of 0.1μA. Therefore the average power draw over the 30-second period becomes 11.5μW. See Figure 10.
57+
Applying these conditions to the 2.7-inch panel: writing all pixels to the whole panel once a second takes an
58+
average of 485μW. Writing all pixels once every 30 seconds (with a 1-second VCOM toggle) takes 135μW.
59+
60+
61+
62+
63+
uint32_t userWord0 = *((uint32_t *)NVMCTRL_USER); // Read fuses for user word 0
64+
uint32_t userWord1 = *((uint32_t *)(NVMCTRL_USER + 4)); // Read fuses for user word 1
65+
NVMCTRL->CTRLB.bit.CACHEDIS = 1; // Disable the cache
66+
NVMCTRL->ADDR.reg = NVMCTRL_AUX0_ADDRESS / 2; // Set the address
67+
NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_EAR | // Erase the auxiliary user page row
68+
NVMCTRL_CTRLA_CMDEX_KEY;
69+
while (!NVMCTRL->INTFLAG.bit.READY) // Wait for the NVM command to complete
70+
NVMCTRL->STATUS.reg |= NVMCTRL_STATUS_MASK; // Clear the error flags
71+
NVMCTRL->ADDR.reg = NVMCTRL_AUX0_ADDRESS / 2; // Set the address
72+
NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_PBC | // Clear the page buffer
73+
NVMCTRL_CTRLA_CMDEX_KEY;
74+
while (!NVMCTRL->INTFLAG.bit.READY) // Wait for the NVM command to complete
75+
NVMCTRL->STATUS.reg |= NVMCTRL_STATUS_MASK; // Clear the error flags
76+
*((uint32_t *)NVMCTRL_USER) = userWord0 & ~FUSES_BOD33_EN_Msk; // Disable the BOD33 enable fuse in user word 0
77+
*((uint32_t *)(NVMCTRL_USER + 4)) = userWord1; // Copy back user word 1 unchanged
78+
NVMCTRL->CTRLA.reg = NVMCTRL_CTRLA_CMD_WAP | // Write to the user page
79+
NVMCTRL_CTRLA_CMDEX_KEY;
80+
while (!NVMCTRL->INTFLAG.bit.READY) // Wait for the NVM command to complete
81+
NVMCTRL->STATUS.reg |= NVMCTRL_STATUS_MASK; // Clear the error flags
82+
NVMCTRL->CTRLB.bit.CACHEDIS = 0; // Enable the cache
83+
84+
85+
pos 8, 5 bits
86+
pos 15, 2 bits
87+
pos 14, 1 bit

board/boards.txt

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
# Copyright (c) 2014-2015 Arduino LLC. All right reserved.
2+
#
3+
# This library is free software; you can redistribute it and/or
4+
# modify it under the terms of the GNU Lesser General Public
5+
# License as published by the Free Software Foundation; either
6+
# version 2.1 of the License, or (at your option) any later version.
7+
#
8+
# This library is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11+
# See the GNU Lesser General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU Lesser General Public
14+
# License along with this library; if not, write to the Free Software
15+
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
16+
17+
menu.cache=Cache
18+
menu.speed=CPU Speed
19+
menu.opt=Optimize
20+
menu.maxqspi=Max QSPI
21+
menu.usbstack=USB Stack
22+
menu.debug=Debug
23+
24+
# -----------------------------------
25+
# NanoCodeBug PawPet M0 (SAMD21)
26+
# -----------------------------------
27+
pawpet_m0.name=PawPet M0 (SAMD21)
28+
29+
# VID/PID for Bootloader, Arduino & CircuitPython
30+
pawpet_m0.vid.0=0x239A
31+
pawpet_m0.pid.0=0x800B
32+
pawpet_m0.vid.1=0x239A
33+
pawpet_m0.pid.1=0x000B
34+
pawpet_m0.vid.2=0x239A
35+
pawpet_m0.pid.2=0x0015
36+
37+
# Upload
38+
pawpet_m0.upload.tool=bossac19
39+
pawpet_m0.upload.protocol=sam-ba
40+
pawpet_m0.upload.maximum_size=262144
41+
pawpet_m0.upload.offset=0x2000
42+
pawpet_m0.upload.use_1200bps_touch=true
43+
pawpet_m0.upload.wait_for_upload_port=true
44+
pawpet_m0.upload.native_usb=true
45+
46+
# Build
47+
pawpet_m0.build.mcu=cortex-m0plus
48+
pawpet_m0.build.f_cpu=48000000L
49+
pawpet_m0.build.usb_product="PawPet M0"
50+
pawpet_m0.build.usb_manufacturer="NanoCodeBug"
51+
pawpet_m0.build.board=SAMD_ZERO
52+
pawpet_m0.build.core=arduino
53+
pawpet_m0.build.extra_flags=-D__SAMD21G18A__ -DADAFRUIT_FEATHER_M0 -DARDUINO_SAMD_ZERO -DARM_MATH_CM0PLUS -DCRYSTALLESS {build.usb_flags}
54+
pawpet_m0.build.ldscript=linker_scripts/gcc/flash_with_bootloader.ld
55+
pawpet_m0.build.openocdscript=openocd_scripts/pawpet_m0.cfg
56+
pawpet_m0.build.variant=pawpet_m0
57+
pawpet_m0.build.variant_system_lib=
58+
pawpet_m0.build.vid=0x239A
59+
pawpet_m0.build.pid=0x800B
60+
pawpet_m0.bootloader.tool=openocd
61+
pawpet_m0.bootloader.file=PawPetM0/bootloader-pawpet_m0-v3.14.0-dirty.bin
62+
63+
# Menu
64+
pawpet_m0.menu.opt.small=Small (-Os) (standard)
65+
pawpet_m0.menu.opt.small.build.flags.optimize=-Os
66+
pawpet_m0.menu.opt.fast=Fast (-O2)
67+
pawpet_m0.menu.opt.fast.build.flags.optimize=-O2
68+
pawpet_m0.menu.opt.faster=Faster (-O3)
69+
pawpet_m0.menu.opt.faster.build.flags.optimize=-O3
70+
pawpet_m0.menu.opt.fastest=Fastest (-Ofast)
71+
pawpet_m0.menu.opt.fastest.build.flags.optimize=-Ofast
72+
pawpet_m0.menu.opt.dragons=Here be dragons (-Ofast -funroll-loops)
73+
pawpet_m0.menu.opt.dragons.build.flags.optimize=-Ofast -funroll-loops
74+
pawpet_m0.menu.usbstack.arduino=Arduino
75+
pawpet_m0.menu.usbstack.tinyusb=TinyUSB
76+
pawpet_m0.menu.usbstack.tinyusb.build.flags.usbstack=-DUSE_TINYUSB
77+
pawpet_m0.menu.debug.off=Off
78+
pawpet_m0.menu.debug.on=On
79+
pawpet_m0.menu.debug.on.build.flags.debug=-g
80+
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)