Project Description
Main Project Image
The project owner hasn't added main project image yet.
Project description
This board connects to an 8-bit 5V bus and converts the digital bus value to seven segment hexadecimal display in software on the microcontroller.
On my Arduino, the software is
// The lookup table converts the four-bit input to the seven segment display. The MSB is segment a and the LSB is segment f.
char lookup_table[16] = {0x7E, 0x30, 0x6D, 0x79, 0x33, 0x5B, 0x5F, 0x70, 0x7F, 0x7B, 0x77, 0x1F, 0x0D, 0x3D, 0x4F, 0x47};
void setup() {
DDRB = B00000000; // 8 bit input (digit 1 high nybble, digit 2 low nybble)
PORTB = B11111111; // With pull up resistors
DDRD = B11111111; // Outputs for digit 1 (a-f MSB to LSB) and segment a digit 2 (LSB)
DDRC = B00111111; // Remaining 6 segments of digit 2 (b-f)
}
void loop() {
int digit1_in = (PINB & 0xF0) >> 4;
int digit2_in = (PINB & 0x0F);
int digit2_segments = lookup_table[digit2_in];
PORTD = (lookup_table[digit1_in] << 1 & 0xFE) + ((digit2_segments & 0x7F) >> 6);
PORTC = digit2_segments & 0x3F;
}
Gallery
The project owner hasn't added any images yet.
Design Files
Embed Code
Component (8)
Qty
Description
Resistor
R14, R9, R1, R6, R3, R15, R13, R5, R8, R10, R2, R4, R12, R11, R7
15
Generic Resistor (330)
Capacitor
C2
1
Generic Capacitor (1µF)
AVR ISP Surface Mount
J2
1
No description
Capacitor
C1
1
Generic Capacitor (1µF)