4017 Pinout Configuration
The 4017 comes in a 16-pin DIP (Dual Inline Package). Here is the pinout configuration:
Pin | Name | Description |
---|---|---|
1 | Q5 | Output 5 |
2 | Q1 | Output 1 |
3 | Q0 | Output 0 |
4 | Q2 | Output 2 |
5 | Q6 | Output 6 |
6 | Q7 | Output 7 |
7 | Q3 | Output 3 |
8 | GND | Ground |
9 | Q8 | Output 8 |
10 | Q4 | Output 4 |
11 | Q9 | Output 9 |
12 | CARRY OUT | Carry Out (CO) |
13 | CLOCK ENABLE | Clock Enable (CE) |
14 | CLOCK | Clock Input |
15 | RESET | Master Reset (MR) |
16 | VDD | Positive Supply |
The 4017 has ten decoded outputs (Q0 to Q9), a clock input, a clock enable input, a master reset input, and a carry out output. Let’s go over what each of these pins do:
Decoded Outputs (Q0-Q9)
The 4017 has ten outputs, labeled Q0 through Q9. On each clock pulse, one of these outputs will go HIGH while the others remain LOW. Only one output is HIGH at any given time.
The sequence starts with Q0 and progresses to the next output on each clock pulse. After Q9, it wraps back around to Q0 on the next clock pulse.
Clock Input (CLOCK)
The clock input advances the 4017 to the next state (output) on the rising edge of each pulse. The 4017 can reliably count clock frequencies up to 5-6 MHz.
Clock Enable (CE)
The clock enable input must be held LOW for the clock pulses to be counted. If CE is HIGH, clock pulses are ignored and the 4017 maintains its current state. This allows you to pause the counting sequence.
Master Reset (MR)
The master reset input sets the 4017 back to its initial state (Q0 HIGH) when pulsed HIGH, regardless of the current state. MR overrides the clock enable input.
Carry Out (CO)
The carry out pin generates a HIGH pulse for one clock cycle every time the counting sequence completes a full cycle (after Q9 and before resetting to Q0). This is useful for cascading multiple 4017s to count higher than 10.
4017 Logic Diagram
Here is a simplified logic diagram showing the internal workings of the 4017:
+-----------+
CLOCK --->| |
| |
CE --->| Counter |--+---> Q0
| Divider | |
MR --->| | +---> Q1
| | |
+-----------+ +---> Q2
|
:
:
|
+---> Q9
|
+---> CO
Internally, the 4017 is implemented as a 5-stage Johnson counter with 10 decoded outputs. The Johnson counter is a shift register variant where the inverted output of the last stage is fed back into the first stage’s input. This creates a unique sequence of 5-bit codes that can be decoded into ten individual outputs.
Configuring the 4017
The 4017’s behavior can be configured in a few different ways depending on how the clock enable (CE), master reset (MR), and carry out (CO) pins are connected.
Basic Decade Counter/Divider
The most basic configuration is to use the 4017 as a decade counter that divides the input clock frequency by 10. Here’s how to wire it up:
- Connect the clock signal to the CLOCK pin
- Connect CE and MR to GND to permanently enable counting
- Leave CO unconnected
- Use Q0-Q9 as needed for your application
In this mode, the 4017 will continuously cycle through the ten outputs, with each output going HIGH for 1/10th of the input clock period.
Controlled Decade Counter/Divider
If you need to start and stop the counting sequence on demand, you can control the 4017 with the CE pin:
- Connect the clock signal to the CLOCK pin
- Connect MR to GND
- Connect CE to a control signal
- Leave CO unconnected
- Use Q0-Q9 as needed
Now the 4017 will only count when the control signal connected to CE is LOW. You can use this to sync the 4017 to other parts of your circuit.
Cascaded Counters
For counting sequences longer than 10 states, you can cascade multiple 4017s together:
- Connect the clock signal to the first 4017’s CLOCK pin
- Connect the first 4017’s CO to the second 4017’s CLOCK pin
- Connect the second 4017’s CO to the third 4017’s CLOCK pin (if needed)
- Continue chaining as many 4017s as required
- Connect all the CE and MR pins to GND
- Use the Q outputs of each 4017 as needed
Each successive 4017 will increment once for every full counting cycle of the previous 4017. For example, with two cascaded 4017s you can count up to 100 before the sequence repeats.
Example 4017 Applications
The 4017’s ability to convert a clock signal into a sequential pattern of discrete outputs lends itself to many useful applications. Here are a few examples:
LED Sequencer
You can use the 4017 to create an LED light chaser or sequencer:
- Wire up the 4017 in the basic counter configuration
- Connect each Q output to an LED (and appropriate current limiting resistor)
The LEDs will light up in sequence according to the 4017’s counting pattern. You can adjust the input clock frequency to change the chaser speed.
Stepper Motor Driver
The 4017 can generate the coil driving sequence for a Unipolar Stepper motor:
- Wire up the 4017 in the controlled counter configuration
- Connect four consecutive Q outputs (e.g. Q0-Q3) to the bases of four driver transistors
- Connect each transistor’s collector to one of the stepper motor coils
- Use the CE pin to step the motor on demand
Each clock pulse will make the motor advance one step. The direction can be reversed by using Q9-Q6 instead.
Frequency Divider
Because the 4017 divides the input clock frequency by a factor of ten, it is useful as a frequency divider for digital synthesizers and clock generators.
- Wire up the 4017 in the basic counter configuration
- Feed a high frequency clock signal into the CLOCK pin
- Use the Q outputs as different sub-octaves of the input frequency
For example, if the input is 1 MHz, Q0 will output 100 kHz, Q1 will output 10 kHz, and so on. Multiple 4017s can be cascaded for greater frequency division ratios.
FAQ
Q: What is the maximum clock frequency the 4017 can handle?
A: The 4017 can reliably operate with clock frequencies up to 5-6 MHz. Beyond that, the output switching times may be too slow to keep up.
Q: Can the 4017 count in reverse?
A: Not directly, since the internal counter always advances in the same direction. However, you can achieve reverse counting by using the Q outputs in reverse order (Q9-Q0 instead of Q0-Q9).
Q: Is the 4017 still manufactured?
A: Yes, the 4017 is still widely available from many semiconductor manufacturers including ON Semiconductor, Texas Instruments, Nexperia, and others. It remains popular for its simplicity and versatility.
Q: Can the 4017 be used to drive high power loads?
A: No, the 4017’s outputs are not designed to supply large currents. To drive high power loads, use the 4017’s outputs to switch power transistors or other driver circuits.
Q: What does the 4017’s “Johnson counter” circuit mean?
A: A Johnson counter, also known as a twisted ring counter, is a special shift register configuration where the inverted output of the last stage feeds back into the input of the first stage. This makes the register cycle through a specific sequence of bit patterns. The 4017 internally uses a 5-stage Johnson counter to generate the patterns that are then decoded into the ten output lines.
I hope this in-depth exploration of the 4017 decade counter IC has been informative and useful! Let me know if you have any other questions.
Leave a Reply