6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Thu Nov 21, 2024 11:14 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Fri Sep 08, 2023 9:08 am 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 287
Location: South Africa
Hi all,

A quick question: I'm sure I've seen a Texas Instruments datasheet somewhere that had an example multi stage counter circuit for higher frequency counting compared to just running the ripple carry out (RCO) into the next stage counters ENT.

Am I remembering this correctly and does anyone have that datasheet or example circuit if it is possible?

Thanks!
Andrew


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 08, 2023 9:40 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10985
Location: England
I found this note in the '191 datasheet
Quote:
The counter easily can be cascaded by feeding the ripple-clock output to the enable input of the succeeding counter if parallel clocking is used, or to the clock input if parallel enabling is used. The maximum/minimum count (MAX/MIN) output can be used to accomplish look ahead for high-speed operation.


Something similar in the '163 datasheet
Quote:
The carry look-ahead circuitry provides for cascading counters for n-bit synchronous applications, without additional gating. This function is implemented by the ENP and ENT inputs and an RCO output. Both ENP and ENT must be high to count, and ENT is fed forward to enable RCO. RCO, thus enabled, produces a high-logic-level pulse while the count is 15 (HHHH). The high-logic-level overflow ripple-carry pulse can be used to enable successive cascaded stages. Transitions at ENP or ENT are allowed, regardless of the level of C


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 08, 2023 10:18 am 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
It's only in some of the datasheets unfortunately. See pages 21 and 22 here:
http://www.ti.com/lit/ds/symlink/sn54163.pdf


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 08, 2023 10:38 am 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 287
Location: South Africa
Thanks Ed and George! Those datasheets took me full circle to the post I probably originally saw on this forum. This one in particular where Dr Jefyll is commenting on one of George's posts and pointing out that the second stage ENT should just be tied high.

And I need to think about that because it seems like when the first stage hits the terminal count 0xF that RCO will go high if that first stage count enable is not controlled by ENT. And that will cause the second next stage to count if the first stage count enable is controlled by ENP. ENT and ENP are not equivalent.

Looking back at the thread I'm talking about I just realised Dr Jefyll highlighted exactly that. So I'mma stop now.


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 08, 2023 10:52 am 
Offline

Joined: Sun Jul 11, 2021 9:12 am
Posts: 155
Would something like a 74HC4040 suit your purposes being a 12 bit counter?


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 08, 2023 11:40 am 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
The 4040 series are just ripple-counters internally, meaning that even within the one IC the bits don't change simultaneously - it's just a load of D flipflops chained together, with each one getting toggled by the falling edge of the one before it. I used them in some of my early circuits but this ripple causes problems at higher frequencies.

You could also consider the 74HC590 - which is 8 bits and good for fairly fast counting rates. Compared to the '163 it's twice as wide, but not presettable, and it has a built-in output register which needs to be clocked separately, and has tristate outputs so can be connected to a bus. It's a great fit for some situations, not so great for others!


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 08, 2023 1:44 pm 
Offline
User avatar

Joined: Mon Aug 30, 2021 11:52 am
Posts: 287
Location: South Africa
I hadn't really thought about the '4040 as I'd kinda dismissed it out-of-hand for being slow and ripply. But with a bit more thought that wasn't really fair to it. Both the HCT and HC versions can run up to 80+Mhz; and I've had to put my usage of the combinatorial logic based on the counter count behind a delay to let the multiple '161s settle*.

However the propagation delay on the HCT4040 is about 8ns whereas the LVC161 is about 3ns. And that's significant as it's part of the pixel clock for an SVGA circuit; I only have about half a clock cycle (12.5ns) to make some decisions.

An LVC590 would be absolutely awesome but alas I can't even find an HCT590 and my circuit is based on TTL levels. A counter that I'm particularly fond of (and is still somewhat available) is the 74F269. It's an 8bit presttable up/down counter. Again an LVC version would be amazing.

And if I'd thought to look at the '269s datasheet before asking I would have found the answer to my '161 question. Doh.
Attachment:
74F269 Multi-stage.png
74F269 Multi-stage.png [ 33.11 KiB | Viewed 3559 times ]


*along with other ICs.


Top
 Profile  
Reply with quote  
PostPosted: Fri Sep 08, 2023 2:34 pm 
Offline

Joined: Fri Jul 09, 2021 10:12 pm
Posts: 741
AndrewP wrote:
However the propagation delay on the HCT4040 is about 8ns whereas the LVC161 is about 3ns.

I think you'll find that 8ns is the propagation delay to the first output - later outputs have higher delays that may not be quoted in the datasheet. Such is life with ripple-counters!

In my video circuits I have typically used a 163 to form a memory clock by dividing the pixel clock by 4 or sometimes 8 - using its outputs to tap off various other frequencies to drive the CPU and interface circuit, and D-flipflops to shift phases as necessary - and I've used 74HCT590s for the actual addresses from that point on, e.g. one for horizontal and one or two for vertical. It's a shame if you can't find those - but in that case I think lots of 163s are your best bet, they should work well if you do the carries right, and are not too hard to hook up. The only disadvantage is that you may need additional transceivers or multiplexers to blend their outputs with addresses from the CPU when required.

I would still use separate ICs for the vertical count (it allows for easy scanline doubling, if you need it), clocked by the hsync signal rather than the pixel clock, and that is one place you can certainly use a 4040 without suffering any ill effects - especially if you use a couple of 8-bit D flipflop registers to latch its outputs, you can then clock it in the middle of the scanline, then latch its outputs at the end. The 8-bit D flipflop register can be selected to have tristate outputs as well, meaning it can connect straight to a bus in case you're not using multiplexers for that.

Overall I think this means my pixel clock doesn't really go into any of the wide counters as they're driven by outputs from earlier counters, ripple-carry-style - the pixel clock only goes to the initial 163, and to the shift registers, but not really anywhere else.


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 43 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: