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 6th Sep 2011, 2:32 pm   #41
val33vo
Retired Dormant Member
 
Join Date: Apr 2008
Location: Banffshire, Scotland, UK.
Posts: 191
Default Re: 4 Digit Up/Down Counter IC?

I think the best solution would be a PIC

Probably a 18f452 which would have more than enough input/out pins to count
your pulses and also drive a display LCD or 7 SEG, speed of operation would not be a prob as these devices usually operate at an instruction rate of 1/4 clock speed which would be around 20 MHZ, so 5 million instructions per second

I am pretty sure you would get away with a more modest device such as a PIC 16f628 but you would probably have to be more inventive in programming it due to having less i/o pins to play with

Just type microchip in your browser and that will get you to the PIC site

There is a free downloadable development system called the MPLAB IDE which will enable you to write, compile and also simulate your design before even touching an IC or a soldering iron

As for programming the device there are quite a few designs on web and I home brewed one for 20p ( Tait programmer )

The best programming language for you would be microchip assembler, its easier to learn than a high level language like C or C++ though more laborious, you would also use less memory ( which may be a problem with the smaller PIC,s )

PIC,s do have emergency power down routines called " brown out " in event of a power cut, they also do have non volatile memory in the form of onboard EEPROM in addition to their RAM and ROM

I would offer to write some code for you but I know from experiance that completing a project from start to actual project working finish can be very time consuming

I started off with PIC,s with no prior knowledge of computing apart from playing around with the BASIC language on a Dragon microcomputer ( my goodness how the years have rolled by )

I would suggest you visit the microchip site and download the free IDE and the free data sheet for the micro you intend to use The 16f628 would probably be a good start there are also application notes with ready written code examples, you will have to take some time to go through the way the IDE software functions and also your chosen micro, I should also mention you can also get in circuit emulators which will let you run your design by plugging your PC into your own circuit board before you even get around to programming a device ( very handy for debuggung as you can step the program one instruction at a time if necessary ) and not now expensive

If you are of an engineering bent then you will have discovered a new absorbing hobby as well ( far more interesting than doing crosswords or playing chess )

regards

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

Hello Stephen,

Thanks for your suggestions.

Quote:
Originally Posted by val33vo View Post
I think the best solution would be a PIC
That does seem to be the general consensus of opinion, and I think I have more or less decided to go with a PIC!

Quote:
There is a free downloadable development system called the MPLAB IDE
I have already downloaded that but not yet tried it out.

Quote:
As for programming the device there are quite a few designs on web and I home brewed one for 20p ( Tait programmer )
I'm considering the Velleman K8048 Programmer Kit, it's reasonably priced and seems to be quite versatile.

Quote:
The best programming language for you would be microchip assembler,...
I understand that MPLAB IDE contains MSASM, which is assembly language.

Quote:
I would suggest you visit the microchip site and download the free IDE and the free data sheet for the micro you intend to use
I have already downloaded the IDE (see above!) and some data sheets, though not the ones you mention - yet!

Regards,

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

Hello George,

Thanks for your comments.

Quote:
Originally Posted by GMB View Post
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).
While I don't doubt that they would be easier to use and program, it does rather seem like using a sledgehammer to crack a nut! I would think that they are much more advance than is required for my application, so a lot of their features would probably not be used, which would be a bit of a waste, I think.

Quote:
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.
Although space is not at a premium, and DIP packages could easily be accommodated, I would prefer to use the smallest package possible, and they come in sizes from 8 pins upwards, unlike the ones you suggest which start at 28 pins.

Quote:
All the development software is free from Microchip and their support services are amazing.
I have already downloaded the MPLAB s/w from there!

Quote:
It's worth buying the cheap in-circuit programmer/debugger which allows you to step through and debug the code on your actual system.
Did you mean the PICkit 2 Starter Kit? I was actually considering the Velleman K8048 Programmer Kit, unfortunately it doesn't support the 24F, 30F and 33F series PICs and I don't think it does ICE, either, so I may reconsider that.

