Generating a 60Hz Interrupt
Posted: 01 Nov 2017 15:42
Ok I've been looking into generating a 60Hz interrupt using the CTC as a large number of VGM's have been captured at this rate.
I am using channel 1 for this to avoid the VDP interrupt on channel 0.
So my first attempt got a 61Hz interrupt by programming the CTC in Timer mode, with a prescaler of 256 and a const of 256:
4000000 / 256 = 15625
15625 / 256 = 61
So I am now looking at using the CTC in counter mode, with a prescaler of 256 and a const of 20:
4000000 / 13 = 307692
307692 / 256 = 1201
1201 / 20 = 60
Have I got that right?
I am using channel 1 for this to avoid the VDP interrupt on channel 0.
So my first attempt got a 61Hz interrupt by programming the CTC in Timer mode, with a prescaler of 256 and a const of 256:
4000000 / 256 = 15625
15625 / 256 = 61
So I am now looking at using the CTC in counter mode, with a prescaler of 256 and a const of 20:
4000000 / 13 = 307692
307692 / 256 = 1201
1201 / 20 = 60
Have I got that right?