Electronic components

  • 74HC164 8-bit serial-in parallel-out shift register
  • 74HC165 8-bit parallel-in serial-out shift register
  • 74HC595 8-bit latching serial-in parallel-out shift register
  • HD44780 16x2 character LCD screen controller
  • ATtiny85
  • ATmega328

74HC164

The 74HC164 is an 8-bit serial-in parallel-out shift register. Set input pin A, clock the CLK pin, and the input bit will shift into the output pin array starting from Q_A.

Notes

  • Inputs A and B are AND-gated, so both must be high in order for input to be high. You’ll normally just want to hardwire B high.
  • ~CLR acts as a reset pin, bringing it low will set all outputs low.
  • Clocking occurs on the low-to-high transition of CLK.
  • Data shifts into parallel outputs in alphabet order, starting from Q_A.
  • Chain multiple chips together by linking Q_F of the first chip to A of the next, and connecting all sets of V_CC, GND, ~CLR, and CLK pins.

Pinout

Pin Label Description
1 A Gated serial input 1
2 B Gated serial input 2
3 Q_A Parallel output
4 Q_B Parallel output
5 Q_C Parallel output
6 Q_D Parallel output
7 GND Ground
8 CLK Clock
9 ~CLR Clear (active low)
10 Q_E Parallel output
11 Q_F Parallel output
12 Q_G Parallel output
13 Q_H Parallel output
14 V_CC Power

Characteristics

Characteristic Value
Max. input current 1μA
Max. operating current 80μA
Max. output pin drive current 4mA
Input voltage 2V to 6V

74HC165

The 74HC165 is an 8-bit parallel-in serial-out shift register. Set input pins A through H and pull SH/~LD low to load data into the chip. To read this data, pull SH/~LD high and clock the CLK pin eight times, reading each bit from Q_H in reverse alphabet order.

Notes

  • Clocking occurs on the low-to-high transition of CLK while SH/~LD is high and CLK INH is low.
  • Data shifts into serial outputs in reverse alphabet order, starting from H.
  • Chain multiple chips together by linking Q_H of the first chip to SER of the next, and connecting all sets of V_CC, GND, and CLK pins.

Pinout

Pin Label Description
1 SH/~LD Shift or load data
2 CLK Clock
3 E Parallel input
4 F Parallel input
5 G Parallel input
6 H Parallel input
7 ~Q_H Serial output (complimentary)
8 GND Ground
9 Q_H Serial output
10 SER Serial input
11 A Parallel input
12 B Parallel input
13 C Parallel input
14 D Parallel input
15 CLK INH Clock inhibit
16 V_CC Power

Characteristics

Characteristic Value
Max. input current 1μA
Max. operating current 80μA
Max. output pin drive current 4mA
Input voltage 2V to 6V

74HC595

The 74HC595 is an 8-bit latching serial-in parallel-out shift register. Set input pin SER and clock the SRCLK pin eight times to load data into the shift register, and then clock the RCLK pin to latch the shift register data into the storage register.

Notes

  • Clocking occurs on the low-to-high transistion of SRCLK and RCLK.
  • When the ~OE pin is low, the parallel output pins temporarily enter a high-impedance disabled state.
  • Pulling the ~SRCLR pin low will clear the shift register.
  • Clocking the SRCLK pin will shift data from SER into the shift register in alphabet order, starting from Q_A.
  • Clocking the RCLK pin will copy shift register data into the storage register.
  • Chain multiple chips together by linking Q_H' of the first chip to SER of the next, and connecting all sets of V_CC, GND, SRCLK, ~SRCLR, RCLK, and ~OE pins.

Pinout

Pin Label Description
1 Q_B Storage register parallel output
2 Q_C Storage register parallel output
3 Q_D Storage register parallel output
4 Q_E Storage register parallel output
5 Q_F Storage register parallel output
6 Q_G Storage register parallel output
7 Q_H Storage register parallel output
8 GND Ground
9 Q_H' Shift register serial output
10 ~SRCLR Shift register clear (active low)
11 SRCLK Shift register clock
12 RCLK Storage register clock
13 ~OE Output enable (active low)
14 SER Shift register serial input
15 Q_A Storage register parallel output
16 V_CC Power

Characteristics

Characteristic Value
Max. input current 1μA
Max. operating current 80μA
Max. output pin drive current 4mA
Input voltage 2-6V

HD44780

Notes

  • In 4-bit mode, D7-D4 are clocked twice.

Commands

RS/RW Command Description
0b 00 0b 0000 0001 Clear display, cursor to zero
0b 00 0b 0000 001- Cursor to zero, unshift screen
0b 00 0b 0000 01DS Cursor dir (0=dec, 1=inc), display shift (0=no, 1=yes)
0b 00 0b 0000 1DCB Turn off/on the display, cursor, and cursor blink
0b 00 0b 0001 MD-- Move (0=cursor, 1=display), shift dir (0=left, 1=right)
0b 00 0b 001L NF-- Set data length, line count (0=1, 1=2), character font.
0b 00 0b 01AA AAAA Set CGRAM address.
0b 00 0b 1AAA AAAA Set DDRAM address.
0b 01 0b BAAA AAAA Read busy flag and CGRAM/DDRAM address.
0b 10 0b DDDD DDDD Write data to CGRAM/DDRAM.
0b 11 0b DDDD DDDD Read data from CGRAM/DDRAM.

Pinout

Pin Label Description
1 GND Ground
2 V_CC Power supply (3.3V)
3 V0 Contrast adjustment (analog)
4 RS Register select (0=command, 1=data)
5 MODE Read/write mode (0=write, 1=read)
6 CE Clock enable
7 DB0 Data bit 0 (used for 8-bit only)
8 DB1 Data bit 1 (used for 8-bit only)
9 DB2 Data bit 2 (used for 8-bit only)
10 DB3 Data bit 3 (used for 8-bit only)
11 DB4 Data bit 4
12 DB5 Data bit 5
13 DB6 Data bit 6
14 DB7 Data bit 7
15 LED+ Backlight anode
16 LED- Backlight cathode

Characteristics

Characteristic Value
Input voltage 2.7-5.5V

ATtiny85

The ATtiny85 belongs to a family of three microcontrollers, suffixed 25, 45, and 85.

Notes

  • The LPM instruction can access program flash indirectly, for static data.
  • ‘Data’ memory represents the entire SRAM address space. ‘IO’ memory represents just the IO range within SRAM.

Pinout

Memory

Memory ‘25 ‘45 ‘85
Flash 2K 4K 8K
SRAM 128 256 512
EEPROM 128 256 512

SRAM:

  • 0x0000–0x001F
    32 ALU registers
  • 0x0020–0x005F
    64 I/O registers
  • 0x0060–0x025F
    512 bytes of SRAM

Characteristics

Characteristic Value
Max clock freq. @ 2.7-5.5V 10MHz
Max clock freq. @ 4.5-5.5V 20MHz

Header pins

Pitch 2.54mm
Height (total) 11.54mm
Height (base) 3mm
Height (pin) 6mm
Pin thickness 0.64mm

ATmega328

See ATmega328.

Notes

  • “Connecting unused pins directly to VCC or GND is not recommended, since this may cause excessive currents if the pin is accidentally configured as an output.”