I am trying to collect the options (and their pros/cons) for programmable timers in a modern W65C02 based system. For my own system, I am looking to end up with four (4) independent timers, but I am going to try and outline all options.
The most obvious is the 65C22 VIA - which includes two (2) 16-bit programmable timers and interrupt circuitry - in addition to programmable IO ports. The timers can be purely internal (based on system clock, alerting purely by interrupt) or can use the control pins from the PIO port to count or alert via IO pins. The VIA is incredibly versatile, but retails for about $10 USD. To get four timers, that's $20 and a lot of board real estate.
The 28L92 DUART (still in production by TI, others?) also contains two 16-bit programmable timers. This is another ~$10 chip, and doesn't seem to be QUITE as readily available as a 65c22. Instead of getting two PIO ports, you get two UARTs. These are similar cons to the 65c22, but admittedly a single '22 and a single '92 make for a powerful combination and add up to four timers.
The z80 CTC (still in production by Zilog) contains four 16-bit programmable timers, for about $6.50 USD. Bingo bongo in terms of providing functional timers, and the input/output circuitry doesn't re-use PIO control pins like on the 65c22. There's an integrated prescaler for a lot of flexibility. The downside is that the CTC plays into the z80's complicated interrupt handling. At the very least, you'll need to fake an INTACK (i.e. IORQ and M1) signal. You'll probably need to do something with vectoring too. I haven't thought too much about it, since this probably necessitates a PLD on the board too.
The 82C53 Programmable Interval Timer is one of the more compelling options. It doesn't appear to be in production anymore, but is readily available from at least a handful of sources for less than $5 USD. It provides three 16-bit timers, each have a clock, gate, and output control pin. Though not as configurable as the CTC, each timer has five possible modes for quite a bit of flexibility. 8080 style bus signals (RD, WR) are required for interfacing. The timing of bus access may also require a wait state for suitably fast implementations. I suspect this is easier to slam into existing designs than the CTC, many projects already have the glue logic needed for RD/WR.
The MC6840 appears to be a 68k-bus compatible version the 82C53, but I can't find a reliable source, so I mention it only in passing.
The BQ4845 is a parallel access RTC with a single alarm. It's based on seconds/minutes, not pulses or clock cycles, so I'm, barely counting it here. But it does indicate there are probably other extant parallel RTCs that might have alarms.
I'm unclear on how complicated implementing a timer in PLD actually is, so I'm not listing an ATF1508. Has anyone tried to build a timer on an Atmel PLD?
An ice40 FPGA is also an option, but requires level shifting and is probably overkill.
Are there other timer ICs or solutions I haven't found?
|