CD4543 - BCD to 7 Segment Decoder IC
The CD4543 is a BCD (Binary Coded Decimal) to 7-segment decoder/driver integrated circuit (IC) designed to drive common-cathode 7-segment displays. It can be used to display decimal digits, letters, and special characters. The CD4543 is a popular choice for many digital display applications, including clocks, timers, and metering devices.
The CD4543 has 16 pins, with the following pinout:
Pins 1-4: BCD input (A, B, C, D)
Pin 5: Lamp Test (LT)
Pin 6: Blank Input (BI)
Pin 7: Ripple Blanking Input (RBI)
Pin 8: Ripple Blanking Output (RBO)
Pins 9-15: 7-segment output (a, b, c, d, e, f, g)
Pin 16: VCC (Supply Voltage)
The CD4543 takes a 4-bit BCD input and decodes it to drive a 7-segment display. The IC can be used in either a common-cathode or common-anode configuration. The Lamp Test input (LT) is used to test the display for faulty segments, while the Blank Input (BI) can be used to blank the display. The Ripple Blanking Input (RBI) and Ripple Blanking Output (RBO) are used to connect multiple displays in a ripple-blanking configuration.
### Example 1: Counter Display using Arduino
In this example, we'll use an Arduino board to display a counter value on a 7-segment display using the CD4543.
Arduino Uno board
CD4543 IC
Common-cathode 7-segment display
Breadboard and jumper wires
```c
const int clockPin = 2; // Clock input pin
const int dataPin = 3; // Data input pin
const int latchPin = 4; // Latch input pin
void setup() {
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(latchPin, OUTPUT);
}
void loop() {
// Increment counter value
counter++;
// Convert counter value to BCD
int bcd[4];
bcd[0] = (counter >> 3) & 0x01;
bcd[1] = (counter >> 2) & 0x01;
bcd[2] = (counter >> 1) & 0x01;
bcd[3] = counter & 0x01;
// Send BCD data to CD4543
digitalWrite(latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, bcd[0]);
shiftOut(dataPin, clockPin, MSBFIRST, bcd[1]);
shiftOut(dataPin, clockPin, MSBFIRST, bcd[2]);
shiftOut(dataPin, clockPin, MSBFIRST, bcd[3]);
digitalWrite(latchPin, HIGH);
// Wait for 1 second before incrementing counter again
delay(1000);
}
```
### Example 2: Digital Clock using Raspberry Pi
In this example, we'll use a Raspberry Pi to display the current time on a 7-segment display using the CD4543.
Raspberry Pi board
CD4543 IC
Common-cathode 7-segment display
Breadboard and jumper wires
```python
import time
import RPi.GPIO as GPIO
# Set up GPIO mode
GPIO.setmode(GPIO.BCM)
# Define GPIO pins for CD4543 inputs
A_PIN = 17
B_PIN = 23
C_PIN = 24
D_PIN = 25
# Set up GPIO pins as outputs
GPIO.setup(A_PIN, GPIO.OUT)
GPIO.setup(B_PIN, GPIO.OUT)
GPIO.setup(C_PIN, GPIO.OUT)
GPIO.setup(D_PIN, GPIO.OUT)
while True:
# Get current time
current_time = time.localtime()
hours = current_time.tm_hour
minutes = current_time.tm_min
seconds = current_time.tm_sec
# Convert time to BCD
bcd_hours = [((hours / 10) >> 3) & 0x01, ((hours / 10) >> 2) & 0x01, ((hours / 10) >> 1) & 0x01, (hours / 10) & 0x01]
bcd_minutes = [(minutes / 10) >> 3) & 0x01, ((minutes / 10) >> 2) & 0x01, ((minutes / 10) >> 1) & 0x01, (minutes / 10) & 0x01]
bcd_seconds = [(seconds / 10) >> 3) & 0x01, ((seconds / 10) >> 2) & 0x01, ((seconds / 10) >> 1) & 0x01, (seconds / 10) & 0x01]
# Send BCD data to CD4543
GPIO.output(A_PIN, bcd_hours[0])
GPIO.output(B_PIN, bcd_hours[1])
GPIO.output(C_PIN, bcd_hours[2])
GPIO.output(D_PIN, bcd_hours[3])
# Wait for 1 second before updating display again
time.sleep(1)
```
Note: These examples are for illustrative purposes only and may require additional hardware and software setup.