UK Vintage Radio Repair and Restoration Powered By Google Custom Search Vintage Radio and TV Service Data

Go Back   UK Vintage Radio Repair and Restoration Discussion Forum > General Vintage Technology > Components and Circuits

Notices

Components and Circuits For discussions about component types, alternatives and availability, circuit configurations and modifications etc. Discussions here should be of a general nature and not about specific sets.

Closed Thread
 
Thread Tools
Old 2nd Sep 2011, 4:56 pm   #1
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default 4 Digit Up/Down Counter IC?

I'm planning on building a 4-digit electronic "turns counter" to replace the broken mechanical one in my Revox tape recorder. I have searched for a suitable IC that will take in the quadrature o/p of a shaft encoder and output drive for a 7-segment LED display but not had any success. I've only been able to find either obsolete ICs or ones that don't fit all the requirements. Does anyone here know of any suitable currently available ICs?

Regards,

Dave.
Amraduk is offline  
Old 2nd Sep 2011, 7:31 pm   #2
mhennessy
Dekatron
 
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,244
Default Re: 4 Digit Up/Down Counter IC?

I can't think of a single chip that would do this, although it could be done with TTL or CMOS logic. However, this would be an idea project to learn about PIC processors - I reckon this could be done really very easily. I built a hi-fi preamp that uses a rotary encoder for volume/menu functions, and found that it was pretty easy to work with.

A nice feature; most PICs have non-volatile flash RAM, so you could save the value in there when it gets powered down, meaning the value would be retained...

If I had more spare time, I'd offer to write the code for you - sadly life is just too busy, but I'm willing to help in any way I can. There's a PIC guide on my site, if that helps.

Good luck,

Mark
mhennessy is offline  
Old 2nd Sep 2011, 7:46 pm   #3
Guest
Guest
 
Posts: n/a
Default Re: 4 Digit Up/Down Counter IC?

You can get electromechanical counters from Farnell, they have a relay type coil that drives the counter.
 
Old 2nd Sep 2011, 7:59 pm   #4
mhennessy
Dekatron
 
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,244
Default Re: 4 Digit Up/Down Counter IC?

...would that keep up with fast spooling? The ones I've seen are pretty rapid
mhennessy is offline  
Old 2nd Sep 2011, 8:42 pm   #5
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Mark,

Thanks for your reply.

Quote:
Originally Posted by mhennessy View Post
I can't think of a single chip that would do this, although it could be done with TTL or CMOS logic.
Indeed, it could, and I was initially thinking along those lines but I found an IC that will take in the quadrature o/p of the encoder and do the necessary logic for producing the up/down signal but it only outputs a binary result, not as drive for a 7-segment LED display, hence my enquiry!

Quote:
However, this would be an idea project to learn about PIC processors - I reckon this could be done really very easily.
I've read that a PIC might not keep up, though, IIRC, it was for a different application, so may not apply in this case. However, I would need to be certain that it would, before going down that route!

Quote:
A nice feature; most PICs have non-volatile flash RAM, so you could save the value in there when it gets powered down, meaning the value would be retained...
That would be a very useful feature, I was wondering how I could do that with a single chip solution. If I were go with TTL or CMOS logic, I suppose that might be easier to implement.

Quote:
If I had more spare time, I'd offer to write the code for you - sadly life is just too busy, but I'm willing to help in any way I can. There's a PIC guide on my site, if that helps.
Thanks for your offer to help, I haven't used PICs so far, which is another reason I wasn't considering that route, but that's something I intend to rectify at some point, though it might not be for a while. I'll take a look at your site to see if it gives me any ideas.

The only thing I'm unsure about, is how many pulses per revolution, though based on the mechanical counter, which incremented by approx one per rev, I guess that it would have to be the same.

Regards,

Dave.
Amraduk is offline  
Old 2nd Sep 2011, 8:50 pm   #6
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Quote:
Originally Posted by merlinmaxwell View Post
You can get electromechanical counters from Farnell, they have a relay type coil that drives the counter.
Thanks for your reply.

