/*************************************************************************** * Copyright (C) 02/2010 by Olaf Rempel * * razzor@kopf-tisch.de * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; version 2 of the License, * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include #include #include #define F_CPU 3686400 #include #include "6x8_vertikal_LSB_1.h" /* * at90s2313 pinout: * PB0-4 => LED C1-5 * PB5-7 => free/ISP * PD0-6 => LED R1-7 (with 100R resistors) */ /* for TC12-11 */ //#define COL_SEL(x) PORTB = ~(x) //#define COL_DATA(x) PORTD = (x) /* for TA12-11 */ #define COL_SEL(x) PORTB = (x) #define COL_DATA(x) PORTD = ~(x) #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) static const char text[] = " <<>>"; /* scrollbuffer */ static volatile uint8_t data[5 + 1 + 5]; static volatile uint8_t offset; ISR(SIG_OVERFLOW0) { static uint8_t col; /* ~2,8ms */ TCNT0 = 0xFF - 40; COL_DATA(0x00); COL_SEL(1 << col); COL_DATA(data[offset + col]); col = (col == 5) ? 0 : col + 1; } int main(void) { uint8_t mode = 0; uint8_t pos = 0; uint8_t delay = 0; DDRB = 0x1F; DDRD = 0x7F; /* Timer0: FCPU/256 */ TCCR0 = (1<