Regards,

Dave.
Amraduk is offline  
Old 6th Sep 2011, 6:23 pm   #44
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
.....
While I don't doubt that they would be easier to use and program, it does rather seem like using a sledgehammer to crack a nut! I would think that they are much more advance than is required for my application, so a lot of their features would probably not be used, which would be a bit of a waste, I think.......
I've learned the hard way that using potentially underpowered hardware for low volume or prototype stuff is a pain in the proverbials. When resources are cheap, as they are with PICs, there's no point in going for minimalism. I know there's a certain intellectual satisfaction in getting good results from minimum resources but unless that's your aim, or if you have no other options it really isn't worth it.

In a valve radio each extra bottle has a high cost. In a transistor radio each extra 3 legged fuse has a significant cost. In a chip, who cares about a few thousand devices sitting idle if they have only cost pennies and don't take enough power to worry about.
ppppenguin is offline  
Old 6th Sep 2011, 6:32 pm   #45
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Jim,

Thanks for your suggestions. The Practical Pic Projects Up/Down counter looks very promising, though it contains features I don't need but I expect it could easily be modified.

The Reading Rotary Encoders application note is interesting, though I think some of the diagrams are a bit ambiguous! The PICs with built-in quadrature decoding look like being the most useful.

Regards,

Dave.
Amraduk is offline  
Old 6th Sep 2011, 6:46 pm   #46
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
I've learned the hard way that using potentially underpowered hardware for low volume or prototype stuff is a pain in the proverbials. When resources are cheap, as they are with PICs, there's no point in going for minimalism. I know there's a certain intellectual satisfaction in getting good results from minimum resources but unless that's your aim, or if you have no other options it really isn't worth it.
I take your point, but if a less advanced PIC does the job perfectly satisfactorily and is not underpowered, then why not use it?

Quote:
In a valve radio each extra bottle has a high cost. In a transistor radio each extra 3 legged fuse has a significant cost. In a chip, who cares about a few thousand devices sitting idle if they have only cost pennies and don't take enough power to worry about.
I don't know about you but I do have to consider the pennies - well, the pounds at least! So, even if the cost differential is low, it all adds up. The more advanced devices could be saved for applications that really need them.

Regards,

Dave.
Amraduk is offline  
Old 6th Sep 2011, 6:47 pm   #47
neon indicator
Retired Dormant Member
 
Join Date: Jun 2010
Location: Co. Limerick, Ireland.
Posts: 1,183
Default Re: 4 Digit Up/Down Counter IC?

Quote:
Originally Posted by ppppenguin View Post

I've learned the hard way that using potentially underpowered hardware for low volume or prototype stuff is a pain in the proverbials. When resources are cheap, as they are with PICs, there's no point in going for minimalism. I know there's a certain intellectual satisfaction in getting good results from minimum resources but unless that's your aim, or if you have no other options it really isn't worth it.

In a valve radio each extra bottle has a high cost. In a transistor radio each extra 3 legged fuse has a significant cost. In a chip, who cares about a few thousand devices sitting idle if they have only cost pennies and don't take enough power to worry about.
Which is why if a PIC 18F is underpowered for an application I'd use either an FPGA or ARM core with Linux depending on if the application needs raw speed and no user interaction, or needs GUI (even if only 128 x 64 GLCD or 2 lines text) and lots of complex software much of which may be already written. Or even an FPGA and an ARM SoC.

The PIC 32 is a MIPs and rather behind compared to ARM SoC, though can run Linux

The other Microchip parts above an 18F are proprietary Microchip 16bit, not really "true" traditional "PIC".
neon indicator is offline  
Old 6th Sep 2011, 6:54 pm   #48
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello George,

Thanks for the link. Found the MPLAB IDE OK!

Regards,

Dave.
Amraduk is offline  
Old 6th Sep 2011, 6:58 pm   #49
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
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.
Did you manage to find those details?

Regards,