I wanted to keep away from mechanical devices as far as possible! Mike (mhennessy) is probably right that it wouldn't keep up and I would think that it would be too big for the available space.

Regards,

Dave.
Amraduk is offline  
Old 2nd Sep 2011, 8:58 pm   #7
evingar
Octode
 
evingar's Avatar
 
Join Date: Oct 2003
Location: Newbury, Berkshire, UK.
Posts: 1,770
Default Re: 4 Digit Up/Down Counter IC?

I'd take the CPLD approach.

My fav for small DIY jobs is the "retro" Altera 7000 family :-

http://uk.farnell.com/altera/epm7064...lcc/dp/1637255


You can fit it in a PLCC PTH socket, so wiring it is easy on patch board. Altera do free S/W, you can serially program it with a DIY pod running from an old PC parallel port.


https://www.altera.com/download/software/quartus-ii-we

http://www.altera.com/literature/ug/...byte%20blaster


You don't need to know any programming language, you can "drag and drop" TTL elements to make up your required logic.

It will give you the "1 chip solution" you require, and is very easy to modify the logic without having to get the soldering iron out each time.
__________________
Chris
evingar is offline  
Old 2nd Sep 2011, 9:12 pm   #8
mhennessy
Dekatron
 
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,244
Default Re: 4 Digit Up/Down Counter IC?

Hi Dave,

Quote:
Originally Posted by Amraduk View Post
Quote:
Originally Posted by mhennessy View Post
I can't think of a single chip that would do this, although it could be done with TTL or CMOS logic.
Indeed, it could, and I was initially thinking along those lines but I found an IC that will take in the quadrature o/p of the encoder and do the necessary logic for producing the up/down signal but it only outputs a binary result, not as drive for a 7-segment LED display, hence my enquiry!
Ahh - you didn't say that! In that case you need a binary to BCD converter. Used to be done with discrete logic, but I think there might be chips that do some of the work for you (I never used them), although for this I'd use a PIC* - a really simple bit of code could decode the binary input and display it on a multiplexed LED display.

To be honest though, the quadrature decoding is little more than a D-type latch, so the chip you've found doesn't really save much. You'd be better making your own counter that can count in BCD, which would then simply need decoding to drive the 7-segment display. But it amounts to around 10 ICs in total - I would have considered going down this route before I learnt to programme PICs, but no chance now


Quote:
I've read that a PIC might not keep up, though, IIRC, it was for a different application, so may not apply in this case. However, I would need to be certain that it would, before going down that route!
Yes, we'd need to establish the highest clock speed. Although this could easily be divided down by 2 or 4 with a single 74HC74 or 4013 before feeding it to a PIC. Failing that, programmable logic could be used - I've done simple things like this in the past...

