Editor Version ×
recommended

Pro Edition

free

Brand new interactions and interfaces

Smooth support for design sizes of over 3W

devices or 10W pads

More rigorous design constraints, more

standardized processes

For enterprises, more professional users

Std Edition

Easy to use and quick to get started

The process supports design scales of 300

devices or 1000 pads

Supports simple circuit simulation

For students, teachers, creators

Ongoing

STD Frequency counter with PIC16F628A Circuit

Frequency counter with PIC16F628A Circuit

Project tags

License

License:

Mode:

Mode

Editors' pick

Editors' pick

  • 7.1k
  • 0
  • 1
Update time: 2021-04-12 01:26:19
Creation time: 2015-08-06 09:12:12
Description

Description

From:http://www.electronics-lab.com/project/frequency-counter-with-pic16f628a/ This is a frequency counter based on PIC16F628A. The original idea came from this project:LCD frequency counter. As you can see – very simple and yet elegant schematic. But I wanted to use 7-segment LED display, not LCD, so I found a second useful project: Simple 100MHz frequency counter which uses 6 digit LED display. Schematic Combining two projects into one wasn’t very easy. First of all I wanted a PIC microcontroller to do the whole job without any additional ICs. Also I wanted to use the the familiar 16F628A, but because one of the portA pins (RA5) can be used only as input I was short of outputs to do the job. Driving 6 digit 7-segment multiplexed display requires 7 + 6 = 13 outputs. The 16F628A has 16 IO pins, two of which are used for the crystal oscillator, one is for the signal input and other one can be used only for input, that leaves us with only 12 useful IO pins. The solution was to drive one of the common cathodes with a transistor, which opens when all other digits are switched off. 7-segment displays used here are 3 digit multiplexed common cathode type (BC56-12SRWA). Digits 2..5 are switched on when respective pins are set low. When all these pins are high, the transistor Q1 opens and switches on the first digit. The current for each segment is about 6-7mA. I must mention that pins connected to common cathodes theoretically may sink up to 50mA if all segments are light up (7x7mA). This is way above max specifications of the microcontroller. But as every digit is switched on for very brief moment I think it is safe. The whole schematic consumes around 30-40mA in average and the microcontroller is not heating at all, so everything seems OK. The microcontroller uses its internal 4MHz oscillator for the CPU clock. Timer1 uses external crystal oscillator with frequency 32768Hz for setting the 1 second time interval. Timer0 is used to count the input signal at pin RA4. And finally, Timer2 is used for cycling and refreshing the digits. As the input signal will be 5Vpp square wave there isn’t any preamp or buffer in the front. The counter can measure up to 920-930kHz which is more than enough for my project. The reason why it can’t go higher is because driving all these digits consumes lots of CPU cycles. I suppose, the program code can be optimized or even written in assembler and then the counter can reach 999999 Hz. The crystals for 32768Hz are sold in two sizes : 2x6mm and 3x8mm. I recommend 2x6mm because it fits perfectly below the left display. The other size also can be used but it will lift a little the left display.
Design Drawing

Design Drawing

schematic diagram
1 /
PCB
1 /
The preview image was not generated, please save it again in the editor.
ID Name Designator Footprint Quantity
1 PIC16F628A IC1 SOP-18 1
2 1k R2 R1206 1
3 HEADER_2_HEADER_2 X2,X1 HDR1X2 2
4 HEADER_6 JP1 HDR1X7 1
5 10k R1,R10 R1206 2
6 47P C4,C5 C1206 2
7 7805DT U3 TO252 1
8 10uF/25V C1,C2 3528 2
9 100nF C3 C1206 1
10 BC56-12 LED1,LED2 7SSEG-3aa 2
11 BAT42 D1,D2,D3,D4,D5 1206D 5
12 BC847b Q1 SOT23-3 1
13 1N4148 D6 1206D 1
14 330 R3,R4,R5,R6,R7,R8,R9 R1206 7
15 32.768 HZ XTAL1 TC-26 1

Unfold

Project Attachments

Project Attachments

Empty
Project Members

Project Members

Target complaint
Related Projects
Change a batch
Loading...

Comment

Add to album ×

Loading...

reminder ×

Do you need to add this project to the album?

服务时间

周一至周五 9:00~18:00
  • 0755 - 2382 4495
  • 153 6159 2675

服务时间

周一至周五 9:00~18:00
  • 立创EDA微信号

    easyeda

  • QQ交流群

    664186054

  • 立创EDA公众号

    lceda-cn