6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Tue May 14, 2024 5:59 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Timer Options
PostPosted: Sun Apr 09, 2023 7:00 pm 
Offline

Joined: Sun Mar 05, 2023 6:49 am
Posts: 9
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?


Top
 Profile  
Reply with quote  
 Post subject: Re: Timer Options
PostPosted: Sun Apr 09, 2023 7:14 pm 
Offline
User avatar

Joined: Fri Aug 03, 2018 8:52 am
Posts: 746
Location: Germany
if your decoding logic uses some large CPLD, and you happen to have some space in it. you could use that as some form of hardcoded (or even progammable) timer.
also FPGAs don't necessarily need level shifters as nowadays you can run entire 65Cxx systems on 3.3V.

another option would be an external RTC Module/Chip. if you need a timer for just having your system wait some amount of time then an RTC can easily take care of that need. downside is that you need a connector to plug an RTC module into and the hardware (like a 65C22) required to interface it.


Top
 Profile  
Reply with quote  
 Post subject: Re: Timer Options
PostPosted: Sun Apr 09, 2023 7:25 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8182
Location: Midwestern USA
cdcarter wrote:
I am trying to collect the options (and their pros/cons) for programmable timers in a modern W65C02 based system.The 28L92 DUART (still in production by TI, others?) also contains two 16-bit programmable timers.

Correction. The 28L92 has one counter/timer.

An equivalent to the 28L92 is Exar’s 88C192, which is an almost-exact copy of the NXP original (Mouser has several thousand NXP 28L92s in stock as I speak, so to speak).

Are you looking for four timers that can independently generate interrupts? If so, this sounds like a job for a CPLD or FPGA, not discrete parts.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
 Post subject: Re: Timer Options
PostPosted: Sun Apr 09, 2023 7:45 pm 
Offline

Joined: Fri Dec 21, 2018 1:05 am
Posts: 1076
Location: Albuquerque NM USA
Since you are willing to consider Zilog products, you may want to look at KIO, Z84C90. It is SIO, PIO, and CTC in a chip. No longer in production but you can acquire 10pcs for $30 on eBay. This way you got 2 serials, 4 timers and general purpose IO.
Bill


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: GlennSmith and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: