|
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. |
|
Thread Tools |
6th Sep 2011, 2:32 pm | #41 |
Retired Dormant Member
Join Date: Apr 2008
Location: Banffshire, Scotland, UK.
Posts: 191
|
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 |
6th Sep 2011, 5:21 pm | #42 | ||||
Hexode
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
|
Re: 4 Digit Up/Down Counter IC?
Hello Stephen,
Thanks for your suggestions. 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:
Quote:
Quote:
Quote:
Regards, Dave. |
||||
6th Sep 2011, 6:05 pm | #43 | ||||
Hexode
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
|
Re: 4 Digit Up/Down Counter IC?
Hello George,
Thanks for your comments. Quote:
Quote:
Quote:
Quote:
Regards, Dave. |
||||
6th Sep 2011, 6:23 pm | #44 | |
Retired Dormant Member
Join Date: Dec 2003
Location: North London, UK.
Posts: 6,168
|
Re: 4 Digit Up/Down Counter IC?
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. |
|
6th Sep 2011, 6:32 pm | #45 |
Hexode
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
|
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. |
6th Sep 2011, 6:46 pm | #46 | ||
Hexode
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
|
Re: 4 Digit Up/Down Counter IC?
Hello Jeffery,
Quote:
Quote:
Regards, Dave. |
||
6th Sep 2011, 6:47 pm | #47 | |
Retired Dormant Member
Join Date: Jun 2010
Location: Co. Limerick, Ireland.
Posts: 1,183
|
Re: 4 Digit Up/Down Counter IC?
Quote:
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". |
|
6th Sep 2011, 6:54 pm | #48 |
Hexode
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
|
Re: 4 Digit Up/Down Counter IC?
Hello George,
Thanks for the link. Found the MPLAB IDE OK! Regards, Dave. |
6th Sep 2011, 6:58 pm | #49 | |
Hexode
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
|
Re: 4 Digit Up/Down Counter IC?
Hello Mark,
Quote:
Regards, Dave. |
|
6th Sep 2011, 7:43 pm | #50 | |
Dekatron
Join Date: Aug 2003
Location: near Reading (and sometimes Torquay)
Posts: 3,086
|
Re: 4 Digit Up/Down Counter IC?
Quote:
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. |
|
6th Sep 2011, 7:44 pm | #51 |
Retired Dormant Member
Join Date: Jun 2010
Location: Co. Limerick, Ireland.
Posts: 1,183
|
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). |
6th Sep 2011, 7:52 pm | #52 | |
Dekatron
Join Date: Aug 2003
Location: near Reading (and sometimes Torquay)
Posts: 3,086
|
Re: 4 Digit Up/Down Counter IC?
Quote:
|
|
6th Sep 2011, 8:00 pm | #53 |
Dekatron
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,241
|
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 |
6th Sep 2011, 8:10 pm | #54 | ||
Dekatron
Join Date: Jul 2007
Location: Evesham, Worcestershire, UK.
Posts: 4,241
|
Re: 4 Digit Up/Down Counter IC?
Quote:
Quote:
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? |
||
6th Sep 2011, 8:10 pm | #55 |
Retired Dormant Member
Join Date: Dec 2003
Location: North London, UK.
Posts: 6,168
|
Re: 4 Digit Up/Down Counter IC?
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.
|
6th Sep 2011, 9:04 pm | #56 | |
Hexode
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
|
Re: 4 Digit Up/Down Counter IC?
Hello Michael,
Thanks for the warning! Quote:
Regards, Dave. G8TVW. |
|
6th Sep 2011, 10:33 pm | #57 |
Retired Dormant Member
Join Date: Jun 2010
Location: Co. Limerick, Ireland.
Posts: 1,183
|
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. |
7th Sep 2011, 5:05 am | #58 | |||
Hexode
Join Date: Jan 2007
Location: Welwyn Garden City, Hertfordshire, UK.
Posts: 453
|
Re: 4 Digit Up/Down Counter IC?
Hello Michael,
Quote:
Quote:
Quote:
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. |
|||
7th Sep 2011, 8:28 am | #59 |
Retired Dormant Member
Join Date: Jun 2010
Location: Co. Limerick, Ireland.
Posts: 1,183
|
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 |
7th Sep 2011, 10:51 am | #60 |
Retired Dormant Member
Join Date: Apr 2008
Location: Banffshire, Scotland, UK.
Posts: 191
|
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 |