using a prescaler (eg /64) may lead to horizontal offset errors
because 1cycle off actually means many cycles off (eg 64)
This commit is contained in:
parent
2abac03779
commit
77b1858311
2
const.h
2
const.h
@ -1,4 +1,4 @@
|
||||
#pragma once
|
||||
|
||||
#define VERTICAL_OFFSET 30
|
||||
#define HORIZONTAL_OFFSET 3
|
||||
#define HORIZONTAL_OFFSET 192
|
||||
|
11
main.S
11
main.S
@ -32,7 +32,7 @@ main:
|
||||
|
||||
ldi r16, 0x02 ; don't connect output pins to timer, CTC[1:0] mode
|
||||
sts TCCR0A, r16
|
||||
ldi r16, 0x03 ; CTC[2] mode, prescaler /64
|
||||
ldi r16, 0x01 ; CTC[2] mode, no prescaler
|
||||
sts TCCR0B, r16
|
||||
|
||||
; init variables
|
||||
@ -112,17 +112,14 @@ int_timer_0:
|
||||
|
||||
sbi IO(PORTB), 4
|
||||
nop
|
||||
cbi IO(PORTB), 4
|
||||
nop
|
||||
sbi IO(PORTB), 4
|
||||
nop
|
||||
cbi IO(PORTB), 4
|
||||
nop
|
||||
sbi IO(PORTB), 4
|
||||
nop
|
||||
cbi IO(PORTB), 4
|
||||
nop
|
||||
sbi IO(PORTB), 4
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
nop
|
||||
cbi IO(PORTB), 4
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user