Dave.
Amraduk is offline  
Old 6th Sep 2011, 7:43 pm   #50
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:
While I don't doubt that they would be easier to use and program, it does rather seem like using a sledgehammer to crack a nut!
That's like saying that as you don't have far to drive to work you will buy a model-T because you don't need modern car features (like seatbelts).

The trouble with the 8-bit PIC machines is that they are a pain to program and you can get lots of funny bugs from weirdness that you might not expect. They went to absurd lengths to save a few miserable bits and the price you pay is the silly memory bank switching scheme and a single register. You often find simple things taking many instructions to complete.

The coding for the dsp 16 bit machines is generally a lot simpler than for the 8 bit ones in my experience. Vectorised interrupts makes for simple interrupt handling. Having 16 registers and of 16 bits makes life much easier for programming. Proper stack limit checking and some other error checking makes debugging easier.

OK, for a simple logic function it maybe isn't such a big deal but if anyone is starting out with PICs and might want to move on to more ambitious projects then the dsPICs are the way to go. If you have only used the 8-bit ones you just wouldn't attempt many more complex projects because it's just too hard.
GMB is online now  
Old 6th Sep 2011, 7:44 pm   #51
neon indicator
Retired Dormant Member
 
Join Date: Jun 2010
Location: Co. Limerick, Ireland.
Posts: 1,183
Default Re: 4 Digit Up/Down Counter IC?

The vellmann kit is poor value and semi-obsolete part.
Better to get a Pickit2 USB programmer, a 18F2550 or 18F4550 (depending how much I/O) and a scrap of veroboard. It can use many crystals from 4MHz to 20MHz to have a choice of clock internally up to 48MHz.

I have the vellemann kit, it was a waste of money. All you need is crystal, scrap of veroboard, a few caps and 6 pins for the pickit2 programmer (which costs less).
neon indicator is offline  
Old 6th Sep 2011, 7:52 pm   #52
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:
It can use many crystals
You don't need crystals with the more modern PIC machines. Use the FRC oscillator. Crystals are only if you need precision timing.
GMB is online now  
Old 6th Sep 2011, 8:00 pm   #53
mhennessy
Dekatron
 
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,241
Default Re: 4 Digit Up/Down Counter IC?

Hi Dave,

Completely forgot - sorry! But I know where to look - it's just a case of remembering. I'll send you some source code for a demo program that does silly things with all the LEDs, and you can try modifying it to see the effect. All good for confidence building.

PM me your email address tomorrow, and I'll send you that, along with some other goodies...

PS: Unless the speed turns out to be much higher than expected, a 16F PIC is definitely the best for this - ignore the naysayers! Remember what we used to be able to do with BBC Micros, they had an 8 bit processor running at 2MHz tops, and they did a hell of a lot more than you need here. Driving a multiplexed 7-segment display while decoding a rotary encoder does not require a 16 bit core; I'm somewhat amazed at what is being written

Jeffrey, you said earlier that you've never used PICs, so on what grounds are you suspecting the PIC is "potentially underpowered"? Having done this sort of thing for many years, I'd be amazed if there are more than 1-200 lines of code, including comments. I'd also be amazed if it required more than 20 bytes of storage. It would only need one of the available interrupts (perhaps another for the EEPROM storage of the count value). Honestly, the only question mark is the count speed, and I won't labour this because we don't yet know what it will be...

There's nothing "minimalistic" about using an 8-bit microprocessor to count pulses from a tape machine and drive an LED display - far from it. Think how many 8051 processors there are in consumer gear from 20 years back that did much, much more than this. Look at my preamp - that has a rotary encoder, IR remote control, local keyboard, several serial buses, dot-matrix display. All from an 8-bit PIC running at 4 MHz. The only thing that could be faster is the display controller chip; nothing I could do about that...

Besides, once Dave has learnt the basics with this, the advanced stuff will be much, much easier, including high(er) level languages if that's what he needs.

You'll know that I say all that with respect,

