rjhelms / compe6502

Homebrew 6502 system
2 stars 0 forks source link

Add cc65 clock support #29

Closed rjhelms closed 2 years ago

rjhelms commented 2 years ago

Need to consider if I want this in cc65 lib or in ROM - but could use VIA timer to fire an interrupt that increments a counter.

Need to consider how many ticks per second is desired - balancing time spent in interrupt, accuracy of timer, and amount of data stored.

Some possibilities: 1000 ticks per second: timer 1000, 4.6 hours in 24 bits, 49 days in 32 bits 100 ticks per second: timer 10000, 46 hours in 24 bits, 497 days in 32 bits 60 ticks per second: timer 16666, 77 hours in 24 bits, 828 days in 32 bits 16 ticks per second: timer 62500, 291 hours in 24 bits, 3106 days in 32 bits

rjhelms commented 2 years ago

Ended up at 64 ticks per second as it divides evenly into 1MHz. Will need to reconsider after switching to 1.023MHz clock.