A new unique Christmas Card is born.
This year, as earlier years, we have made a PCB card with a MCU and shiny LEDs to assist with the holiday spirit creation ?
Each year they have a different look
This year we created a Gingerbread-boy (another member of the Gingerbreadfamily?).
As you can see is the body pure FR4:
Complete redesign of the circuit
All previous Christmas cards has a design based around the ATiny10, but this year we changed it to use a Padauk PFS154 instead.
The micro controller used in this design was also a participant in our “study” into the land of different MCUs (which we have written several posts about)
In addition to the leap from the tried and tested ATiny-design, we have also included several other new features 🙂
Maybe the most noticeable is the new INTRO and ON-state with individual LED intensity control. We have also made several “under the hood” improvements.
Among new features are behavior adjustment based on battery voltage and several new low power design features.
Both of which deserves own blog posts, so stay tuned!
Current limiting, where did you go?
Another feature you might have spotted in the schematic is the lack of current limiting resistors! How do we do that?
unsigned char _sdcc_external_startup(void) we run
PDK_SET_FUSE(FUSE_IO_DRV_LOW) which limits the sourcing current on IO lines to ~1.6 mA.
This puts a nice limit on the maximum LED current, and we can easily reduce the average current even further with PWM. Remember that it’s the total current draw on each I/O-line that is capped to ~1.6 mA. Since we have all three different LEDS on individual I/O-lines and nothing else external draws power we have removed a possible “sharing complexity” that we had in previous generation Christmas Cards 🙂
What about low power?
But how much current does it use to do all this? The attached release uses on average 0,44 mA in ON, and 0,18 uA in OFF.
Given a single 200 mAh battery, and 4 hours usage every day for 30 days each year, this years Christmas Card have a total runtime on ~5,4 years
(turns OFF automatically after ~4 hours)
How to program it?
The Christmas Card can handle the programming voltages, but the battery cannot, so the battery should not be present when programming happens!
We programmed it using the Easy PDK programmer, and we wrote the firmware in C and compiled it using the Free PDK toolchain. You can also read more about our impressions from [Walk down the low-cost MCU-road] blogpost.
We made a programming header-pinout as shown in the schematic, and used a Tag-Connect (TC2030-IDC-NL) for fast and easy connection.
You can download the compiled firmware on the other side of this URL.
(Remember that this work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.)
After initial setup, we executed the following command in a suitable environment (docs: Easy PDK Programmer (Software & Hardware)):
λ easypdkprog --icname=PFS154 write NC_christmas_card_pfs154_v22.1.hex
The stand was modeled as a snow mound with press fit attachments and the result was 3D-printed in-house.
After “popular demands” we also added a hole for easy attachments to e.g. a Christmas tree: