From 4667e6dbfb8863652719b4bc76aa644ee7fed488 Mon Sep 17 00:00:00 2001 From: Neale Pickett Date: Thu, 22 Aug 2013 17:32:46 -0600 Subject: [PATCH] Modify for 16MHz crystal, NES on pins 0-2 --- Makefile | 2 +- avr.h | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 61330a7..dc5608a 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ LDFLAGS += -mmcu=$(MCU) AVDFLAGS += -p $(MCU) AVDFLAGS += -c usbtiny -CLOCK_HZ = 2000000 +CLOCK_HZ = 1600000 FUSES += -U lfuse:w:0x7f:m FUSES += -U hfuse:w:0xdd:m FUSES += -U efuse:w:0xff:m diff --git a/avr.h b/avr.h index 0696089..4e17752 100644 --- a/avr.h +++ b/avr.h @@ -7,13 +7,13 @@ #define bit(pin, bit, on) pin = (on ? (pin | bit) : (pin & ~bit)) -#define sin(on) bit(PORTA, _BV(0), on) -#define sclk(on) bit(PORTA, _BV(1), on) -#define sltch(on) bit(PORTA, _BV(2), on) +#define sin(on) bit(PORTA, _BV(3), on) +#define sclk(on) bit(PORTA, _BV(4), on) +#define sltch(on) bit(PORTA, _BV(5), on) -#define nesclk(on) bit(PORTA, _BV(3), on) -#define nesltch(on) bit(PORTA, _BV(4), on) -#define NESOUT 5 +#define nesclk(on) bit(PORTA, _BV(0), on) +#define nesltch(on) bit(PORTA, _BV(1), on) +#define NESOUT 2 #define nesout() ((PINA & _BV(NESOUT)) << NESOUT) void init(void);