Difference between revisions of "YM2610 timers"
|Line 5:||Line 5:|
* Timer A:
* Timer A : ()/(..
* Timer B:
* Timer B : (value): ..
Revision as of 00:41, 20 June 2017
The timer A is 10 bits wide, the timer B is only 8 bits wide.
- Timer A interval: 72*(1024-value)/8M : 9µs to 9216µs (111.11Khz to 108.51Hz)
- Timer B interval: 1152*(256-value)/8M : 144µs to 36.864ms (6.94kHz to 27.13Hz)
- Smaller value=longer interval!
|Address (Z80 port 4)||Data (Z80 port 5)|
The timers are decremented at regular intervals until they reach 0, at which point an interrupt will be generated (if enabled). The timer which caused the interrupt can be known by reading port $04.
When a timer expires, it is automatically reloaded. If interrupts are enabled, care must be taken to clear the appropriate flag(s) so that they can be triggered again.
The actual counters aren't accessible, only their load value can be written.
- Writing 0 to the load bits in register $27 will reset the timer counters to zero.
- Writing 1 to the load bits will copy the respective timer load value to the timer counter. This only works when the counter is at zero.
- Flag reset refers to the same flags that are read from port $04
- 2CH mode allows each of FM channel 2 operators to run at their own frequency.
- CSM mode is for automatic key-on for operators of the second FM channel when timer A expires ?