diff --git a/5x7test.c b/5x7test.c index 99f58d2..4a04a43 100644 --- a/5x7test.c +++ b/5x7test.c @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 02/2010 by Olaf Rempel * + * Copyright (C) 03/2010 by Olaf Rempel * * razzor@kopf-tisch.de * * * * This program is free software; you can redistribute it and/or modify * @@ -20,71 +20,109 @@ #include #include -#define F_CPU 3686400 +#define F_CPU 8000000 #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) - */ +#define nop() asm volatile ("nop") -/* 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 nCLEAR PB0 +#define RCLK PB1 +#define nOE PB2 +#define MOSI PB3 +#define MISO PB3 +#define SCK PB5 #define ARRAY_SIZE(x) (sizeof(x) / sizeof(x[0])) -static const char text[] = " <<>>"; +static const char text[] = " <<>> "; /* scrollbuffer */ -static volatile uint8_t data[5 + 1 + 5]; +static volatile uint8_t data[32]; static volatile uint8_t offset; +void setRow(uint8_t row) +{ + uint8_t i; + volatile uint8_t *p = data + offset + 19; + + row = (1 << row); + + /* bit-banging spi, 20 cols */ + for (i = 0; i < 20; i++) { + PORTB &= ~(1<