Propeller Clock with ATmega328P This propeller clock is powered from 4x AAA Eneloop 1.2 V battery. An ATmega328P microcontroller is controlling the LEDs. 2 buttons are used to set the time, another button for resetting the cpu and a switch for power on. A magnet and a hall effect sensor (SS411P) is used to tell the microcontroller when it is at the starting position. Working principle The fan is spinning at 15 Hz, so 15 full revolutions every second. One revolution is 65 ms time. A timer interrupt is generated every 200 us. (65 ms / 200 us = 325) so in one revolution the timer interrupt is called 325 times. Another timer interrupt is used to count the seconds to track the time accurately. Meanwhile if no interrupt occurs the processor is calculating the LED patterns for the display in the main routine. If the hall effect sensor passes by the magnet a pin change interrupt is generated on PINB3. This interrupt resets the display to the home position. So the microcontroller knows tha...
Posts
- Get link
- X
- Other Apps
Electronic Dice with ATtiny13 This electronic dice is powered from a CR2032 3V battery and an ATtiny13A microcontroller is controlling the LEDs. No button and no switch is needed to operate it. A piezo buzzer is used as a preassure sensor. I took it out from an old telephone. As the dice is dropped from at least 1 cm height to the table the dice shuffles through the numbers and after a few seconds it shows the rolled number. Working principle of the dice If you drop the dice, the piezo buzzer creates a voltage spike. This spike is trimmed by the 1N4148 diode so the microcontroller doesn't get damaged. This trimmed spike creates a pin change interrupt and resets a timer. In that moment another, always running timer is devided by 6 and the remainder of this division gives a number which is always between 0 and 5. 0 means 1 on the dice, 1 means 2 on the dice and so on. 5 means 6. So this number is the starting position of the dice. This number could be any number from 0 t...
How to program AVR microcontrollers (ATmega8, ATmega328p, ATtiny13, ATtiny84 ...) on Linux operating system (OpenSuse Leap 15.2)
- Get link
- X
- Other Apps
AVR microcontroller programming on Linux In this post I will show you how to program AVR microcontrollers (uC) in Linux. How to setup softwares and hardwares. It is very easy to program we only need a cheap uC chip in DIP package, a programmer, couple of wires, resistors and a breadboard. I will show you how to program the chip in C language with Linux's Console application and a text editing software called 'Kate'. Setup hardware and software 1. We need a programmer for example an USBasp programmer. I think we can also use a USBtiny programmer, but I don't have any experience with that. usbasp programmer More information about USBasp programmer (Schematic diagram and firmware) here: https://www.fischl.de/usbasp/ 2. We need to install software packages from YAST Software Management tool. - avr-libc - avrdude - cross-avr-binutils - cross-avr-gcc7 repository for OpenSuse Leap 15.2: https://download.opensuse.org/repositories/CrossToolchain:/avr/openSUSE_Leap_15.2/ re...