Juno AVR Library - Low Power button Watchdog sleep mode 600nA - Tiny POT PWM Driver (Attiny13)

Channel:
Subscribers:
322
Published on ● Video Link: https://www.youtube.com/watch?v=5LI0d7dFNLY



Duration: 0:00
53 views
0


Juno AVR Library is a huge set of know-hows on various parts of an AVR MCU written by advanced assembly and advanced C programming language. It covers absolutely everything but most of it is in fragmented note and code forms, so it's not a traditional library that can be copy-and-pasted. In fact, it's not really completed yet or more precisely will never be completed because attempting to finalize this project requires a huge amount of effort and time.

This is a demo on what an abridged Juno AVR Library is capable of. This is a rather simple example, but in every advanced level on every level, yet programming a MCU is really that deceptively simple. The hardware is an attiny13 connected to 1 LED and 2 buttons. Here 1 button turns ON/OFF the MCU. Once the MCU is OFF, it's in power-down mode when current consumption is about 500nA. Another button controls the LED blinking rate. This example complicates things to demonstrate the various mechanisms that an AVR MCU has to offer and it uses 460 bytes out of 1024 bytes from the attiny13.

Challenge 1: Buttons are simple, but coding buttons in sleep mode is not necessarily easy. Here the button is used to wake up the MCU, and also to put it into sleep mode. Watchdog is used as a debounce timer. Watchdog is deceptively simple here because it's coded by an expert. In reality, using the watchdog is the most tricky thing and should be avoided by beginners. During the 16ms debounce duration, the MCU is in power-down mode, this saves a tiny amount of energy, but still critical for a battery-powered device.

Challenge 2: Another not that obvious challenge for coding the buttons is how should the button be read or more precisely how the button is interpreted. Under different stages/modes/states the same button can be coded to do different things. The easiest and lower quality solution would be to declare all the required variables as global. In this demo, a lot of attention is put into declaring various types of variables in their optimized forms. The scope of each variable is perfectly coded using high quality C programming language.




Other Videos By Flyandance


2024-10-30Full OS clone/image/restore unlimited Windows 7/10/11 Linux Hard Drive SSD Copy - Thinkpad X260
2024-10-27Final rebuilt/fixed old Thinkpad X260 VS [NFS Hot pursuit + screen recording] Intel Core i5-6300U
2024-10-26Mini Thrift and Fix Guide 2024: Buy High Value Laptop for extremely cheap - Thinkpad AMD
2024-10-12Fixed sub $100 12.5" 9 years Thinkpad x260 VS Need for Speed Hot Pursuit 2010 + screen capture
2024-10-08Fully Restored 9 years old Thinkpad x260 (2016) VS NFS most wanted 2012 + screen capture - i5-6300U
2024-10-07Perfectly Restored/Fixed Thinkpad x260 - Hardware + Software - Intel Core i5-6300U windows 7 HD520
2024-10-04Re-pasted/Fixed GeForce GTX 1060 6GB GPU Test - Need for Speed most-wanted 2012
2024-10-01My new gas stove setup - Fire Maple Tourism + 750mL pot - Camping backpacking remote tube adapter
2024-09-24My DIY Battery Pack - DW01 - Lithium Over Current Protection
2024-09-21Pro 12 - MCU controlled SEPIC DC-DC converter Initial Test - AVR ADC
2024-09-17Juno AVR Library - Low Power button Watchdog sleep mode 600nA - Tiny POT PWM Driver (Attiny13)
2024-09-11uAc 2 Final Product - An Extreme Low pico Power LED Clock Advanced AVR project sleep pro RGB CR2032
2024-09-0227 Neon Thermometer Final Product - High Voltage lamps Flyback DC-DC MCU AVR Nixie Tube Alternative
2024-09-01Pro 12 - New IC - High voltage Power 120 light bulb MOSFET nixie tube power supply DC-DC boost 5V
2024-08-31uAc hardware test - 12 RGB CR2032 coin cell battery powered micro-ampere low power LED clock AVR MCU
2024-08-2927 Neon Thermometer Hardware Test High Voltage lamp Flyback chaser 74HC595 MCU AVR LM75 temperature
2024-08-27Love Tower 1.0 - 17 neon lamps hourglass 555 timer CD4017 High Voltage chaser flyback 5v-118v DC-DC
2024-08-25CMOS 555 Driving NPN MOSFET transistors at high Speed 100kHz 300kHz Totem Pole push pull driver
2024-08-19Mission 5: Blind Justice (May 2, 1941) Code:MIR4M Commandos: Behind Enemy Lines Full Gameplay
2024-08-19Love Tower 1.0 PCB Creation - Neon Hourglass Chaser
2024-08-18Mission 3: Reverse Engineering (March 4, 1941) Commandos: Behind Enemy Lines Full Gameplay