For what it's worth, the encoder on my preamp outputs 128 pulses per revolution, and keeps up with any rotation that you can do by hand. I've never tried spinning it with a drill or similar to see what happens when it gets too fast (there's an idea )


Quote:
Quote:
A nice feature; most PICs have non-volatile flash RAM, so you could save the value in there when it gets powered down, meaning the value would be retained...
That would be a very useful feature, I was wondering how I could do that with a single chip solution. If I were go with TTL or CMOS logic, I suppose that might be easier to implement.
It would be harder with CMOS logic and rather less practical with TTL logic. The PIC would do it in software, so no need for backup batteries or capacitors.

Good luck,

Mark

* Other programmable microcontrollers are available
mhennessy is offline  
Old 2nd Sep 2011, 9:38 pm   #9
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Chris,

Thanks for your reply.

Quote:
Originally Posted by evingar View Post
I'd take the CPLD approach.

My fav for small DIY jobs is the "retro" Altera 7000 family :-

You don't need to know any programming language, you can "drag and drop" TTL elements to make up your required logic.

It will give you the "1 chip solution" you require, and is very easy to modify the logic without having to get the soldering iron out each time.
This looks very promising! What about 'non-volatile memory', can it be implemented in this series of devices?

I will take a look at the links you provided to see what's involved.

Regards,

Dave.
Amraduk is offline  
Old 2nd Sep 2011, 9:54 pm   #10
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Mark,

Thanks for your further reply. The solution proposed by Chris (evingar) looks very promising! Particularly because the programming s/w is free and one doesn't need to learn a programming language!

I agree that the quadrature decoding is only a small part but it would be one less thing to have to do!

Regards,

Dave.
Amraduk is offline  
Old 3rd Sep 2011, 8:22 am   #11
ppppenguin
Retired Dormant Member
 
ppppenguin's Avatar
 
Join Date: Dec 2003
Location: North London, UK.
Posts: 6,168
Default Re: 4 Digit Up/Down Counter IC?

I would do it in a CPLD, probably a Xilinx Coolrunner because thy are the ones I know best. You can get little DIL modules with the SM chip fitted though I've never actually used one.

I've not done anything with PICs but they sound just right for the job. We're not talking about anything very fast, this is a kHz problem, not a MHz one, even at high rotational speeds.
ppppenguin is offline  
Old 3rd Sep 2011, 8:42 am   #12
mhennessy
Dekatron
 
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,244
Default Re: 4 Digit Up/Down Counter IC?

Hi Dave,

Indeed, I did suggest programmable logic in my last reply, but I didn't go into details because the devices I used were older, and the software that went with them was far from easy, and I was aware that I'd be giving you old information. The only way to programme them was to derive long logic equations, and the software was amazingly clunky. Happily, things seem to have vastly improved, based on the information in Chris's post...

This is an interesting question, BTW. When a problem like this comes along, the first question is always "microcontroller or programmable logic?". And to answer the question, you consider factors such as complexity vs operating speed. For example, my hi-fi preamp could have been done in programmable logic at a push (although not by me ). But a microcontroller was a no-brainer. Something like a video test card generator, that requires high processing speeds, is normally best done with programmable logic - again, that's generally pretty clear-cut. But your application is one of those "grey areas". The complexity is minimal, but so are the operating speeds. Based on what I know of the problem at this stage, I'd say either device would be equally practical, and it's a matter of personal preference. I'd choose a PIC simply because I know how to programme them. But as you are starting from scratch, you can choose the solution that's easiest

BTW, the software for PIC programming is completely free as well. And the programming hardware is DIY, hanging off a serial port (though many people, including Velleman, produce kits for not much money). Parallel ports and USB are an option too.

I don't know if these things have non-volatile memory; certainly the older ones didn't. Also, the older ones were rather power-hungry, making capacitor or battery backup impractical, but I'm sure they must be better in that regard these days. Chris?

Mentioning power consumption has reminded me; someone I know in BBC R&D used programmable logic to implement an MPEG video encoder. I can't begin to appreciate the level of complexity and skill involved, but he was amazingly modest about it! But why got to all this effort when MPEG encoder chips are readily available? Because the PLD solution was much more power efficient, and this was for a portable battery-operated device. OT, I know, but gives you some idea of what can be done

Cheers,

Mark
mhennessy is offline  
Old 3rd Sep 2011, 9:55 pm   #13
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Jeffrey and Mark, thanks for your comments and suggestions. I will have to investigate the alternatives to see what are the pros and cons!

I would appreciate it if you could point me to the free s/w and DIY programming h/w for both PICs and CPLDs, thanks.

Regards,

Dave.
Amraduk is offline  
Old 3rd Sep 2011, 10:08 pm   #14
evingar
Octode
 
evingar's Avatar
 
Join Date: Oct 2003
Location: Newbury, Berkshire, UK.
Posts: 1,770
Default Re: 4 Digit Up/Down Counter IC?

Quote:
Originally Posted by Amraduk View Post

This looks very promising! What about 'non-volatile memory', can it be implemented in this series of devices?



Regards,

Dave.
No, unfortnately not. If you want anything to survive on power down, the device would have to be maintained with a NiCad (etc).
__________________
Chris
evingar is offline  
Old 3rd Sep 2011, 10:18 pm   #15
ppppenguin
Retired Dormant Member
 
ppppenguin's Avatar
 
Join Date: Dec 2003
Location: North London, UK.
Posts: 6,168
Default Re: 4 Digit Up/Down Counter IC?

The Xilinx webpack free software will allow you program all their CPLDs and many of smaller FPGAs. Simple parallel port programming hardware can be built easily.
ppppenguin is offline  
Old 3rd Sep 2011, 10:46 pm   #16
Top Cap
Octode
 
Top Cap's Avatar
 
Join Date: Mar 2006
Location: Watford, Hertfordshire, UK.
Posts: 1,270
Default Re: 4 Digit Up/Down Counter IC?

Pity you could not engineer-in something like the attached, using the FF and RW keys to determine whether to count up or down. I have seen much smaller counters even with full panel mount capability but they only count up . Perhaps you could find a suitable panel bezel for it to fit behind whilst using a suitable supporting back board. At least it will hold the display/accumulated pulses when the machine is turned off and no need to provide any special power rails as it runs on an external Lithium battery. The only drawback may be cost as I have not a clue as to how much this meter is. You would have to take account of the possible savings to be made over the cost of alternative methods.
Les
Attached Files
File Type: pdf 799988-402_412_Spec.pdf (32.6 KB, 148 views)
__________________
Whether the Top Cap is Grid or Anode - touching it will give you a buzz either way!
Top Cap is offline  
Old 4th Sep 2011, 12:03 am   #17
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Les,

Thanks for your suggestion. The cost from the manufacturer of the device you mentioned is $46, I think it could be done for less, using programmable logic.

I also need only four digits, so 4 of the 8 in this device would be wasted. The dimensions needed for the display are approximately 30mm x 7mm, 4 of the digits on this device are approximately 16mm wide (about 4mm per digit), so too small, I'm afraid.

I would rather keep the direction sensing away from the transport controls, and would prefer it to come from the shaft encoder, which I will still need anyway.

Regards,

Dave.
Amraduk is offline  
Old 4th Sep 2011, 12:08 am   #18
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Chris,

Quote:
Originally Posted by evingar View Post
No, unfortnately not. If you want anything to survive on power down, the device would have to be maintained with a NiCad (etc).
That's a pity! Thanks for the info.

Regards,

Dave.
Amraduk is offline  
Old 4th Sep 2011, 12:10 am   #19
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Jeffery,

Quote:
Originally Posted by ppppenguin View Post
The Xilinx webpack free software will allow you program all their CPLDs and many of smaller FPGAs. Simple parallel port programming hardware can be built easily.
OK. Thanks for that information.

Regards,

Dave.
Amraduk is offline  
Old 4th Sep 2011, 8:43 am   #20
ppppenguin
Retired Dormant Member
 
ppppenguin's Avatar
 
Join Date: Dec 2003
Location: North London, UK.
Posts: 6,168
Default Re: 4 Digit Up/Down Counter IC?

Here's an example of a low cost Xilinx Coolrunner based module. There are others but I don't have links to hand:

http://shop.trenz-electronic.de/cata...ucts_id=77&SID

One warning about using Xilinx (or later Altera) software. While it is theoretically possible to design using schematic entry in practice it's a gesture to make you wish you'd learned VHDL instead. I don't want to put you off but VHDL is a hideous language. However once you've got to grips with it you will find it very pwoerful and flexible. There are a couple of us here in UKVRR who are at least adequately up to speed with it and will help all we can. As an example here's the code fragment for an up/down counter which is more or less self explanatory. There are several subtle points to note but this gives you the general idea.

Code:
process (CK) begin
    if rising_edge(CK) then    

        if COUNTER_RESET then COUNT <= 0;  
            elsif COUNT_MODE = COUNT_DOWN then COUNT <= COUNT -1;
            else         COUNT <= COUNT + 1;
        end if;

    end if; --CK
end process;
ppppenguin is offline  
Closed Thread




All times are GMT +1. The time now is 11:18 am.


All information and advice on this forum is subject to the WARNING AND DISCLAIMER located at https://www.vintage-radio.net/rules.html.
Failure to heed this warning may result in death or serious injury to yourself and/or others.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright ©2002 - 2023, Paul Stenning.