# tomatimer a small pomodoro timer on an attiny85, programmed with {avr-asm}. part of the {s-camino} practice. => ./img/foto_tomatimer.png photo of the tomatimer: a small circuit with two leds, a buzzer, the attiny85, all of them over a plastic card. # about tomatimer works as a 25 and 5 minutes timer, cycling between them. a couple of LEDs indicate via blinking which one of the two timers is active at a given moment. at the end of each timer, a buzzer plays an alarm during some seconds. all the durations can be reconfigured via the source code if needed. # connections ```diagrama de pines ┌──────┐ │1 8│ VCC │2 7│ PB2: LED state 1 │3 6│ PB1: LED state 0 GND │4 5│ PB0: Buzzer └──────┘ ``` LEDs are connected such that an output of "high" will turn them on. # source code with billingual comments ``` ; tomatimer.S #include ; TIMER1 tiene su reloj a clk/512 (~1953 Hz) ; contando 244 pulsos se va a 8Hz (frame freq) ; i.e. 8 frames son 1 segundo ; r16 y r17 se usan como registros auxiliares ; duraciones en minutos de los timers #define DUR_TIMER0 25 #define DUR_TIMER1 5 ; duraciones en segundos de la alarma #define DUR_ALARMA0 3 #define DUR_ALARMA1 5 ; más chico es más agudo #define WAVE_PERIOD0 3 #define WAVE_PERIOD1 6 ; teórico: 244 #define TIMER1_PERIOD 240 #define rFrames r20 #define rSegundos r21 #define rMinutos r22 #define rFlags r23 #define fAlarmOn 0 #define fAlarmLevel 1 #define fCualTimer 2 #define pinAlarm PB0 #define pinState0 PB1 #define pinState1 PB2 ; para hacer fast modulo 8 #define MASK_FRAMES 0x07 ; *********************** ; vectores de interrupts: ; *********************** ; Reset .org 0x0000 rjmp main ; dirección 0x0003 * 2 .org 0x0006 rjmp timer1compareA_isr ; dirección 0x0009 * 2 .org 0x0012 rjmp timer1compareB_isr ; *********************** ; Main ; *********************** .org 0x001E main: ;---------------------------------- ; configuración general ;---------------------------------- ; habilita interrupciones sei ; pin PB0 como pin de salida ldi r16, (1<