static void write_ram(uint16_t addr, uint8_t val);
static uint8_t read_ram(uint16_t addr);
static void set_data_bus(unsigned char val);
static void write_ram(uint16_t addr, uint8_t val);
static uint8_t read_ram(uint16_t addr);
static void set_data_bus(unsigned char val);
static void set_addr_bus(uint16_t addr);
static void sys_reset(void);
static inline void iodelay(void);
static void set_addr_bus(uint16_t addr);
static void sys_reset(void);
static inline void iodelay(void);
- /* SPI (SS/MOSI/SCK) are outputs, as are the low 2 data bus bits */
- DDRB = PB_SS | PB_MOSI | PB_SCK | 3;
+ /* SPI (SS/MOSI/SCK) are outputs */
+ DDRB = PB_SS | PB_MOSI | PB_SCK;
PORTB = PB_SS; /* drive SS high when not in programming mode */
DDRC = 0xff; /* control signals are all outputs */
PORTC = PC_CS | PC_WE | PC_OE | PC_SYSRST;
PORTB = PB_SS; /* drive SS high when not in programming mode */
DDRC = 0xff; /* control signals are all outputs */
PORTC = PC_CS | PC_WE | PC_OE | PC_SYSRST;