Update
This commit is contained in:
41
attiny1616-dev-board/.github/workflows/build-safe.yml
vendored
Normal file
41
attiny1616-dev-board/.github/workflows/build-safe.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Build t1616-password-entry
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ./firmware/t1616-password-entry
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install --upgrade platformio
|
||||
|
||||
- name: Run PlatformIO
|
||||
working-directory: ./firmware/t1616-password-entry
|
||||
run: pio run
|
||||
|
||||
41
attiny1616-dev-board/.github/workflows/build-starter.yml
vendored
Normal file
41
attiny1616-dev-board/.github/workflows/build-starter.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
||||
name: Build t1616-starter
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- ./firmware/t1616-starter
|
||||
pull_request:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Cache pip
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.cache/pip
|
||||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
|
||||
restore-keys: |
|
||||
${{ runner.os }}-pip-
|
||||
|
||||
- name: Cache PlatformIO
|
||||
uses: actions/cache@v2
|
||||
with:
|
||||
path: ~/.platformio
|
||||
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v2
|
||||
|
||||
- name: Install PlatformIO
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install --upgrade platformio
|
||||
|
||||
- name: Run PlatformIO
|
||||
working-directory: ./firmware/t1616-starter
|
||||
run: pio run
|
||||
|
||||
3
attiny1616-dev-board/.gitmodules
vendored
Normal file
3
attiny1616-dev-board/.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
[submodule "firmware/jtag2updi"]
|
||||
path = firmware/jtag2updi
|
||||
url = https://github.com/anabolyc/jtag2updi
|
||||
339
attiny1616-dev-board/LICENSE
Normal file
339
attiny1616-dev-board/LICENSE
Normal file
@@ -0,0 +1,339 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The licenses for most software are designed to take away your
|
||||
freedom to share and change it. By contrast, the GNU General Public
|
||||
License is intended to guarantee your freedom to share and change free
|
||||
software--to make sure the software is free for all its users. This
|
||||
General Public License applies to most of the Free Software
|
||||
Foundation's software and to any other program whose authors commit to
|
||||
using it. (Some other Free Software Foundation software is covered by
|
||||
the GNU Lesser General Public License instead.) You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
this service if you wish), that you receive source code or can get it
|
||||
if you want it, that you can change the software or use pieces of it
|
||||
in new free programs; and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to make restrictions that forbid
|
||||
anyone to deny you these rights or to ask you to surrender the rights.
|
||||
These restrictions translate to certain responsibilities for you if you
|
||||
distribute copies of the software, or if you modify it.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must give the recipients all the rights that
|
||||
you have. You must make sure that they, too, receive or can get the
|
||||
source code. And you must show them these terms so they know their
|
||||
rights.
|
||||
|
||||
We protect your rights with two steps: (1) copyright the software, and
|
||||
(2) offer you this license which gives you legal permission to copy,
|
||||
distribute and/or modify the software.
|
||||
|
||||
Also, for each author's protection and ours, we want to make certain
|
||||
that everyone understands that there is no warranty for this free
|
||||
software. If the software is modified by someone else and passed on, we
|
||||
want its recipients to know that what they have is not the original, so
|
||||
that any problems introduced by others will not reflect on the original
|
||||
authors' reputations.
|
||||
|
||||
Finally, any free program is threatened constantly by software
|
||||
patents. We wish to avoid the danger that redistributors of a free
|
||||
program will individually obtain patent licenses, in effect making the
|
||||
program proprietary. To prevent this, we have made it clear that any
|
||||
patent must be licensed for everyone's free use or not licensed at all.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
0. This License applies to any program or other work which contains
|
||||
a notice placed by the copyright holder saying it may be distributed
|
||||
under the terms of this General Public License. The "Program", below,
|
||||
refers to any such program or work, and a "work based on the Program"
|
||||
means either the Program or any derivative work under copyright law:
|
||||
that is to say, a work containing the Program or a portion of it,
|
||||
either verbatim or with modifications and/or translated into another
|
||||
language. (Hereinafter, translation is included without limitation in
|
||||
the term "modification".) Each licensee is addressed as "you".
|
||||
|
||||
Activities other than copying, distribution and modification are not
|
||||
covered by this License; they are outside its scope. The act of
|
||||
running the Program is not restricted, and the output from the Program
|
||||
is covered only if its contents constitute a work based on the
|
||||
Program (independent of having been made by running the Program).
|
||||
Whether that is true depends on what the Program does.
|
||||
|
||||
1. You may copy and distribute verbatim copies of the Program's
|
||||
source code as you receive it, in any medium, provided that you
|
||||
conspicuously and appropriately publish on each copy an appropriate
|
||||
copyright notice and disclaimer of warranty; keep intact all the
|
||||
notices that refer to this License and to the absence of any warranty;
|
||||
and give any other recipients of the Program a copy of this License
|
||||
along with the Program.
|
||||
|
||||
You may charge a fee for the physical act of transferring a copy, and
|
||||
you may at your option offer warranty protection in exchange for a fee.
|
||||
|
||||
2. You may modify your copy or copies of the Program or any portion
|
||||
of it, thus forming a work based on the Program, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
above, provided that you also meet all of these conditions:
|
||||
|
||||
a) You must cause the modified files to carry prominent notices
|
||||
stating that you changed the files and the date of any change.
|
||||
|
||||
b) You must cause any work that you distribute or publish, that in
|
||||
whole or in part contains or is derived from the Program or any
|
||||
part thereof, to be licensed as a whole at no charge to all third
|
||||
parties under the terms of this License.
|
||||
|
||||
c) If the modified program normally reads commands interactively
|
||||
when run, you must cause it, when started running for such
|
||||
interactive use in the most ordinary way, to print or display an
|
||||
announcement including an appropriate copyright notice and a
|
||||
notice that there is no warranty (or else, saying that you provide
|
||||
a warranty) and that users may redistribute the program under
|
||||
these conditions, and telling the user how to view a copy of this
|
||||
License. (Exception: if the Program itself is interactive but
|
||||
does not normally print such an announcement, your work based on
|
||||
the Program is not required to print an announcement.)
|
||||
|
||||
These requirements apply to the modified work as a whole. If
|
||||
identifiable sections of that work are not derived from the Program,
|
||||
and can be reasonably considered independent and separate works in
|
||||
themselves, then this License, and its terms, do not apply to those
|
||||
sections when you distribute them as separate works. But when you
|
||||
distribute the same sections as part of a whole which is a work based
|
||||
on the Program, the distribution of the whole must be on the terms of
|
||||
this License, whose permissions for other licensees extend to the
|
||||
entire whole, and thus to each and every part regardless of who wrote it.
|
||||
|
||||
Thus, it is not the intent of this section to claim rights or contest
|
||||
your rights to work written entirely by you; rather, the intent is to
|
||||
exercise the right to control the distribution of derivative or
|
||||
collective works based on the Program.
|
||||
|
||||
In addition, mere aggregation of another work not based on the Program
|
||||
with the Program (or with a work based on the Program) on a volume of
|
||||
a storage or distribution medium does not bring the other work under
|
||||
the scope of this License.
|
||||
|
||||
3. You may copy and distribute the Program (or a work based on it,
|
||||
under Section 2) in object code or executable form under the terms of
|
||||
Sections 1 and 2 above provided that you also do one of the following:
|
||||
|
||||
a) Accompany it with the complete corresponding machine-readable
|
||||
source code, which must be distributed under the terms of Sections
|
||||
1 and 2 above on a medium customarily used for software interchange; or,
|
||||
|
||||
b) Accompany it with a written offer, valid for at least three
|
||||
years, to give any third party, for a charge no more than your
|
||||
cost of physically performing source distribution, a complete
|
||||
machine-readable copy of the corresponding source code, to be
|
||||
distributed under the terms of Sections 1 and 2 above on a medium
|
||||
customarily used for software interchange; or,
|
||||
|
||||
c) Accompany it with the information you received as to the offer
|
||||
to distribute corresponding source code. (This alternative is
|
||||
allowed only for noncommercial distribution and only if you
|
||||
received the program in object code or executable form with such
|
||||
an offer, in accord with Subsection b above.)
|
||||
|
||||
The source code for a work means the preferred form of the work for
|
||||
making modifications to it. For an executable work, complete source
|
||||
code means all the source code for all modules it contains, plus any
|
||||
associated interface definition files, plus the scripts used to
|
||||
control compilation and installation of the executable. However, as a
|
||||
special exception, the source code distributed need not include
|
||||
anything that is normally distributed (in either source or binary
|
||||
form) with the major components (compiler, kernel, and so on) of the
|
||||
operating system on which the executable runs, unless that component
|
||||
itself accompanies the executable.
|
||||
|
||||
If distribution of executable or object code is made by offering
|
||||
access to copy from a designated place, then offering equivalent
|
||||
access to copy the source code from the same place counts as
|
||||
distribution of the source code, even though third parties are not
|
||||
compelled to copy the source along with the object code.
|
||||
|
||||
4. You may not copy, modify, sublicense, or distribute the Program
|
||||
except as expressly provided under this License. Any attempt
|
||||
otherwise to copy, modify, sublicense or distribute the Program is
|
||||
void, and will automatically terminate your rights under this License.
|
||||
However, parties who have received copies, or rights, from you under
|
||||
this License will not have their licenses terminated so long as such
|
||||
parties remain in full compliance.
|
||||
|
||||
5. You are not required to accept this License, since you have not
|
||||
signed it. However, nothing else grants you permission to modify or
|
||||
distribute the Program or its derivative works. These actions are
|
||||
prohibited by law if you do not accept this License. Therefore, by
|
||||
modifying or distributing the Program (or any work based on the
|
||||
Program), you indicate your acceptance of this License to do so, and
|
||||
all its terms and conditions for copying, distributing or modifying
|
||||
the Program or works based on it.
|
||||
|
||||
6. Each time you redistribute the Program (or any work based on the
|
||||
Program), the recipient automatically receives a license from the
|
||||
original licensor to copy, distribute or modify the Program subject to
|
||||
these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties to
|
||||
this License.
|
||||
|
||||
7. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot
|
||||
distribute so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you
|
||||
may not distribute the Program at all. For example, if a patent
|
||||
license would not permit royalty-free redistribution of the Program by
|
||||
all those who receive copies directly or indirectly through you, then
|
||||
the only way you could satisfy both it and this License would be to
|
||||
refrain entirely from distribution of the Program.
|
||||
|
||||
If any portion of this section is held invalid or unenforceable under
|
||||
any particular circumstance, the balance of the section is intended to
|
||||
apply and the section as a whole is intended to apply in other
|
||||
circumstances.
|
||||
|
||||
It is not the purpose of this section to induce you to infringe any
|
||||
patents or other property right claims or to contest validity of any
|
||||
such claims; this section has the sole purpose of protecting the
|
||||
integrity of the free software distribution system, which is
|
||||
implemented by public license practices. Many people have made
|
||||
generous contributions to the wide range of software distributed
|
||||
through that system in reliance on consistent application of that
|
||||
system; it is up to the author/donor to decide if he or she is willing
|
||||
to distribute software through any other system and a licensee cannot
|
||||
impose that choice.
|
||||
|
||||
This section is intended to make thoroughly clear what is believed to
|
||||
be a consequence of the rest of this License.
|
||||
|
||||
8. If the distribution and/or use of the Program is restricted in
|
||||
certain countries either by patents or by copyrighted interfaces, the
|
||||
original copyright holder who places the Program under this License
|
||||
may add an explicit geographical distribution limitation excluding
|
||||
those countries, so that distribution is permitted only in or among
|
||||
countries not thus excluded. In such case, this License incorporates
|
||||
the limitation as if written in the body of this License.
|
||||
|
||||
9. The Free Software Foundation may publish revised and/or new versions
|
||||
of the General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the Program
|
||||
specifies a version number of this License which applies to it and "any
|
||||
later version", you have the option of following the terms and conditions
|
||||
either of that version or of any later version published by the Free
|
||||
Software Foundation. If the Program does not specify a version number of
|
||||
this License, you may choose any version ever published by the Free Software
|
||||
Foundation.
|
||||
|
||||
10. If you wish to incorporate parts of the Program into other free
|
||||
programs whose distribution conditions are different, write to the author
|
||||
to ask for permission. For software which is copyrighted by the Free
|
||||
Software Foundation, write to the Free Software Foundation; we sometimes
|
||||
make exceptions for this. Our decision will be guided by the two goals
|
||||
of preserving the free status of all derivatives of our free software and
|
||||
of promoting the sharing and reuse of software generally.
|
||||
|
||||
NO WARRANTY
|
||||
|
||||
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
|
||||
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
|
||||
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
|
||||
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
|
||||
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
|
||||
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
|
||||
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
|
||||
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
|
||||
REPAIR OR CORRECTION.
|
||||
|
||||
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
|
||||
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
|
||||
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
|
||||
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
|
||||
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
|
||||
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
convey the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
<one line to give the program's name and a brief idea of what it does.>
|
||||
Copyright (C) <year> <name of author>
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License along
|
||||
with this program; if not, write to the Free Software Foundation, Inc.,
|
||||
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program is interactive, make it output a short notice like this
|
||||
when it starts in an interactive mode:
|
||||
|
||||
Gnomovision version 69, Copyright (C) year name of author
|
||||
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, the commands you use may
|
||||
be called something other than `show w' and `show c'; they could even be
|
||||
mouse-clicks or menu items--whatever suits your program.
|
||||
|
||||
You should also get your employer (if you work as a programmer) or your
|
||||
school, if any, to sign a "copyright disclaimer" for the program, if
|
||||
necessary. Here is a sample; alter the names:
|
||||
|
||||
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
|
||||
`Gnomovision' (which makes passes at compilers) written by James Hacker.
|
||||
|
||||
<signature of Ty Coon>, 1 April 1989
|
||||
Ty Coon, President of Vice
|
||||
|
||||
This General Public License does not permit incorporating your program into
|
||||
proprietary programs. If your program is a subroutine library, you may
|
||||
consider it more useful to permit linking proprietary applications with the
|
||||
library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License.
|
||||
151
attiny1616-dev-board/README.md
Normal file
151
attiny1616-dev-board/README.md
Normal file
@@ -0,0 +1,151 @@
|
||||
# ATtiny 1616 Development Board
|
||||
|
||||

|
||||

|
||||
<a href="https://www.tindie.com/stores/sonocotta/?ref=offsite_badges&utm_source=sellers_andrey-malyshenko&utm_medium=badges&utm_campaign=badge_medium"><img src="https://d2ss6ovg47m0r5.cloudfront.net/badges/tindie-mediums.png" alt="I sell on Tindie" width="150" height="78"></a>
|
||||
<br />
|
||||
[](https://discord.gg/PtnaAaQMpS)
|
||||
|
||||
ATtiny 1616 Development Board is a small and handy development board built around the new generation of the ATiny series. It is pin and size compatible with Arduino Nano board and can be used as its direct replacement (with certain limitations). It can be programmed using both Arduino IDE and Platformio IDE, as well as vanilla console tools.
|
||||
|
||||

|
||||
|
||||
## Motivation
|
||||
|
||||
I'm a big fan of early ATtiny series chips, I even made my own [ATtiny Flasher](https://sonocotta.com/attiny-flasher/) tool for productive development and a few educational kits based on ubiquitous ATtiny85. The time has come to extend my horizons and look into the modern line of ATtiny chips, specifically so called 1-series and 2-series line of MCUs.
|
||||
|
||||
No need to mention that they went far ahead old series, and have resources comparable with the old ATmega series. This gave me the idea to make an Arduino Nano pin-compatible development board, so I can start using it the projects, where I'd normally pick Arduino Nano. In my practice, the best way to get familiar with new hardware is to start using it in the actual projects.
|
||||
|
||||
## Features
|
||||
|
||||
- [ATTINY1616](https://www.microchip.com/en-us/product/ATTINY1616) 8-bit MCU in a 20-pin package
|
||||
- Up to 20 MHz guaranteed by the manufacturer, up to 32 MHz reported by community in normal conditions
|
||||
- 16 KB Flash
|
||||
- 2 KB SRAM
|
||||
- 128B of EEPROM
|
||||
- UPDI interface for flashing and debugging
|
||||
- Onboard 5V LDO (disconnected for low-power applications)
|
||||
- Flash using Arduino IDE, Platformio, or the IDE of your choice
|
||||
- Onboard USB-Serial bridge (CH340E) connected to hardware Serial port
|
||||
- One RGB LED (WS2812B)
|
||||
- One Push button
|
||||
|
||||
## ATtiny1616
|
||||
|
||||
ATiny1616 is a mid-range chip in new [ATtiny 1-Series line](https://en.wikipedia.org/wiki/ATtiny_microcontroller_comparison_chart). Generally, they offer considerably more than older Tiny-series chips, and are comparable with classic ATmega AVRs, offering at the same time new MCU features, not available in older series.
|
||||
|
||||
| | ATTINY88 | ATTINY1616 | ATmega168P | ATmega328P |
|
||||
|---------------|----------|------------|------------|------------|
|
||||
| Max Frequency | | 20 Mhz | 16Mhz | 16Mhz |
|
||||
| Flash | 8KB | 16KB | 16KB | 32KB |
|
||||
| SRAM | 512B | 2KB | 1KB | 2KB |
|
||||
| EEPROM | 64B | 128B | 512B | 1024B |
|
||||
| GPIO count | 28 | 18 | 23 | 23 |
|
||||
| | | | | |
|
||||
| UART | No | Yes | Yes | Yes |
|
||||
| I2C | Yes | Yes | Yes | Yes |
|
||||
| SPI | Yes | Yes | Yes | Yes |
|
||||
| Timers | 2 | 4 | 3 | 3 |
|
||||
| PWM channels | 2 | 4 | 6 | 6 |
|
||||
| ADC pins | 8 | 12 | 8 | 8 |
|
||||
|
||||
## Board Pinout
|
||||
|
||||

|
||||
|
||||
Note: Revision A and B have backside pin labels rotated, big 🤦 for me. It will be fixed in the next revisions.
|
||||
|
||||
## MCU Pinout
|
||||
|
||||

|
||||
|
||||
## Arduino Core
|
||||
|
||||
Spence Konde created and maintained [Arduino Core](https://github.com/SpenceKonde/megaTinyCore). This is a great place to start to get to know new chips better and understand what is supported and what isn't.
|
||||
|
||||
## How to flash
|
||||
|
||||
Spence Konde created another great [writeup](https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md) on the flashing routines for the new chips. Short summary below
|
||||
|
||||
- (a) Legacy way is to take any Arduino Nano board and use [jtag2updi](https://github.com/ElTangas/jtag2updi) project to make yourself a programmer.
|
||||
- (b) A better (read recommended) way is to use SerialUPDI tooling with hardware-modified serial programmer
|
||||
- (c) Alternative is to use [Optiboot bootloader](https://github.com/Optiboot/optiboot) and Serial programmer interface like on Arduino boards
|
||||
|
||||
Method (c) is disqualified on 1-Series chip because of RESET/UPDI pin collision, and both (a) and (b) work equally well. The difference is what is easier for you: (a) dedicate Arduino Nano board for programming or (b) do a solder job on your USB-serial adapter.
|
||||
|
||||
### Revision A (Discontinued)
|
||||
|
||||
| Method | Connection |
|
||||
|----------|------------|
|
||||
| jtag2updi | 
|
||||
| SerialUPDI<br/>(recommended) | 
|
||||
|
||||
### Revision B (Current latest)
|
||||
|
||||
Starting from revision B diode between TX and RX pins is included on the board, so you can use an unmodified USB-Serial adapter.
|
||||
|
||||
| Method | Connection |
|
||||
|----------|------------|
|
||||
| jtag2updi | 
|
||||
| SerialUPDI<br/>(recommended) | 
|
||||
|
||||
### Revision C (co-exists with rev B)
|
||||
|
||||
While working on one of the projects, it came to me, hey, there is already a USB-Serial adapter on the board, serving Serial communication. Why not use it for flashing? So revision C came, **no external programmer needed**, plug-n-play. The drawback is that you lose Serial communication via built-in USB.
|
||||
|
||||
### Arduino IDE
|
||||
|
||||
Use Arduino 1.8.x, Core doesn't work with 2.X versions of Arduino at the moment of writing.
|
||||
|
||||
Add [http://drazzy.com/package_drazzy.com_index.json](http://drazzy.com/package_drazzy.com_index.json) to board manager
|
||||
|
||||

|
||||
|
||||
After that, you should install megaTinyCore from Board Manager
|
||||
|
||||

|
||||
|
||||
Select ATtiny1616 as the target and other necessary settings in the board settings after
|
||||
|
||||

|
||||
|
||||
### Platformio IDE
|
||||
|
||||
After installing [Plarformio IDE](https://platformio.org/platformio-ide), open [sample project](/firmware/t1616-starter). Run the `Build` command to install the necessary tools and libraries.
|
||||
|
||||
Next, run the `Upload: tiny1616-jtag2updi` task if you're using the jtag2updi programmer, or the `Upload: tiny1616-serialupdi` task if using the modified Serial adapter method. In both cases, you can use the `Upload and Monitor` task.
|
||||
|
||||
### [Digital Safe firmware](https://github.com/sonocotta/attiny1616-dev-board/tree/main/firmware/t1616-password-entry)
|
||||
|
||||
[Weekend project](https://hackaday.io/project/186193-attiny1616-development-board/log/216421-digital-safe-project-based-on-attiny1616) I did for my 6-year-old son. Based on [Electronic Safe with Arduino](https://projecthub.arduino.cc/chummer1010/62207bc9-3ce8-459e-a1bf-6789ae89eaa0) project, mostly rewritten in order to add support for async execution.
|
||||
|
||||

|
||||
|
||||
## Hardware
|
||||
|
||||

|
||||
|
||||
|
||||
-  ATTINY1616 MCU
|
||||
-  CH340E USB-Serial Adapter connected to Hardware Serial
|
||||
-  WS2812B RGB LED
|
||||
-  UPDI Programming and Debug header
|
||||
-  Hardware Push button
|
||||
-  VIN disconnect - cut this line to disconnect LDO chip and power-on LED, recommended for low-power applications
|
||||
-  RES disconnect - short this line to enable auto-RESET functionality with Optiboot bootloader (read below)
|
||||
|
||||
### Auto reset with Optiboot
|
||||
|
||||
As [explained](https://github.com/SpenceKonde/megaTinyCore) in many details by Spence, 1-Series chips cannot provide Arduino-like one-click-upload with Optiboot behavior without some sacrifice. The reason for that is pin collision: UPDI and RESET are the same pins, so you need to decide which you'd prefer. If you use auto-reset, you lose UPDI, specifically the possibility to change fuses easily (this is important in my opinion). If you use UPDI you need 2 connections to your MCU - one via the programming interface, and another one for Serial communication.
|
||||
|
||||
Personally, I prefer to keep UPDI and use direct programming without a custom bootloader, having extra wire is a minor inconvenience for me, but losing fuses permanently is not an option.
|
||||
|
||||
## Where to buy
|
||||
|
||||
In limited quantities possible to buy at [Tindie](https://www.tindie.com/products/sonocotta/attiny1616-development-board/) and [Elecrow](https://www.elecrow.com/attiny1616-development-board.html)
|
||||
|
||||
## Links
|
||||
|
||||
- [Arduino Core](https://github.com/SpenceKonde/megaTinyCore)
|
||||
- [SerialUPDI guide](https://github.com/SpenceKonde/AVR-Guidance/blob/master/UPDI/jtag2updi.md)
|
||||
- [Datasheet and manufacturer information](https://www.microchip.com/en-us/product/ATTINY1616#)
|
||||
BIN
attiny1616-dev-board/doc/images/Thumbs.db
Normal file
BIN
attiny1616-dev-board/doc/images/Thumbs.db
Normal file
Binary file not shown.
BIN
attiny1616-dev-board/doc/images/open-source-hardware-logo.png
Normal file
BIN
attiny1616-dev-board/doc/images/open-source-hardware-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
BIN
attiny1616-dev-board/doc/images/open-source-software-logo.png
Normal file
BIN
attiny1616-dev-board/doc/images/open-source-software-logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.6 KiB |
5
attiny1616-dev-board/firmware/t1616-password-entry/.gitignore
vendored
Normal file
5
attiny1616-dev-board/firmware/t1616-password-entry/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
.pio
|
||||
.vscode/.browse.c_cpp.db*
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
.vscode/ipch
|
||||
10
attiny1616-dev-board/firmware/t1616-password-entry/.vscode/extensions.json
vendored
Normal file
10
attiny1616-dev-board/firmware/t1616-password-entry/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"platformio.platformio-ide"
|
||||
],
|
||||
"unwantedRecommendations": [
|
||||
"ms-vscode.cpptools-extension-pack"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
[env]
|
||||
platform = atmelmegaavr
|
||||
framework = arduino
|
||||
monitor_speed = 115200
|
||||
monitor_port = /dev/ttyUSB1
|
||||
upload_port = /dev/ttyUSB0
|
||||
board_build.f_cpu = 20000000ul
|
||||
; Serial pins are used on Keypad
|
||||
; build_flags =
|
||||
; -D DEBUG
|
||||
lib_deps =
|
||||
SPI
|
||||
Wire
|
||||
LiquidCrystal
|
||||
Keypad
|
||||
|
||||
[env:tiny1616-serialupdi]
|
||||
board = ATtiny1616
|
||||
upload_speed = 230400
|
||||
upload_flags =
|
||||
--tool
|
||||
uart
|
||||
--device
|
||||
attiny1616
|
||||
--uart
|
||||
$UPLOAD_PORT
|
||||
--clk
|
||||
$UPLOAD_SPEED
|
||||
upload_command = pymcuprog write --erase $UPLOAD_FLAGS --filename $SOURCE
|
||||
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
Arduino Electronic Safe
|
||||
|
||||
Copyright (C) 2020, Uri Shaked.
|
||||
Released under the MIT License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LiquidCrystal_I2C.h>
|
||||
|
||||
// Our custom icon numbers
|
||||
#define ICON_LOCKED_CHAR (byte)0
|
||||
#define ICON_UNLOCKED_CHAR (byte)1
|
||||
|
||||
// This is a standard icon on the LCD1602 character set
|
||||
#define ICON_RIGHT_ARROW (byte)126
|
||||
|
||||
const byte iconLocked[8] PROGMEM = {
|
||||
0b01110,
|
||||
0b10001,
|
||||
0b10001,
|
||||
0b11111,
|
||||
0b11011,
|
||||
0b11011,
|
||||
0b11111,
|
||||
};
|
||||
|
||||
const byte iconUnlocked[8] PROGMEM = {
|
||||
0b01110,
|
||||
0b10000,
|
||||
0b10000,
|
||||
0b11111,
|
||||
0b11011,
|
||||
0b11011,
|
||||
0b11111,
|
||||
};
|
||||
|
||||
class Icons
|
||||
{
|
||||
|
||||
public:
|
||||
Icons(LiquidCrystal_I2C &lcd)
|
||||
{
|
||||
byte icon[8];
|
||||
memcpy_P(icon, iconLocked, sizeof(icon));
|
||||
lcd.createChar(ICON_LOCKED_CHAR, icon);
|
||||
memcpy_P(icon, iconUnlocked, sizeof(icon));
|
||||
lcd.createChar(ICON_UNLOCKED_CHAR, icon);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,91 @@
|
||||
#pragma once
|
||||
|
||||
#include <tinyNeoPixel.h>
|
||||
#include "Tone.h"
|
||||
|
||||
#define PIN_RGB PIN_PA7
|
||||
#define LED_COUNT 1
|
||||
|
||||
class Light
|
||||
{
|
||||
private:
|
||||
tinyNeoPixel *pixels = new tinyNeoPixel(LED_COUNT, PIN_RGB, NEO_GRB + NEO_KHZ800);
|
||||
Tone *tone;
|
||||
|
||||
uint32_t seq_starts = 0;
|
||||
uint32_t seq_ends = 0;
|
||||
uint8_t seq_max = 0;
|
||||
uint8_t seq = 0;
|
||||
uint32_t seq_color = 0;
|
||||
|
||||
void setColor(uint32_t color);
|
||||
void flash(uint32_t color, uint8_t count, uint32_t delay_ms);
|
||||
|
||||
public:
|
||||
Light(Tone *tone) : tone(tone)
|
||||
{
|
||||
pixels->begin();
|
||||
};
|
||||
|
||||
void lock();
|
||||
void denied();
|
||||
void unlock();
|
||||
|
||||
void loop();
|
||||
};
|
||||
|
||||
void Light::setColor(uint32_t color)
|
||||
{
|
||||
pixels->clear();
|
||||
if (color != 0)
|
||||
for (uint8_t i = 0; i < LED_COUNT; i++)
|
||||
pixels->setPixelColor(i, color);
|
||||
pixels->show();
|
||||
}
|
||||
|
||||
void Light::flash(uint32_t color, uint8_t count, uint32_t delay_ms)
|
||||
{
|
||||
seq = 0;
|
||||
seq_max = count * 2 - 1;
|
||||
seq_starts = millis();
|
||||
seq_ends = seq_starts + delay_ms;
|
||||
seq_color = color;
|
||||
pinMode(PIN_RGB, OUTPUT);
|
||||
setColor(color);
|
||||
}
|
||||
|
||||
void Light::lock()
|
||||
{
|
||||
auto blue = pixels->Color(0, 0, 0xff);
|
||||
flash(blue, 1, 500);
|
||||
}
|
||||
|
||||
void Light::denied()
|
||||
{
|
||||
tone->beep(500, 500);
|
||||
auto red = pixels->Color(0xff, 0, 0);
|
||||
flash(red, 5, 200);
|
||||
}
|
||||
|
||||
void Light::unlock()
|
||||
{
|
||||
tone->beep(500, 150, true);
|
||||
auto green = pixels->Color(0, 0xff, 0);
|
||||
flash(green, 3, 250);
|
||||
}
|
||||
|
||||
void Light::loop()
|
||||
{
|
||||
if (seq <= seq_max)
|
||||
{
|
||||
if (millis() > seq_ends)
|
||||
{
|
||||
uint32_t color = (seq % 2 == 0) ? seq_color : pixels->Color(0, 0, 0);
|
||||
setColor(color);
|
||||
seq++;
|
||||
uint32_t delay_ms = seq_ends - seq_starts;
|
||||
seq_starts = seq_ends;
|
||||
seq_ends += delay_ms;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/**
|
||||
Arduino Electronic Safe
|
||||
|
||||
Copyright (C) 2020, Uri Shaked.
|
||||
Released under the MIT License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <EEPROM.h>
|
||||
|
||||
/* Safe state */
|
||||
#define EEPROM_ADDR_LOCKED 0
|
||||
#define EEPROM_ADDR_CODE_LEN 1
|
||||
#define EEPROM_ADDR_CODE 2
|
||||
#define EEPROM_EMPTY 0xff
|
||||
|
||||
#define SAFE_STATE_OPEN (char)0
|
||||
#define SAFE_STATE_LOCKED (char)1
|
||||
|
||||
class SafeState {
|
||||
public:
|
||||
SafeState();
|
||||
void lock();
|
||||
bool unlock(String code);
|
||||
bool locked();
|
||||
bool hasCode();
|
||||
void setCode(String newCode);
|
||||
|
||||
private:
|
||||
void setLock(bool locked);
|
||||
bool _locked;
|
||||
};
|
||||
|
||||
SafeState::SafeState() {
|
||||
this->_locked = EEPROM.read(EEPROM_ADDR_LOCKED) == SAFE_STATE_LOCKED;
|
||||
}
|
||||
|
||||
void SafeState::lock() {
|
||||
this->setLock(true);
|
||||
}
|
||||
|
||||
bool SafeState::locked() {
|
||||
return this->_locked;
|
||||
}
|
||||
|
||||
bool SafeState::hasCode() {
|
||||
auto codeLength = EEPROM.read(EEPROM_ADDR_CODE_LEN);
|
||||
return codeLength != EEPROM_EMPTY;
|
||||
}
|
||||
|
||||
void SafeState::setCode(String newCode) {
|
||||
EEPROM.write(EEPROM_ADDR_CODE_LEN, newCode.length());
|
||||
for (byte i = 0; i < newCode.length(); i++) {
|
||||
EEPROM.write(EEPROM_ADDR_CODE + i, newCode[i]);
|
||||
}
|
||||
}
|
||||
|
||||
bool SafeState::unlock(String code) {
|
||||
auto codeLength = EEPROM.read(EEPROM_ADDR_CODE_LEN);
|
||||
if (codeLength == EEPROM_EMPTY) {
|
||||
// There was no code, so unlock always succeeds
|
||||
this->setLock(false);
|
||||
return true;
|
||||
}
|
||||
if (code.length() != codeLength) {
|
||||
return false;
|
||||
}
|
||||
for (byte i = 0; i < code.length(); i++) {
|
||||
auto digit = EEPROM.read(EEPROM_ADDR_CODE + i);
|
||||
if (digit != code[i]) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this->setLock(false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void SafeState::setLock(bool locked) {
|
||||
this->_locked = locked;
|
||||
EEPROM.write(EEPROM_ADDR_LOCKED, locked ? SAFE_STATE_LOCKED : SAFE_STATE_OPEN);
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
#pragma once
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
#define PIN_BUZZER PIN_PC2
|
||||
#define NO_TONE \
|
||||
noTone(PIN_BUZZER); \
|
||||
digitalWrite(PIN_BUZZER, HIGH);
|
||||
|
||||
class Tone
|
||||
{
|
||||
private:
|
||||
uint32_t beep_start = 0;
|
||||
uint32_t beep_end = 0;
|
||||
uint32_t beep_freq = 0;
|
||||
bool beeping = false;
|
||||
bool isHappy = false;
|
||||
|
||||
public:
|
||||
Tone()
|
||||
{
|
||||
digitalWrite(PIN_BUZZER, HIGH);
|
||||
};
|
||||
|
||||
void beep(uint32_t how_long, uint32_t freq, bool happy = false);
|
||||
void happyBeep(uint32_t how_long, uint32_t freq);
|
||||
void loop();
|
||||
};
|
||||
|
||||
void Tone::beep(uint32_t how_long, uint32_t freq, bool happy)
|
||||
{
|
||||
beep_start = millis();
|
||||
beep_end = beep_start + how_long;
|
||||
beep_freq = freq;
|
||||
tone(PIN_BUZZER, beep_freq);
|
||||
isHappy = happy;
|
||||
beeping = true;
|
||||
}
|
||||
|
||||
void Tone::loop()
|
||||
{
|
||||
if (beeping)
|
||||
{
|
||||
if (isHappy)
|
||||
{
|
||||
tone(PIN_BUZZER, beep_freq + (millis() - beep_start));
|
||||
}
|
||||
|
||||
if (millis() > beep_end)
|
||||
{
|
||||
NO_TONE;
|
||||
beeping = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
326
attiny1616-dev-board/firmware/t1616-password-entry/src/UI.h
Normal file
326
attiny1616-dev-board/firmware/t1616-password-entry/src/UI.h
Normal file
@@ -0,0 +1,326 @@
|
||||
#pragma once
|
||||
|
||||
#include <LiquidCrystal_I2C.h>
|
||||
#include <Keypad.h>
|
||||
#include "SafeState.h"
|
||||
#include "Icons.h"
|
||||
#include "Light.h"
|
||||
#include "Tone.h"
|
||||
|
||||
#define PIN_LENGTH 4
|
||||
|
||||
#define DELAY_LOCK 800
|
||||
#define DELAY_UNLOCK 800
|
||||
#define DELAY_MISMATCH 800
|
||||
#define DELAY_DENIED 1600
|
||||
#define DELAY_WELCOME 500
|
||||
#define DELAY_UNLOCKED 1000
|
||||
#define DELAY_STEPS 8
|
||||
|
||||
#define KEY_BEEP_MS 50
|
||||
#define IDLE_TIMEOUT 8000
|
||||
|
||||
enum State
|
||||
{
|
||||
WELCOME_1,
|
||||
WELCOME_2,
|
||||
|
||||
CHECK_LOCKED,
|
||||
SAFE_LOCKED,
|
||||
SAFE_LOCKED_INPUTKEY,
|
||||
SAFE_LOCKED_VALIDATE,
|
||||
SAFE_LOCKED_DOUNLOCK,
|
||||
SAFE_LOCKED_DENIED,
|
||||
SAFE_UNLOCKED,
|
||||
SAFE_UNLOCKED_ASKKEY,
|
||||
SAFE_UNLOCKED_INPUTKEY,
|
||||
SAFE_UNLOCKED_REPEATKEY,
|
||||
SAFE_UNLOCKED_MATCH,
|
||||
SAFE_UNLOCKED_MISMATCH,
|
||||
SAFE_UNLOCKED_DOLOCK,
|
||||
|
||||
WAIT_SCREEN_START,
|
||||
WAIT_SCREEN_PROGRESS,
|
||||
WAIT_SCREEN_NONBLOCKING,
|
||||
INPUT_PIN,
|
||||
};
|
||||
|
||||
class UI
|
||||
{
|
||||
private:
|
||||
LiquidCrystal_I2C *lcd;
|
||||
Keypad *keypad;
|
||||
SafeState *safeState;
|
||||
Light *light;
|
||||
Tone *tone;
|
||||
|
||||
State state = WELCOME_1;
|
||||
void setState(State _state)
|
||||
{
|
||||
// Serial.printf("State) { %d -> %d\n", state, _state);
|
||||
state = _state;
|
||||
};
|
||||
|
||||
uint32_t idle_since = 0;
|
||||
|
||||
// Nonblocking wait
|
||||
uint32_t wait_from = 0;
|
||||
uint32_t wait_till = 0;
|
||||
uint8_t wait_step = 0;
|
||||
State state_after_break;
|
||||
void wait(uint32_t how_long, State state_after, bool showProgress = true);
|
||||
|
||||
// Nonblocking pin reading
|
||||
char key[PIN_LENGTH + 1] = {0};
|
||||
char pin[PIN_LENGTH + 1] = {0};
|
||||
uint8_t pin_keys;
|
||||
State state_after_pin;
|
||||
void askpin(State state_after);
|
||||
|
||||
protected:
|
||||
void showWaitScreen(int delayMillis);
|
||||
|
||||
public:
|
||||
UI(LiquidCrystal_I2C *lcd, Keypad *keypad, SafeState *safeState, Light *light, Tone *tone)
|
||||
: lcd(lcd), keypad(keypad), safeState(safeState), light(light), tone(tone)
|
||||
{
|
||||
idle_since = millis();
|
||||
};
|
||||
|
||||
void loop();
|
||||
};
|
||||
|
||||
void UI::loop()
|
||||
{
|
||||
static bool newCodeNeeded;
|
||||
|
||||
if (state == WELCOME_1)
|
||||
{
|
||||
lcd->setCursor(4, 0);
|
||||
lcd->print("Welcome!");
|
||||
wait(DELAY_WELCOME, WELCOME_2, false);
|
||||
}
|
||||
|
||||
else if (state == WELCOME_2)
|
||||
{
|
||||
lcd->setCursor(0, 2);
|
||||
String message = "Tiny1616 Safe";
|
||||
for (byte i = 0; i < message.length(); i++)
|
||||
{
|
||||
lcd->print(message[i]);
|
||||
delay(50);
|
||||
}
|
||||
wait(DELAY_WELCOME, CHECK_LOCKED, false);
|
||||
}
|
||||
|
||||
else if (state == CHECK_LOCKED)
|
||||
{
|
||||
setState(safeState->locked() ? SAFE_LOCKED : SAFE_UNLOCKED);
|
||||
}
|
||||
|
||||
else if (state == SAFE_LOCKED)
|
||||
{
|
||||
lcd->clear();
|
||||
lcd->setCursor(0, 0);
|
||||
lcd->write(ICON_LOCKED_CHAR);
|
||||
lcd->print(" Safe Locked! ");
|
||||
lcd->write(ICON_LOCKED_CHAR);
|
||||
setState(SAFE_LOCKED_INPUTKEY);
|
||||
}
|
||||
|
||||
else if (state == SAFE_UNLOCKED)
|
||||
{
|
||||
lcd->clear();
|
||||
|
||||
lcd->setCursor(0, 0);
|
||||
lcd->write(ICON_UNLOCKED_CHAR);
|
||||
lcd->setCursor(2, 0);
|
||||
lcd->print(" # to lock");
|
||||
lcd->setCursor(15, 0);
|
||||
lcd->write(ICON_UNLOCKED_CHAR);
|
||||
|
||||
newCodeNeeded = true;
|
||||
|
||||
if (safeState->hasCode())
|
||||
{
|
||||
lcd->setCursor(0, 1);
|
||||
lcd->print(" A = new code");
|
||||
newCodeNeeded = false;
|
||||
}
|
||||
|
||||
setState(SAFE_UNLOCKED_ASKKEY);
|
||||
}
|
||||
|
||||
else if (state == SAFE_LOCKED_INPUTKEY)
|
||||
{
|
||||
askpin(SAFE_LOCKED_VALIDATE);
|
||||
}
|
||||
|
||||
else if (state == SAFE_LOCKED_VALIDATE)
|
||||
{
|
||||
bool unlockedSuccessfully = safeState->unlock(String(pin));
|
||||
wait(DELAY_UNLOCK, unlockedSuccessfully ? SAFE_LOCKED_DOUNLOCK : SAFE_LOCKED_DENIED);
|
||||
}
|
||||
|
||||
else if (state == SAFE_LOCKED_DOUNLOCK)
|
||||
{
|
||||
light->unlock();
|
||||
lcd->clear();
|
||||
lcd->setCursor(0, 0);
|
||||
lcd->write(ICON_UNLOCKED_CHAR);
|
||||
lcd->setCursor(4, 0);
|
||||
lcd->print("Unlocked!");
|
||||
lcd->setCursor(15, 0);
|
||||
lcd->write(ICON_UNLOCKED_CHAR);
|
||||
wait(DELAY_UNLOCKED, SAFE_UNLOCKED, false);
|
||||
}
|
||||
|
||||
else if (state == SAFE_LOCKED_DENIED)
|
||||
{
|
||||
lcd->clear();
|
||||
lcd->setCursor(0, 0);
|
||||
lcd->print("Access Denied!");
|
||||
light->denied();
|
||||
wait(DELAY_DENIED, SAFE_LOCKED);
|
||||
}
|
||||
|
||||
else if (state == SAFE_UNLOCKED_INPUTKEY)
|
||||
{
|
||||
lcd->clear();
|
||||
lcd->setCursor(0, 0);
|
||||
lcd->print("Enter new code) {");
|
||||
askpin(SAFE_UNLOCKED_REPEATKEY);
|
||||
}
|
||||
|
||||
else if (state == SAFE_UNLOCKED_REPEATKEY)
|
||||
{
|
||||
strcpy(key, pin);
|
||||
lcd->clear();
|
||||
lcd->setCursor(0, 0);
|
||||
lcd->print("Confirm new code");
|
||||
askpin(SAFE_UNLOCKED_MATCH);
|
||||
}
|
||||
|
||||
else if (state == SAFE_UNLOCKED_MATCH)
|
||||
{
|
||||
if (strcmp(key, pin) == 0)
|
||||
{
|
||||
safeState->setCode(String(pin));
|
||||
setState(SAFE_UNLOCKED_DOLOCK);
|
||||
}
|
||||
else
|
||||
{
|
||||
lcd->clear();
|
||||
lcd->setCursor(1, 0);
|
||||
lcd->print("Code mismatch");
|
||||
lcd->setCursor(0, 1);
|
||||
lcd->print("Safe not locked!");
|
||||
wait(DELAY_MISMATCH, SAFE_UNLOCKED);
|
||||
}
|
||||
}
|
||||
|
||||
else if (state == SAFE_UNLOCKED_DOLOCK)
|
||||
{
|
||||
lcd->clear();
|
||||
lcd->setCursor(5, 0);
|
||||
lcd->write(ICON_UNLOCKED_CHAR);
|
||||
lcd->print(" ");
|
||||
lcd->write(ICON_RIGHT_ARROW);
|
||||
lcd->print(" ");
|
||||
lcd->write(ICON_LOCKED_CHAR);
|
||||
|
||||
light->lock();
|
||||
safeState->lock();
|
||||
wait(DELAY_LOCK, CHECK_LOCKED);
|
||||
}
|
||||
|
||||
else if (state == WAIT_SCREEN_PROGRESS)
|
||||
{
|
||||
uint32_t total = wait_till - wait_from;
|
||||
uint32_t passed = millis() - wait_from;
|
||||
uint32_t wait_step_ms = total / DELAY_STEPS;
|
||||
if (passed > wait_step * wait_step_ms)
|
||||
{
|
||||
wait_step++;
|
||||
lcd->print("#");
|
||||
}
|
||||
|
||||
if (millis() > wait_till)
|
||||
setState(state_after_break);
|
||||
}
|
||||
|
||||
else if (state == WAIT_SCREEN_NONBLOCKING)
|
||||
{
|
||||
if (millis() > wait_till)
|
||||
setState(state_after_break);
|
||||
}
|
||||
|
||||
else if (state == INPUT_PIN)
|
||||
{
|
||||
{
|
||||
char key = keypad->getKey();
|
||||
if (key != NO_KEY)
|
||||
idle_since = millis();
|
||||
|
||||
if (key >= '0' && key <= '9')
|
||||
{
|
||||
tone->beep(KEY_BEEP_MS, 2000);
|
||||
lcd->print('*');
|
||||
pin[pin_keys] = key;
|
||||
pin_keys++;
|
||||
}
|
||||
|
||||
if (pin_keys >= PIN_LENGTH)
|
||||
setState(state_after_pin);
|
||||
}
|
||||
}
|
||||
|
||||
else if (state == SAFE_UNLOCKED_ASKKEY)
|
||||
{
|
||||
auto key = keypad->getKey();
|
||||
if (key != NO_KEY)
|
||||
idle_since = millis();
|
||||
|
||||
if (key == 'A' || key == '#')
|
||||
{
|
||||
tone->beep(KEY_BEEP_MS, 2000);
|
||||
if (key == 'A' || newCodeNeeded)
|
||||
setState(SAFE_UNLOCKED_INPUTKEY);
|
||||
else
|
||||
setState(SAFE_UNLOCKED_DOLOCK);
|
||||
}
|
||||
}
|
||||
|
||||
lcd->setBacklight(idle_since + IDLE_TIMEOUT > millis());
|
||||
}
|
||||
|
||||
void UI::wait(uint32_t how_long, State state_after, bool showProgress)
|
||||
{
|
||||
wait_step = 0;
|
||||
wait_from = millis();
|
||||
wait_till = wait_from + how_long;
|
||||
state_after_break = state_after;
|
||||
if (showProgress)
|
||||
{
|
||||
lcd->setCursor(0, 1);
|
||||
lcd->print(" [ ] ");
|
||||
lcd->setCursor(4, 1);
|
||||
setState(WAIT_SCREEN_PROGRESS);
|
||||
}
|
||||
else
|
||||
{
|
||||
setState(WAIT_SCREEN_NONBLOCKING);
|
||||
}
|
||||
};
|
||||
|
||||
void UI::askpin(State state_after)
|
||||
{
|
||||
// todo: 4 symbols only?
|
||||
lcd->setCursor(5, 1);
|
||||
lcd->print("[____]");
|
||||
lcd->setCursor(6, 1);
|
||||
|
||||
pin_keys = 0;
|
||||
state_after_pin = state_after;
|
||||
setState(INPUT_PIN);
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
#include <Wire.h>
|
||||
|
||||
/* Display */
|
||||
#include <LiquidCrystal_I2C.h>
|
||||
|
||||
#define PIN_LCD_EN 2
|
||||
#define PIN_LCD_RW 1
|
||||
#define PIN_LCD_RES 0
|
||||
#define PIN_LCD_LED 3
|
||||
#define PIN_LCD_D4 4
|
||||
#define PIN_LCD_D5 5
|
||||
#define PIN_LCD_D6 6
|
||||
#define PIN_LCD_D7 7
|
||||
|
||||
#define LCD_I2C_ADDR 0x3f
|
||||
|
||||
LiquidCrystal_I2C _lcd(
|
||||
LCD_I2C_ADDR, PIN_LCD_EN, PIN_LCD_RW, PIN_LCD_RES,
|
||||
PIN_LCD_D4, PIN_LCD_D5, PIN_LCD_D6, PIN_LCD_D7,
|
||||
PIN_LCD_LED, POSITIVE);
|
||||
|
||||
/* Keypad setup */
|
||||
#include <Keypad.h>
|
||||
|
||||
const byte KEYPAD_ROWS = 4;
|
||||
const byte KEYPAD_COLS = 4;
|
||||
byte rowPins[KEYPAD_ROWS] = {PIN_PC1, PIN_PC0, PIN_PB0, PIN_PB1};
|
||||
byte colPins[KEYPAD_COLS] = {PIN_PB2, PIN_PB3, PIN_PB4, PIN_PB5};
|
||||
char keys[KEYPAD_ROWS][KEYPAD_COLS] = {
|
||||
{'1', '2', '3', 'A'},
|
||||
{'4', '5', '6', 'B'},
|
||||
{'7', '8', '9', 'C'},
|
||||
{'*', '0', '#', 'D'}};
|
||||
|
||||
Keypad _keypad = Keypad(makeKeymap(keys), rowPins, colPins, KEYPAD_ROWS, KEYPAD_COLS);
|
||||
|
||||
/* SafeState stores the secret code in EEPROM */
|
||||
#include "SafeState.h"
|
||||
SafeState _safeState;
|
||||
|
||||
#include "Tone.h"
|
||||
Tone _tone;
|
||||
|
||||
#include "Light.h"
|
||||
Light _light(&_tone);
|
||||
|
||||
#include "Icons.h"
|
||||
Icons _icons(&_lcd);
|
||||
|
||||
#include "UI.h"
|
||||
UI _ui(&_lcd, &_keypad, &_safeState, &_light, &_tone);
|
||||
|
||||
void setup()
|
||||
{
|
||||
#ifdef DEBUG
|
||||
Serial.begin(115200);
|
||||
Serial.println("Started");
|
||||
#endif
|
||||
Wire.swap();
|
||||
|
||||
_lcd.begin(16, 2);
|
||||
|
||||
/* Make sure the physical lock is sync with the EEPROM state */
|
||||
if (_safeState.locked())
|
||||
_light.lock();
|
||||
else
|
||||
_light.unlock();
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
_ui.loop();
|
||||
_tone.loop();
|
||||
_light.loop();
|
||||
delay(50);
|
||||
}
|
||||
5
attiny1616-dev-board/firmware/t1616-starter/.gitignore
vendored
Normal file
5
attiny1616-dev-board/firmware/t1616-starter/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
.pio
|
||||
.vscode/.browse.c_cpp.db*
|
||||
.vscode/c_cpp_properties.json
|
||||
.vscode/launch.json
|
||||
.vscode/ipch
|
||||
10
attiny1616-dev-board/firmware/t1616-starter/.vscode/extensions.json
vendored
Normal file
10
attiny1616-dev-board/firmware/t1616-starter/.vscode/extensions.json
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
{
|
||||
// See http://go.microsoft.com/fwlink/?LinkId=827846
|
||||
// for the documentation about the extensions.json format
|
||||
"recommendations": [
|
||||
"platformio.platformio-ide"
|
||||
],
|
||||
"unwantedRecommendations": [
|
||||
"ms-vscode.cpptools-extension-pack"
|
||||
]
|
||||
}
|
||||
31
attiny1616-dev-board/firmware/t1616-starter/platformio.ini
Normal file
31
attiny1616-dev-board/firmware/t1616-starter/platformio.ini
Normal file
@@ -0,0 +1,31 @@
|
||||
[env]
|
||||
platform = atmelmegaavr
|
||||
framework = arduino
|
||||
monitor_speed = 115200
|
||||
monitor_port = /dev/ttyUSB1
|
||||
upload_port = /dev/ttyUSB0
|
||||
board_build.f_cpu = 20000000ul
|
||||
build_flags =
|
||||
-D ws2812_port=A
|
||||
-D ws2812_pin=7
|
||||
lib_deps =
|
||||
SPI
|
||||
adafruit/Adafruit NeoPixel @ 1.10.7
|
||||
|
||||
[env:tiny1616-jtag2updi]
|
||||
board = ATtiny1616
|
||||
upload_protocol = jtag2updi
|
||||
|
||||
[env:tiny1616-serialupdi]
|
||||
board = ATtiny1616
|
||||
upload_speed = 230400
|
||||
upload_flags =
|
||||
--tool
|
||||
uart
|
||||
--device
|
||||
attiny1616
|
||||
--uart
|
||||
$UPLOAD_PORT
|
||||
--clk
|
||||
$UPLOAD_SPEED
|
||||
upload_command = pymcuprog write --erase $UPLOAD_FLAGS --filename $SOURCE
|
||||
45
attiny1616-dev-board/firmware/t1616-starter/src/main.cpp
Normal file
45
attiny1616-dev-board/firmware/t1616-starter/src/main.cpp
Normal file
@@ -0,0 +1,45 @@
|
||||
#include <Arduino.h>
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
|
||||
#define PIN_LED PIN_PB4 // 5
|
||||
#define PIN_RGB PIN_PA7
|
||||
#define PIN_BTN PIN_PA0
|
||||
|
||||
uint8_t seq = 0;
|
||||
|
||||
Adafruit_NeoPixel pixels(1, PIN_RGB, NEO_GRB + NEO_KHZ800);
|
||||
|
||||
void setup() {
|
||||
|
||||
pinMode(PIN_LED, OUTPUT);
|
||||
pinMode(PIN_BTN, INPUT);
|
||||
|
||||
delay(1000);
|
||||
Serial.begin(115200);
|
||||
Serial.printf("Started at %d MHz\n", F_CPU);
|
||||
|
||||
pixels.begin();
|
||||
}
|
||||
|
||||
uint8_t btn_state = HIGH;
|
||||
|
||||
void loop() {
|
||||
seq++;
|
||||
|
||||
Serial.print('.');
|
||||
|
||||
if (btn_state != digitalRead(PIN_BTN)) {
|
||||
btn_state = !btn_state;
|
||||
Serial.print("Button state is ");
|
||||
Serial.println(btn_state);
|
||||
}
|
||||
|
||||
digitalWrite(PIN_LED, seq % 2);
|
||||
|
||||
pixels.clear();
|
||||
if (seq % 2 == 0)
|
||||
pixels.setPixelColor(0, pixels.Color((0xff - seq) % 0xff, seq % 0xff, seq % 0x7f + (0xff - seq) % 0x7f));
|
||||
pixels.show();
|
||||
|
||||
delay(500);
|
||||
}
|
||||
16936
attiny1616-dev-board/hardware/Rev A/2205-tiny1616-dev-board-pcb.pdf
Normal file
16936
attiny1616-dev-board/hardware/Rev A/2205-tiny1616-dev-board-pcb.pdf
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
17114
attiny1616-dev-board/hardware/Rev B/2212-tiny1616-dev-board-b-pcb.pdf
Normal file
17114
attiny1616-dev-board/hardware/Rev B/2212-tiny1616-dev-board-b-pcb.pdf
Normal file
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3831
attiny1616-dev-board/hardware/Rev C/Rev C.kicad_pcb
Normal file
3831
attiny1616-dev-board/hardware/Rev C/Rev C.kicad_pcb
Normal file
File diff suppressed because it is too large
Load Diff
131
attiny1616-dev-board/hardware/Rev C/Rev C.kicad_prl
Normal file
131
attiny1616-dev-board/hardware/Rev C/Rev C.kicad_prl
Normal file
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"board": {
|
||||
"active_layer": 0,
|
||||
"active_layer_preset": "",
|
||||
"auto_track_width": true,
|
||||
"hidden_netclasses": [],
|
||||
"hidden_nets": [],
|
||||
"high_contrast_mode": 0,
|
||||
"net_color_mode": 1,
|
||||
"opacity": {
|
||||
"images": 0.6,
|
||||
"pads": 1.0,
|
||||
"shapes": 1.0,
|
||||
"tracks": 1.0,
|
||||
"vias": 1.0,
|
||||
"zones": 0.6
|
||||
},
|
||||
"selection_filter": {
|
||||
"dimensions": true,
|
||||
"footprints": true,
|
||||
"graphics": true,
|
||||
"keepouts": true,
|
||||
"lockedItems": false,
|
||||
"otherItems": true,
|
||||
"pads": true,
|
||||
"text": true,
|
||||
"tracks": true,
|
||||
"vias": true,
|
||||
"zones": true
|
||||
},
|
||||
"visible_items": [
|
||||
"vias",
|
||||
"footprint_text",
|
||||
"footprint_anchors",
|
||||
"ratsnest",
|
||||
"grid",
|
||||
"footprints_front",
|
||||
"footprints_back",
|
||||
"footprint_values",
|
||||
"footprint_references",
|
||||
"tracks",
|
||||
"drc_errors",
|
||||
"drawing_sheet",
|
||||
"bitmaps",
|
||||
"pads",
|
||||
"zones",
|
||||
"drc_warnings",
|
||||
"drc_exclusions",
|
||||
"locked_item_shadows",
|
||||
"conflict_shadows",
|
||||
"shapes"
|
||||
],
|
||||
"visible_layers": "ffffffff_ffffffff_ffffffff_ffffffff",
|
||||
"zone_display_mode": 0
|
||||
},
|
||||
"git": {
|
||||
"repo_type": "",
|
||||
"repo_username": "",
|
||||
"ssh_key": ""
|
||||
},
|
||||
"meta": {
|
||||
"filename": "Rev C.kicad_prl",
|
||||
"version": 5
|
||||
},
|
||||
"net_inspector_panel": {
|
||||
"col_hidden": [
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false,
|
||||
false
|
||||
],
|
||||
"col_order": [
|
||||
0,
|
||||
1,
|
||||
2,
|
||||
3,
|
||||
4,
|
||||
5,
|
||||
6,
|
||||
7,
|
||||
8,
|
||||
9
|
||||
],
|
||||
"col_widths": [
|
||||
162,
|
||||
147,
|
||||
91,
|
||||
67,
|
||||
91,
|
||||
91,
|
||||
91,
|
||||
71,
|
||||
91,
|
||||
91
|
||||
],
|
||||
"custom_group_rules": [],
|
||||
"expanded_rows": [],
|
||||
"filter_by_net_name": true,
|
||||
"filter_by_netclass": true,
|
||||
"filter_text": "",
|
||||
"group_by_constraint": false,
|
||||
"group_by_netclass": false,
|
||||
"show_unconnected_nets": false,
|
||||
"show_zero_pad_nets": false,
|
||||
"sort_ascending": true,
|
||||
"sorting_column": 0
|
||||
},
|
||||
"open_jobsets": [],
|
||||
"project": {
|
||||
"files": []
|
||||
},
|
||||
"schematic": {
|
||||
"selection_filter": {
|
||||
"graphics": true,
|
||||
"images": true,
|
||||
"labels": true,
|
||||
"lockedItems": false,
|
||||
"otherItems": true,
|
||||
"pins": true,
|
||||
"symbols": true,
|
||||
"text": true,
|
||||
"wires": true
|
||||
}
|
||||
}
|
||||
}
|
||||
618
attiny1616-dev-board/hardware/Rev C/Rev C.kicad_pro
Normal file
618
attiny1616-dev-board/hardware/Rev C/Rev C.kicad_pro
Normal file
@@ -0,0 +1,618 @@
|
||||
{
|
||||
"board": {
|
||||
"3dviewports": [],
|
||||
"design_settings": {
|
||||
"defaults": {
|
||||
"apply_defaults_to_fp_fields": false,
|
||||
"apply_defaults_to_fp_shapes": false,
|
||||
"apply_defaults_to_fp_text": false,
|
||||
"board_outline_line_width": 0.05,
|
||||
"copper_line_width": 0.2,
|
||||
"copper_text_italic": false,
|
||||
"copper_text_size_h": 1.5,
|
||||
"copper_text_size_v": 1.5,
|
||||
"copper_text_thickness": 0.3,
|
||||
"copper_text_upright": false,
|
||||
"courtyard_line_width": 0.05,
|
||||
"dimension_precision": 4,
|
||||
"dimension_units": 3,
|
||||
"dimensions": {
|
||||
"arrow_length": 1270000,
|
||||
"extension_offset": 500000,
|
||||
"keep_text_aligned": true,
|
||||
"suppress_zeroes": true,
|
||||
"text_position": 0,
|
||||
"units_format": 0
|
||||
},
|
||||
"fab_line_width": 0.1,
|
||||
"fab_text_italic": false,
|
||||
"fab_text_size_h": 1.0,
|
||||
"fab_text_size_v": 1.0,
|
||||
"fab_text_thickness": 0.15,
|
||||
"fab_text_upright": false,
|
||||
"other_line_width": 0.1,
|
||||
"other_text_italic": false,
|
||||
"other_text_size_h": 1.0,
|
||||
"other_text_size_v": 1.0,
|
||||
"other_text_thickness": 0.15,
|
||||
"other_text_upright": false,
|
||||
"pads": {
|
||||
"drill": 0.8,
|
||||
"height": 1.27,
|
||||
"width": 2.54
|
||||
},
|
||||
"silk_line_width": 0.1,
|
||||
"silk_text_italic": false,
|
||||
"silk_text_size_h": 1.0,
|
||||
"silk_text_size_v": 1.0,
|
||||
"silk_text_thickness": 0.1,
|
||||
"silk_text_upright": false,
|
||||
"zones": {
|
||||
"min_clearance": 0.5
|
||||
}
|
||||
},
|
||||
"diff_pair_dimensions": [],
|
||||
"drc_exclusions": [],
|
||||
"meta": {
|
||||
"version": 2
|
||||
},
|
||||
"rule_severities": {
|
||||
"annular_width": "error",
|
||||
"clearance": "error",
|
||||
"connection_width": "warning",
|
||||
"copper_edge_clearance": "error",
|
||||
"copper_sliver": "warning",
|
||||
"courtyards_overlap": "error",
|
||||
"creepage": "error",
|
||||
"diff_pair_gap_out_of_range": "error",
|
||||
"diff_pair_uncoupled_length_too_long": "error",
|
||||
"drill_out_of_range": "error",
|
||||
"duplicate_footprints": "warning",
|
||||
"extra_footprint": "warning",
|
||||
"footprint": "error",
|
||||
"footprint_filters_mismatch": "ignore",
|
||||
"footprint_symbol_mismatch": "warning",
|
||||
"footprint_type_mismatch": "ignore",
|
||||
"hole_clearance": "error",
|
||||
"hole_to_hole": "warning",
|
||||
"holes_co_located": "warning",
|
||||
"invalid_outline": "error",
|
||||
"isolated_copper": "warning",
|
||||
"item_on_disabled_layer": "error",
|
||||
"items_not_allowed": "error",
|
||||
"length_out_of_range": "error",
|
||||
"lib_footprint_issues": "warning",
|
||||
"lib_footprint_mismatch": "warning",
|
||||
"malformed_courtyard": "error",
|
||||
"microvia_drill_out_of_range": "error",
|
||||
"mirrored_text_on_front_layer": "warning",
|
||||
"missing_courtyard": "ignore",
|
||||
"missing_footprint": "warning",
|
||||
"net_conflict": "warning",
|
||||
"nonmirrored_text_on_back_layer": "warning",
|
||||
"npth_inside_courtyard": "ignore",
|
||||
"padstack": "warning",
|
||||
"pth_inside_courtyard": "ignore",
|
||||
"shorting_items": "error",
|
||||
"silk_edge_clearance": "warning",
|
||||
"silk_over_copper": "warning",
|
||||
"silk_overlap": "warning",
|
||||
"skew_out_of_range": "error",
|
||||
"solder_mask_bridge": "error",
|
||||
"starved_thermal": "error",
|
||||
"text_height": "warning",
|
||||
"text_on_edge_cuts": "error",
|
||||
"text_thickness": "warning",
|
||||
"through_hole_pad_without_hole": "error",
|
||||
"too_many_vias": "error",
|
||||
"track_angle": "error",
|
||||
"track_dangling": "warning",
|
||||
"track_segment_length": "error",
|
||||
"track_width": "error",
|
||||
"tracks_crossing": "error",
|
||||
"unconnected_items": "error",
|
||||
"unresolved_variable": "error",
|
||||
"via_dangling": "warning",
|
||||
"zones_intersect": "error"
|
||||
},
|
||||
"rules": {
|
||||
"max_error": 0.005,
|
||||
"min_clearance": 0.0,
|
||||
"min_connection": 0.0,
|
||||
"min_copper_edge_clearance": 0.5,
|
||||
"min_groove_width": 0.0,
|
||||
"min_hole_clearance": 0.25,
|
||||
"min_hole_to_hole": 0.25,
|
||||
"min_microvia_diameter": 0.2,
|
||||
"min_microvia_drill": 0.1,
|
||||
"min_resolved_spokes": 2,
|
||||
"min_silk_clearance": 0.0,
|
||||
"min_text_height": 0.8,
|
||||
"min_text_thickness": 0.08,
|
||||
"min_through_hole_diameter": 0.3,
|
||||
"min_track_width": 0.0,
|
||||
"min_via_annular_width": 0.1,
|
||||
"min_via_diameter": 0.5,
|
||||
"solder_mask_to_copper_clearance": 0.0,
|
||||
"use_height_for_length_calcs": true
|
||||
},
|
||||
"teardrop_options": [
|
||||
{
|
||||
"td_onpthpad": true,
|
||||
"td_onroundshapesonly": false,
|
||||
"td_onsmdpad": true,
|
||||
"td_ontrackend": false,
|
||||
"td_onvia": true
|
||||
}
|
||||
],
|
||||
"teardrop_parameters": [
|
||||
{
|
||||
"td_allow_use_two_tracks": true,
|
||||
"td_curve_segcount": 0,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_on_pad_in_zone": false,
|
||||
"td_target_name": "td_round_shape",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
},
|
||||
{
|
||||
"td_allow_use_two_tracks": true,
|
||||
"td_curve_segcount": 0,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_on_pad_in_zone": false,
|
||||
"td_target_name": "td_rect_shape",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
},
|
||||
{
|
||||
"td_allow_use_two_tracks": true,
|
||||
"td_curve_segcount": 0,
|
||||
"td_height_ratio": 1.0,
|
||||
"td_length_ratio": 0.5,
|
||||
"td_maxheight": 2.0,
|
||||
"td_maxlen": 1.0,
|
||||
"td_on_pad_in_zone": false,
|
||||
"td_target_name": "td_track_end",
|
||||
"td_width_to_size_filter_ratio": 0.9
|
||||
}
|
||||
],
|
||||
"track_widths": [],
|
||||
"tuning_pattern_settings": {
|
||||
"diff_pair_defaults": {
|
||||
"corner_radius_percentage": 80,
|
||||
"corner_style": 1,
|
||||
"max_amplitude": 1.0,
|
||||
"min_amplitude": 0.2,
|
||||
"single_sided": false,
|
||||
"spacing": 1.0
|
||||
},
|
||||
"diff_pair_skew_defaults": {
|
||||
"corner_radius_percentage": 80,
|
||||
"corner_style": 1,
|
||||
"max_amplitude": 1.0,
|
||||
"min_amplitude": 0.2,
|
||||
"single_sided": false,
|
||||
"spacing": 0.6
|
||||
},
|
||||
"single_track_defaults": {
|
||||
"corner_radius_percentage": 80,
|
||||
"corner_style": 1,
|
||||
"max_amplitude": 1.0,
|
||||
"min_amplitude": 0.2,
|
||||
"single_sided": false,
|
||||
"spacing": 0.6
|
||||
}
|
||||
},
|
||||
"via_dimensions": [],
|
||||
"zones_allow_external_fillets": false
|
||||
},
|
||||
"ipc2581": {
|
||||
"dist": "",
|
||||
"distpn": "",
|
||||
"internal_id": "",
|
||||
"mfg": "",
|
||||
"mpn": ""
|
||||
},
|
||||
"layer_pairs": [],
|
||||
"layer_presets": [],
|
||||
"viewports": []
|
||||
},
|
||||
"boards": [],
|
||||
"cvpcb": {
|
||||
"equivalence_files": []
|
||||
},
|
||||
"erc": {
|
||||
"erc_exclusions": [],
|
||||
"meta": {
|
||||
"version": 0
|
||||
},
|
||||
"pin_map": [
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
2,
|
||||
1,
|
||||
1,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
1,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
1,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
0,
|
||||
2,
|
||||
1,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
2,
|
||||
0,
|
||||
0,
|
||||
2
|
||||
],
|
||||
[
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2,
|
||||
2
|
||||
]
|
||||
],
|
||||
"rule_severities": {
|
||||
"bus_definition_conflict": "error",
|
||||
"bus_entry_needed": "error",
|
||||
"bus_to_bus_conflict": "error",
|
||||
"bus_to_net_conflict": "error",
|
||||
"different_unit_footprint": "error",
|
||||
"different_unit_net": "error",
|
||||
"duplicate_reference": "error",
|
||||
"duplicate_sheet_names": "error",
|
||||
"endpoint_off_grid": "warning",
|
||||
"extra_units": "error",
|
||||
"footprint_filter": "ignore",
|
||||
"footprint_link_issues": "warning",
|
||||
"four_way_junction": "ignore",
|
||||
"global_label_dangling": "warning",
|
||||
"hier_label_mismatch": "error",
|
||||
"label_dangling": "error",
|
||||
"label_multiple_wires": "warning",
|
||||
"lib_symbol_issues": "warning",
|
||||
"lib_symbol_mismatch": "warning",
|
||||
"missing_bidi_pin": "warning",
|
||||
"missing_input_pin": "warning",
|
||||
"missing_power_pin": "error",
|
||||
"missing_unit": "warning",
|
||||
"multiple_net_names": "warning",
|
||||
"net_not_bus_member": "warning",
|
||||
"no_connect_connected": "warning",
|
||||
"no_connect_dangling": "warning",
|
||||
"pin_not_connected": "error",
|
||||
"pin_not_driven": "error",
|
||||
"pin_to_pin": "warning",
|
||||
"power_pin_not_driven": "error",
|
||||
"same_local_global_label": "warning",
|
||||
"similar_label_and_power": "warning",
|
||||
"similar_labels": "warning",
|
||||
"similar_power": "warning",
|
||||
"simulation_model_issue": "ignore",
|
||||
"single_global_label": "ignore",
|
||||
"unannotated": "error",
|
||||
"unconnected_wire_endpoint": "warning",
|
||||
"unit_value_mismatch": "error",
|
||||
"unresolved_variable": "error",
|
||||
"wire_dangling": "error"
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"pinned_footprint_libs": [],
|
||||
"pinned_symbol_libs": []
|
||||
},
|
||||
"meta": {
|
||||
"filename": "Rev C.kicad_pro",
|
||||
"version": 3
|
||||
},
|
||||
"net_settings": {
|
||||
"classes": [
|
||||
{
|
||||
"bus_width": 12,
|
||||
"clearance": 0.2,
|
||||
"diff_pair_gap": 0.25,
|
||||
"diff_pair_via_gap": 0.25,
|
||||
"diff_pair_width": 0.2,
|
||||
"line_style": 0,
|
||||
"microvia_diameter": 0.3,
|
||||
"microvia_drill": 0.1,
|
||||
"name": "Default",
|
||||
"pcb_color": "rgba(0, 0, 0, 0.000)",
|
||||
"priority": 2147483647,
|
||||
"schematic_color": "rgba(0, 0, 0, 0.000)",
|
||||
"track_width": 0.2,
|
||||
"via_diameter": 0.6,
|
||||
"via_drill": 0.3,
|
||||
"wire_width": 6
|
||||
}
|
||||
],
|
||||
"meta": {
|
||||
"version": 4
|
||||
},
|
||||
"net_colors": null,
|
||||
"netclass_assignments": null,
|
||||
"netclass_patterns": []
|
||||
},
|
||||
"pcbnew": {
|
||||
"last_paths": {
|
||||
"gencad": "",
|
||||
"idf": "",
|
||||
"netlist": "",
|
||||
"plot": "",
|
||||
"pos_files": "",
|
||||
"specctra_dsn": "",
|
||||
"step": "",
|
||||
"svg": "",
|
||||
"vrml": ""
|
||||
},
|
||||
"page_layout_descr_file": ""
|
||||
},
|
||||
"schematic": {
|
||||
"annotate_start_num": 0,
|
||||
"bom_export_filename": "${PROJECTNAME}.csv",
|
||||
"bom_fmt_presets": [],
|
||||
"bom_fmt_settings": {
|
||||
"field_delimiter": ",",
|
||||
"keep_line_breaks": false,
|
||||
"keep_tabs": false,
|
||||
"name": "CSV",
|
||||
"ref_delimiter": ",",
|
||||
"ref_range_delimiter": "",
|
||||
"string_delimiter": "\""
|
||||
},
|
||||
"bom_presets": [],
|
||||
"bom_settings": {
|
||||
"exclude_dnp": false,
|
||||
"fields_ordered": [
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "Reference",
|
||||
"name": "Reference",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "Qty",
|
||||
"name": "${QUANTITY}",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": true,
|
||||
"label": "Value",
|
||||
"name": "Value",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": true,
|
||||
"label": "DNP",
|
||||
"name": "${DNP}",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": true,
|
||||
"label": "Exclude from BOM",
|
||||
"name": "${EXCLUDE_FROM_BOM}",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": true,
|
||||
"label": "Exclude from Board",
|
||||
"name": "${EXCLUDE_FROM_BOARD}",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": true,
|
||||
"label": "Footprint",
|
||||
"name": "Footprint",
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"group_by": false,
|
||||
"label": "Datasheet",
|
||||
"name": "Datasheet",
|
||||
"show": true
|
||||
}
|
||||
],
|
||||
"filter_string": "",
|
||||
"group_symbols": true,
|
||||
"include_excluded_from_bom": true,
|
||||
"name": "Default Editing",
|
||||
"sort_asc": true,
|
||||
"sort_field": "Reference"
|
||||
},
|
||||
"connection_grid_size": 50.0,
|
||||
"drawing": {
|
||||
"dashed_lines_dash_length_ratio": 12.0,
|
||||
"dashed_lines_gap_length_ratio": 3.0,
|
||||
"default_line_thickness": 6.0,
|
||||
"default_text_size": 50.0,
|
||||
"field_names": [],
|
||||
"intersheets_ref_own_page": false,
|
||||
"intersheets_ref_prefix": "",
|
||||
"intersheets_ref_short": false,
|
||||
"intersheets_ref_show": false,
|
||||
"intersheets_ref_suffix": "",
|
||||
"junction_size_choice": 3,
|
||||
"label_size_ratio": 0.375,
|
||||
"operating_point_overlay_i_precision": 3,
|
||||
"operating_point_overlay_i_range": "~A",
|
||||
"operating_point_overlay_v_precision": 3,
|
||||
"operating_point_overlay_v_range": "~V",
|
||||
"overbar_offset_ratio": 1.23,
|
||||
"pin_symbol_size": 25.0,
|
||||
"text_offset_ratio": 0.15
|
||||
},
|
||||
"legacy_lib_dir": "",
|
||||
"legacy_lib_list": [],
|
||||
"meta": {
|
||||
"version": 1
|
||||
},
|
||||
"net_format_name": "",
|
||||
"page_layout_descr_file": "",
|
||||
"plot_directory": "",
|
||||
"space_save_all_events": true,
|
||||
"spice_current_sheet_as_root": false,
|
||||
"spice_external_command": "spice \"%I\"",
|
||||
"spice_model_current_sheet_as_root": true,
|
||||
"spice_save_all_currents": false,
|
||||
"spice_save_all_dissipations": false,
|
||||
"spice_save_all_voltages": false,
|
||||
"subpart_first_id": 65,
|
||||
"subpart_id_separator": 0
|
||||
},
|
||||
"sheets": [
|
||||
[
|
||||
"405f212d-eda8-42df-94e8-805b0f571fec",
|
||||
"Root"
|
||||
]
|
||||
],
|
||||
"text_variables": {}
|
||||
}
|
||||
4731
attiny1616-dev-board/hardware/Rev C/Rev C.kicad_sch
Normal file
4731
attiny1616-dev-board/hardware/Rev C/Rev C.kicad_sch
Normal file
File diff suppressed because it is too large
Load Diff
1
attiny1616-dev-board/hardware/Rev C/fp-info-cache
Normal file
1
attiny1616-dev-board/hardware/Rev C/fp-info-cache
Normal file
@@ -0,0 +1 @@
|
||||
0
|
||||
Reference in New Issue
Block a user