Mark
mhennessy is offline  
Old 6th Sep 2011, 8:10 pm   #54
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 GMB View Post
You don't need crystals with the more modern PIC machines. Use the FRC oscillator. Crystals are only if you need precision timing.
Agreed.


Quote:
Originally Posted by neon indicator View Post
The vellmann kit is poor value and semi-obsolete part.
Better to get a Pickit2 USB programmer, a 18F2550 or 18F4550 (depending how much I/O) and a scrap of veroboard. It can use many crystals from 4MHz to 20MHz to have a choice of clock internally up to 48MHz.

I have the vellemann kit, it was a waste of money. All you need is crystal, scrap of veroboard, a few caps and 6 pins for the pickit2 programmer (which costs less).
Disagree. As a teaching aid, the Velleman kit is fine. It also gives our delegates some soldering experience - it's surprising how many electronics graduates can't solder!

It's limited because the connections to the switches and LEDs are fixed, but then you prototype your circuit and take the programming connections (0V, /MCLR, RB7, RB8) to your board from this. Simple. Or, if money is your worry, build the JDM programmer using bits from your scrap box for free. Oh, and the Velleman kit is compatible with the JDM programmer, so you're not tied into using the Velleman software. I use it with IC-Prog - no-doubt there are alternatives these days (suggestions welcome)...

As regards "semi-obsolete", the need for a serial port could be a minor pain - I'll grant you that

Honestly, I'd consider an 18F if I was doing something on the scale of my preamp again, but for a 4 digit BCD counter driven by a rotary encoder?
mhennessy is offline  
Old 6th Sep 2011, 8:10 pm   #55
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 mhennessy View Post
Jeffrey, you said earlier that you've never used PICs, so on what grounds are you suspecting the PIC is "potentially underpowered"? Having done this sort of thing for many years, I'd be amazed if there are more than 1-200 lines of code, including comments.....
I bow to your experience. However I've been caught in the "underpowered" trap on occasion, albeit mostly with programmable logic rather than CPUs, and it's not a nice place to be.
ppppenguin is offline  
Old 6th Sep 2011, 9:04 pm   #56
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Michael,

Quote:
Originally Posted by neon indicator View Post
The vellmann kit is poor value and semi-obsolete part.
Thanks for the warning!

Quote:
Better to get a Pickit2 USB programmer, a 18F2550 or 18F4550 (depending how much I/O) and a scrap of veroboard. It can use many crystals from 4MHz to 20MHz to have a choice of clock internally up to 48MHz.PG164120
Did you mean this: PICkit 2 Microcontroller Programmer? I have looked at that and was wondering if it would be suitable, I guess it is!

Regards,

Dave.
G8TVW.
Amraduk is offline  
Old 6th Sep 2011, 10:33 pm   #57
neon indicator
Retired Dormant Member
 
Join Date: Jun 2010
Location: Co. Limerick, Ireland.
Posts: 1,183
Default Re: 4 Digit Up/Down Counter IC?

Yes, it programs most PIC, 5V or 3.3V, is USB. Also you can use it as simple logic analyser or as a USB to TTL serial I/O when not programming.

I've used many PIC 16F and 18F from 16F84 to 18F67J50 started about 8 years ago

My first MPU project was 1979/1980 Z80. I've used NEC 78HC11, 8051, MIPS, ARM

Assembler, Forth, Pascal, C, C++ (since 1987), Modula-2, Occam, Prolog, Fortran, Visual Basic, Java, c#

I've done 3 main projects in PIC assembler. I don't see any point to it now other than to teach or learn CPU architecture.
For 10F, 12F, 16F, 18F I recommend JALV2. Those chips are not well suited to C, and JAL specially designed for them.
For MIPS (inc PIC32), ARM etc, C or C++. or if you have a larger SoC you can consider Java, C# etc.

My last big ARM project in 2006/2007. "proof of concept" Touch screen, 4G Mobile, VOIP, Email, Web, Media Player, running Debian. We demo'd Qtopia and Ice Window Manager.

