diff options
-rw-r--r-- | avr/z80-if.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/avr/z80-if.c b/avr/z80-if.c index 20efa9e..726e50b 100644 --- a/avr/z80-if.c +++ b/avr/z80-if.c @@ -216,11 +216,12 @@ void z80_setup_clock(void) DDR_ZCLK |= _BV(ZCLK); Z80_O_ZCLK = 0; - /* Timer0: CTC: Toggle OC0A on compare match */ - PRR0 &= ~_BV(PRTIM0); - TCCR0A = _BV(COM0A0) | _BV(WGM01); - OCR0A = 0; - TCCR0B = (0x01 << CS00); + /* Timer1: CTC: Toggle OC1C on compare match */ + PRR0 &= ~_BV(PRTIM1); + OCR1A = 0; + OCR1C = 0; + TCCR1A = (0b01 << COM1C0) | (0b00 << WGM10); + TCCR1B = (0b01 << WGM12) | (0b001 << CS10); } void z80_setup_bus(void) |