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...
Posts
Showing posts with the label avr
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...