Just one PIC to use it as counter with multiple functions. Here is the pin information:
Taken from http://www.josepino.com
PIN FUNCTIONS:
CLEAR/COUNT - GND to clear count, VSS to count.
SAVE COUNT - GND start from zero on power up, VSS continue last count.
C CATHODE/C ANODE - GND to use COMMON CATHODE Display, VSS to use COMMON ANODE.
INPUT - Signal in, pulses to count.
As you can see, now you can use any 7 Segment Led Display. Just connect the pin C CATHODE/C ANODE to the respective signal. The pin SAVE COUNT can be used to save the count and power off the circuit. When you power on the circuit, the display will resume the counting.
An example how to use it using common cathode displays, no resume count on power up and free runing:
Every time when you turn ON the circuit, will display 0000. Each pulse in the INPUT pin will increase the count. You can replace the switch with a LDR, reed switch or any kind of sensor.
Use RED displays for better performance, Green displays may need 5.5 volts.
6/16/06 Update:
You can use this counter with one, two, three or four digits, just remove the displays that doesn't need to be used. Also, you can use transistors to increase the current for each display. Here is an example of a 2-digits counter using transistors:
The displays are connected in parallel, each segment is connected to the same pin, that means the segment 'A' is connected to all 'A' segments, 'B' to all 'B' segments and so on.
Please note when you use transistors for this circuit, you need to define the right display type (pin 3).
07/26/09 - 01:43:49 George from Greece wrote: It works fine with 16F628A. Just use the below config as Jose Pino said before: PIC CONFIG: INT RC I/O, Watchdog DISABLED, PowerUp Timer DISABLED, Master Clear Reset ENABLE, Brown Out ENABLE, LVP DISABLED, Data Read Protect OFF, Code Protect OFF. Nice job Jose. Keep going...
07/26/09 - 01:45:01 Rob from Florida wrote: Works Great! I had to increase supply voltage to 4.1V, did not work at 3V. Next I will add a 555 oneshot to narrow the pulse to pin 4 to shorten the "blackout" time where display turns off. Then I will run at 5V with a few resistors on the cathodes to keep the current down to 20mA on each LED. Thanks for publishing plans. Wish I had the source though, to make changes. Rob
07/26/09 - 01:46:42 Bill Sherman from Hayward, Ca wrote: A question to Jose. Is it true that every time a pulse is counted, the code does a write to the data EEPROM? If so, the life time of the pic may only be limited to 10,000 to 100,000 erase/write cycles before the memory gets "worn down" and fails to count.
07/26/09 - 01:50:09 José Pino wrote: Unfortunately, that is correct. Each pulse is saved in the EEPROM DATA area ONLY when "SAVE COUNT" {connecting the pin 2 to positive +) is enabled. So, it will work without any problems when it is used for low-speed counting, like Coin Counter. DON NOT enable SAVE COUNT for hi-speed counting like a motor. Connecting the counter to a 5,000 RPM motor, it will have a 20 minutes lifetime.
08/06/09 - 02:21:41 Colin from New Zealand wrote: Keep up the great works!
08/12/09 - 23:25:45 José Pino wrote: Update: I just found that newer PICs (like 16F84A) have a longer "erase/write cycles life". Microchip indicates: Special Microcontroller Features: • 10,000 erase/write cycles Enhanced FLASH Program memory typical • 10,000,000 typical erase/write cycles EEPROM Data memory typical
08/28/09 - 00:45:20 mohamed from egypt wrote: pls how i can change the program to increament the counter every two pulses from switch instead of one pulse
08/29/09 - 15:37:11 Jeme from sanaashami@yahoo.com wrote: Can we use it as frequency counter
08/29/09 - 17:59:10 José Pino wrote: No.
10/31/09 - 00:46:46 Pedro from Portugal wrote: Can i use two JP6281 so that i can count until 20000? And if it possible how do i do it, thks.
10/31/09 - 00:56:20 José Pino wrote: Sorry, it is not possible. It only counts up to 9999.
11/10/09 - 03:10:14 Jorge Adrian from Argentina wrote: Hi, I want to connect a phototransistor for the pulse. Haw I do it?? sorry for my english.
11/18/09 - 02:07:26 Pedro from Portugal wrote: Can we connect this to a computer software so that we can see and store the information from the counter? I would like also to count until 20000.
11/18/09 - 03:28:52 José Pino wrote: Sorry, it cannot be connected to a computer neither increase the counting.
11/18/09 - 03:49:49 Pedro from Portugal wrote: I was trying to built this on proteus but it gave me errors from the hex file, any tip?