summaryrefslogtreecommitdiff
path: root/avr
diff options
context:
space:
mode:
authorLeo C2014-09-05 13:15:05 +0200
committerLeo C2014-09-05 13:15:05 +0200
commit9e689a832629fd09ad60161ddacfe7b05bb00dc5 (patch)
treee2ec6209870e233021ae67a2f4b594c4de4fa96a /avr
parent68e463ad5c3b0225dbf293ac609b3b7784fe0a0b (diff)
downloadz180-stamp-9e689a832629fd09ad60161ddacfe7b05bb00dc5.zip
User Timer1 as Z180 Clock
Diffstat (limited to 'avr')
-rw-r--r--avr/z80-if.c11
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)