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 4th Sep 2011, 9:01 am   #21
evingar
Octode
 
evingar's Avatar
 
Join Date: Oct 2003
Location: Newbury, Berkshire, UK.
Posts: 1,770
Default Re: 4 Digit Up/Down Counter IC?

What Jeffrey says is correct, I certainly wouldn't advocate using graphical input to do a large FPGA project. However, for a relatively simple CPLD project like this, I can't foresee any problems from the Altera side.

As an aside, Altera's current S/W (Quartus) is a big, and it's not always apparent where everything is "hidden". I would consider using the older MaxPlus S/W, that is contemporary with the devices I suggest. I've done many simple graphical entry projects with this without the slightest issue, and I've also done some "hybrid" projects that use the graphical input to " bolt together" logic blocks I have constructed myself from VHDL. This approach is not really what VHDL is "all about" (unitary project description) but I found it was a good way to "ease" myself into the "nuts and bolts" of the language (for someone whose brain was wired to creating something from component parts (TTL etc).

https://www.altera.com/download/dnl-index.jsp
__________________
Chris

Last edited by evingar; 4th Sep 2011 at 9:23 am.
evingar is offline  
Old 4th Sep 2011, 10:18 am   #22
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?

An average CPLD project is often going to be a single VHDL module anyway so all the issues of "wiring" modules together just don't arise.

I was a schematic entry "refusenik" for many years until finally I saw the light and started on VHDL. Unfortunately my entry point was a complex project which made the learning curve very steep indeed.
ppppenguin is offline  
Old 4th Sep 2011, 11:17 am   #23
neon indicator
Retired Dormant Member
 
Join Date: Jun 2010
Location: Co. Limerick, Ireland.
Posts: 1,183
Default Re: 4 Digit Up/Down Counter IC?

Though really a PIC 18F with JAL would be easier if you have any experience of Pascal, Visual Basic, MS-Office Macros or C. Non-volatile
The 18F2550 is very cheap and all the tools (Linux or Windows) are free. It has option for USB (just add socket and a capacitor) and then you could even have PC based position control. Even a 16F is fast enough. But the 18F is about same price and 4.8x faster. There is also Analogue I/O too. A combo counter / level display using small VFD, LCD or LEDs is possible with bargraph and/or digits.

CPLD is also a useful skill but not as general purpose. It beats the PIC hands down on a high speed application. (MHz events). The PIC 18F will easily handle general I/O up to 20KHz and more specialised Digital counting/timing to many MHz with onboard HW counters that can be mapped to input pins.

JAL http://groups.google.com/group/jallib
(JalEdit recomended for Windows, but you can use any editor)

http://justanotherlanguage.org/

The device library support (all open source) is amazing on Jal for 10F, 12F, 16F and 18F PIC families.
neon indicator is offline  
Old 4th Sep 2011, 12:19 pm   #24
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 really must have a go with PICs. They seem incredibly cheap and versatile.
ppppenguin is offline  
Old 4th Sep 2011, 3:08 pm   #25
mhennessy
Dekatron
 
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,241
Default Re: 4 Digit Up/Down Counter IC?

Go for it - lots of help available on the internet, and personally, I love the assembly language (but then, I'm weird!). The 16F devices are a good place to start, and there's a basic Velleman dev kit for around £20 that we give out to students. Once you get to the 18F devices you're allowed to consider C or some other language, but you'll appreciate the low-level knowledge when doing time-critical stuff.

Some years back I started a basic introduction guide on my site, although I suspect you'll find it rather too basic...
mhennessy is online now  
Old 4th Sep 2011, 11:45 pm   #26
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

I thought I'd posted a reply earlier but it hasn't appeared yet, so I don't quite know what happened to it!

Thanks to everyone for your comments and suggestions, in particular, Jeffery, for kindly taking the trouble to provide a code fragment example for an up/down counter, Mark, and Chris. There's a lot of information to digest, so I guess it will take a little while.

At the moment, I'm tending towards using a PIC for this application, if only for the non-volatile memory they contain, unlike, it seems, FPGAs and CPLDs. Even if I do go down that route, I'll still look into using FPGAs and/or CPLDs for possible future use.

Many thanks to you all, once again.

Regards,

Dave.
Amraduk is offline  
Old 5th Sep 2011, 4:31 pm   #27
davegsm82
Heptode
 
davegsm82's Avatar
 
Join Date: Jan 2004
Location: Blyth, Northumberland, UK.
Posts: 858
Default Re: 4 Digit Up/Down Counter IC?

Dave, you should definitely try some PIC programming, I can thoroughly recommend it.

I've made loads of little projects using PIC's, you can get a USB programmer on ebay for £15 which cuts down the programming time etc, you can even use its 5v supply to run your project!

I've not tried JAL, instead I program in C, which for 'nuts and bolts' work is dead easy. C can be a bit confusing when you start doing really complicated stuff.

For your display you could use some I2C serial devices, you can get a chip which handles figure-8 displays, can't remember the number but there are plenty out there.

Give it a go, you won't regret it!

Dave.
davegsm82 is offline  
Old 5th Sep 2011, 4:39 pm   #28
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Dave,

Thanks for your comments. I probably will give PIC programming a go. There are so many different programmers and programming languages available, that it's a bit daunting trying to decide what to get!

Regards,

Dave.
Amraduk is offline  
Old 5th Sep 2011, 7:52 pm   #29
mhennessy
Dekatron
 
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,241
Default Re: 4 Digit Up/Down Counter IC?

To be honest, you probably won't need a separate IC to drive the display; the PIC can do it all. Perhaps you might need to buffer it a bit, as last time I checked, the current limit of each pin was 25mA. There are countless examples of how to drive a multiplexed 7-segment display on the web and in books...

For this, I'd really advise assembly language. OK, there's a bit of a curve at first, but it's be best way to get to understand these devices. Especially for something simple like this. Higher level languages have their place, but I really think that it's best to start at the beginning. Plus, if you're using assembly, I'll be able to help

Cheers,

Mark
mhennessy is online now  
Old 5th Sep 2011, 9:03 pm   #30
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Mark,

Quote:
Originally Posted by mhennessy View Post
To be honest, you probably won't need a separate IC to drive the display; the PIC can do it all.
That's what I thought!

Quote:
Perhaps you might need to buffer it a bit, as last time I checked, the current limit of each pin was 25mA.
That was something I wondered about, though I would think that 25mA should be enough, if not, adding buffers is no problem.

Quote:
For this, I'd really advise assembly language. OK, there's a bit of a curve at first, but it's be best way to get to understand these devices. Especially for something simple like this. Higher level languages have their place, but I really think that it's best to start at the beginning.
Using assembly language, I suppose one would, perhaps, gain a deeper understanding of how PICs work.

The main difficulty, as I see it, in choosing a programmer, is that some seem not to have anywhere to 'plug-in' a PIC whereas others do, using SM techniques, DIL or ZIF sockets, sometimes in combination with PLCC to DIL adaptors. I suppose it's mainly because I'm not familiar with them! They also come in a very wide price range, from as little as a few pounds to well over a hundred! Are the cheapest ones going to be not much use and the expensive ones more sophisticated than needed? Just how does one decide!

Quote:
Plus, if you're using assembly, I'll be able to help
Thanks for the offer, If I run into problems I'll be in touch!

Regards,

Dave.
Amraduk is offline  
Old 5th Sep 2011, 10:09 pm   #31
mhennessy
Dekatron
 
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,241
Default Re: 4 Digit Up/Down Counter IC?

Hi Dave,

You're right - it is daunting! There is a PIC for everyone, but where to start. For years, the 16F84 was the favorite, and that's what I use for my simple "getting started" guide on my site. But for some time now, Microchip have been trying to persuade people to use other devices, by putting the price up. But, it's a perfectly good chip, and I'm sure I could find a spare one if you like.

In terms of the programmer, I built a JDM clone - these are serial port programmers that work pretty well for the money. I mentioned a Velleman kit earlier; here it is: http://cpc.farnell.com/velleman-kit/...0846?Ntt=k8048

Note that any serial programmers need a genuine serial port - a USB to serial dongle won't work. But you don't need a modern machine to do this, indeed it's a good way to get some use from an old P1, P2 or P3 system.

The PIC that comes with the Velleman kit is a 16F627. This is largely comparable to the 16F84, but adds a few new facilities like an ADC. My "getting started" guide will apply to this chip, although you'll need to add one or two lines to the "init" subroutine and you might need to use different ports (very easy). I'll look up the details tomorrow when I'm back at work.

The Velleman kit doesn't use ZIF sockets, but for basic learning purposes, you can just leave the PIC in the socket, and flick a toggle switch when you want to programme. Flick it back again to see the results. Once you've got past the "hello world" stage, you'll want to use a breadboard or Veroboard or similar, but as there are only three signals plus ground to connect to the PIC while programming, a plug-in wire is easier than removing the IC, or paying for ZIF sockets. I use an old CD-ROM audio cable, which (unusually) has 3 cores inside the screen...

There are lots of questions when beginning - there are hundreds of approaches, and I'm not saying mine is the best way, but do have a look at my guide because it is a very gentle introduction. It's not finished, not by a long way, but it should help you make your first tentative steps. http://www.mhennessy.f9.co.uk/pic/index.htm

Cheers,

Mark
mhennessy is online now  
Old 6th Sep 2011, 12:48 am   #32
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Mark,

Quote:
Originally Posted by mhennessy View Post
In terms of the programmer, I built a JDM clone - these are serial port programmers that work pretty well for the money.
That is a very simple programmer!

Quote:
I mentioned a Velleman kit earlier;
I've taken a look at that, it is very reasonably priced and looks quite comprehensive. I noticed that they do another kit, K8076, Velleman PIC Programmer Board Kit, it's priced at slightly more than the K8048 (PIC Programmer and Experiment Board Kit) but has far fewer components and doesn't support as many devices, granted it has a ZIF socket but I wouldn't have thought that would have added that much to the cost, I do wonder why there isn't a bigger price difference!

Talking of prices, I can get the Velleman K8048 from ESR Electronics for about £4.50 less than CPC/Farnell!

Quote:
The PIC that comes with the Velleman kit is a 16F627. This is largely comparable to the 16F84, but adds a few new facilities like an ADC. My "getting started" guide will apply to this chip, although you'll need to add one or two lines to the "init" subroutine and you might need to use different ports (very easy). I'll look up the details tomorrow when I'm back at work.
Thanks, I'll look forward to that.

Quote:
Once you've got past the "hello world" stage, you'll want to use a breadboard or Veroboard or similar, but as there are only three signals plus ground to connect to the PIC while programming, a plug-in wire is easier than removing the IC, or paying for ZIF sockets. I use an old CD-ROM audio cable, which (unusually) has 3 cores inside the screen...
I take it from that, that if I wanted to develop my own application, rather than one that comes with the kit, that I can't do that with the programmer and have to use an external breadboard or similar, or have I misunderstood it?

Quote:
There are lots of questions when beginning...
There certainly are!

Quote:
...- there are hundreds of approaches, and I'm not saying mine is the best way, but do have a look at my guide because it is a very gentle introduction. It's not finished, not by a long way, but it should help you make your first tentative steps.
Will do.

I looked for the MPASM Assembler on the Microchip site, they don't make it easy to find where to d/l it! I searched for it and got 2240 results! I also looked at the IC-Prog site mentioned in your guide but couldn't find anywhere to d/l that either! I clicked on the ConTEXT link in your guide but didn't see anything about that editor!

Regards,

Dave.

Last edited by Amraduk; 6th Sep 2011 at 1:00 am.
Amraduk is offline  
Old 6th Sep 2011, 7:33 am   #33
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?

Quote:
Originally Posted by Amraduk View Post
I clicked on the ConTEXT link in your guide but didn't see anything about that editor!
I use ConTEXT as a general purpose text editor instead of Notepad. It's OK but some operations are subtly and annoyingly different to other editors I use, notably the inbuilt VHDL editor in the Xilinx software. However, it's good enough and a great improvement over PFE which I used to use. PFE was good in its time but now very dated.

http://www.contexteditor.org/
ppppenguin is offline  
Old 6th Sep 2011, 9:25 am   #34
GMB
Dekatron
 
GMB's Avatar
 
Join Date: Aug 2003
Location: near Reading (and sometimes Torquay)
Posts: 3,086
Default Re: 4 Digit Up/Down Counter IC?

I would suggest that if you want to start with the Microchip PIC machines, don't waste your time with the old 8-bit ones that everyone talks about (12F to 18F) which are quirky and awkward.

Use the "dsp" versions such as the 24F, 30F and 33F series (all run the same core code). These are proper multi-register 16-bit machines somewhat like older mini-computers. They are seriously easier to code and are much faster both because they will run quite fast clock rates but also that each instruction gets more useful work done. You won't see much price difference (for one-off projects).

They are amazing little machines with all kinds of nice I/O features and they still make a few models in old-fashioned DIL packages - right up to 40-pin if you need the pins.

All the development software is free from Microchip and their support services are amazing. It's worth buying the cheap in-circuit programmer/debugger which allows you to step through and debug the code on your actual system.
GMB is online now  
Old 6th Sep 2011, 9:34 am   #35
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?

While I have never used PICs I can concur with George's approach. When the objective is to get the job done, don't skimp on the tools. Whether these are soldering irons or software packages.

I know that I come to this from the professional side - I can usually afford to spend the money on tools to get the job done - the cost of PIC tools and devices is so low that even the better ones are easily affordable for the enthusiast.
ppppenguin is offline  
Old 6th Sep 2011, 11:02 am   #36
jimmc101
Heptode
 
jimmc101's Avatar
 
Join Date: Mar 2009
Location: Portsmouth, Hampshire, UK.
Posts: 674
Default Re: 4 Digit Up/Down Counter IC?

If you do go the PIC / assembler route then it might be worth looking at
http://picprojects.org.uk/projects/counter/counter.htm
No encoder interface, but the source code for the counter and led driver is there.

I think a software interface to the encoder interface should be fast enough (see http://www.tufts.edu/programs/mma/em...aryEncoder.pdf), however if you are worried there are PICs such as the PIC18F2331 which have the hardware built in (microchip call it QEI)

Jim
jimmc101 is offline  
Old 6th Sep 2011, 12:11 pm   #37
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Jeffrey,

Thanks for the link to the ConTEXT Editor, it worked fine. The one in Mark's guide is: www.context.cx/, not the same at all!

Regards,

Dave.
Amraduk is offline  
Old 6th Sep 2011, 12:23 pm   #38
mhennessy
Dekatron
 
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,241
Default Re: 4 Digit Up/Down Counter IC?

Quote:
Originally Posted by Amraduk View Post
Thanks for the link to the ConTEXT Editor, it worked fine. The one in Mark's guide is: www.context.cx/, not the same at all!
Hi Dave,

You're quite right; I really must update the website. A while back Eden Kirin, the original developer, sold the project to a guy in the UK. The .cx address stayed alive for quite a while after this, but has obviously gone now.


Quote:
Originally Posted by ppppenguin View Post
While I have never used PICs I can concur with George's approach. When the objective is to get the job done, don't skimp on the tools. Whether these are soldering irons or software packages.
This is a valid point, and sometimes I wonder if I should have used a more advanced PIC for my preamp because it would make some aspects of the development and bug-fixing easier. This uses a 16F877 which has 8K of program memory, and I think I filled about 75% of it...

But folks, this is a 4 digit BCD counter driven by a rotary encoder! There's really no need for anything more advanced, providing the PIC can keep up with the count speed...

By all means be aware of the other options for more advanced projects, but as I said in my first post, this is a really good way "in"

Mark
mhennessy is online now  
Old 6th Sep 2011, 12:42 pm   #39
GMB
Dekatron
 
GMB's Avatar
 
Join Date: Aug 2003
Location: near Reading (and sometimes Torquay)
Posts: 3,086
Default Re: 4 Digit Up/Down Counter IC?

Quote:
I looked for the MPASM Assembler on the Microchip site, they don't make it easy to find where to d/l it
That's because you are looking for the wrong thing. MPASM is part of the MPLAB IDE and you need other bits too.

Just look under "development tools" on their main page http://www.microchip.com and follow the link for MPLAB IDE.
GMB is online now  
Old 6th Sep 2011, 1:43 pm   #40
mhennessy
Dekatron
 
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,241
Default Re: 4 Digit Up/Down Counter IC?

MPASM was always available as a separate download - useful in the dial-up days as MPLAB is quite large, plus early versions were not very good. However, you're right; it appears that Microchip no longer offer it as a separate download.

Dave, worry not; MPASM is part of MPLAB.

Another change I need to make to the guide. Still, it was written some 6+ years back, so not surprising, I guess...
mhennessy is online now  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 12:15 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.