The 18F2550 is good replacement for 16F627 (cheaper!) and 18F4550 good replacement for 16F877 (cheaper). Both can be USB clients if wanted.
JAL code on 16F877 simply worked 1st time recompiling for 18F4550.

The pickit2 is nearly 10x faster to program a PIC than the Velleman board.

The simplest PIC breadboard is a PIC on veroboard with 2 capacitors and extra row of sockets for I/O and 6 pins in a row for Pickit2 (works on Windows or Linux). No need to ever unplug chip and programming pins can be shared with I/O if you pay attention to details

You don't need a crystal in theory but a 20MHz low profile crystal is about 80p and allows more accurate timing. On my Frequency counter I have a trimmer capacitor on one pin to fine tune clock. For some applications I have used a 10MHz precision TCXO.
Attached Thumbnails
Click image for larger version

Name:	ArmDem1.jpg
Views:	99
Size:	38.0 KB
ID:	55979  
neon indicator is offline  
Old 7th Sep 2011, 5:05 am   #58
Amraduk
Hexode
 
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
Default Re: 4 Digit Up/Down Counter IC?

Hello Michael,

Quote:
Originally Posted by neon indicator View Post
Yes, it programs most PIC, 5V or 3.3V, is USB. Also you can use it as simple logic analyser or as a USB to TTL serial I/O when not programming.
Thanks for the confirmation.

Quote:
The pickit2 is nearly 10x faster to program a PIC than the Velleman board.
That is a significant speed increase!

Quote:
The simplest PIC breadboard is a PIC on veroboard with 2 capacitors and extra row of sockets for I/O and 6 pins in a row for Pickit2
From reading the PicKIT user manual, it appears that the PIC to be programmed has to be in a target circuit, so that is something that the user, presumably, has to supply. In the case of the Velleman kit, that comes as a part of it.

There is, however, the PicKIT 2 Starter Kit, which does come with a small demo board, the DM1164120-5, featuring the PIC18F87J10 device and a small surface mount prototype area.

So, if I wanted to use non-SM components, that would, presumably, not really be suitable, so the user again has to provide a suitable demo/prototyping board.

I suppose what I'm saying is that something like the Velleman kit would be very useful!

I'm assuming that the photo you attached to your post is a PicKit 2? Is that an LCD display I can see?

Many thanks for your suggestions.

Regards,

Dave.
Amraduk is offline  
Old 7th Sep 2011, 8:28 am   #59
neon indicator
Retired Dormant Member
 
Join Date: Jun 2010
Location: Co. Limerick, Ireland.
Posts: 1,183
Default Re: 4 Digit Up/Down Counter IC?

No, that was an ARM project.

The PIC IC is 50p to £3 each depending on type and quantity. You don't need a PCB. You can buy cheap PCB with space for 5V regulator and breadboard area. But mostly not worth it.

Stripboard/veroboard. Or if in doubt use a "plug in" IC breadboard.

Attached is PIC Frequency counter. It probably would work even without the ULN2003 Digit driver. But I wanted to have very bright display.

To left is 5V regulator and a 1.2GHz prescale IC.

It measures the unregulated input supply too.
Project http://www.techtir.ie/node/1003699
Attached Thumbnails
Click image for larger version

Name:	top_view.jpg
Views:	117
Size:	178.8 KB
ID:	55982  
neon indicator is offline  
Old 7th Sep 2011, 10:51 am   #60
val33vo
Retired Dormant Member
 
Join Date: Apr 2008
Location: Banffshire, Scotland, UK.
Posts: 191
Default Re: 4 Digit Up/Down Counter IC?

Amraduk
Just forgot to mention that you can get very keenly priced PIC micros at a company called Crownhill associates ( type it in your browser on the net ) they dont stock the entire range but only the most popular ( and NO I am not in any way shape or form in their employ or networking )

regards

val33vo
val33vo is offline  
Closed Thread

Thread Tools



All times are GMT +1. The time now is 2:01 pm.


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.