IC – 74HC165 – Shift register input 8-bit

Hardware

BESTELLEN

Informatie (eng)

General Description
The 74HC165 is an 8-bit serial-in shift register. It uses only 4 Arduino pins, while itself can read in from 8 digital pins. If the parallel load pin (PL) is LOW, the data is read from the A to H pins in parallel. When PL is HIGH, the Q pin is set to the value of the first bit. Each time you change the value from your clock pin from LOW to HIGH, the next bit is send to the Q pin. Therefore you can read in all 8 bits sequentially. Furthermore you can daisy-chain several shift registers, while still using only 4 Arduino pins!

Pinout

Arduino

Sluit de IC aan volgens onderstaand overzicht:


Met onderstaand arduino script kun je de chip uitlezen:

Bron(nen):
infectedbytes.com

Aansluiten van meerdere IC’s (pin 10 aansluiten op volgende IC pin 9):

Voorbeeld schemavorm:

Arduino Library

ArduinoShiftIn

This is a small library for reading in values from a 74HC165 8 bit shift register.

The Arduino has only a limited amount of pins, therefore it might happen that you run out of pins. For this case, the 74HC165 comes to the rescue. It is an 8 bit shift register. It allows you to read in 8 values by only using 4 pins on your Arduino. Furthermore you can daisy-chain several shift registers by still only using 4 Arduino Pins.

Usage

If you have installed this library, you can include it by navigating to Sketch > Include Library > ShiftIn. This will add the line #include <ShiftIn.h> to your sketch (of course you could also write this line manually).

Now you can actually use this library:

API

Depending on the number of chips, this library will use different data types. If you are only using one chip, the type ShiftType will be an unsigned byte (uint8_t). For two chips it will be an unsigned int (uint16_t). For three and four chips it will be an unsigned long (uint32_t) and for 5 to 8 chips it will be an unsigned long long (uint64_t). More than eight chips are not supported yet.

This function must be called in the setup function. It is used to tell the library the pins it should use.

Gets/sets the delay time for the clock pin (in microseconds). This value defaults to 5 and in most cases there’s no need to change it.

Returns the number of buttons (bits in the state)

Returns true if any button has changed its state during the last frame.

Returns the complete state for this frame / last frame

Returns the state of a single button for this frame / last frame

Whether button i is just pressed/released

This function (or the update function) should be called each frame exactly once. It will read in all values from the shift registers and it will return the new state.

This function is basically the same as the read function, but it will return true if some button has changed its state and false otherwise

Download @ github.com/InfectedBytes/ArduinoShiftIn

Afmetingen

GEEN GEGEVENS

Schema

GEEN GEGEVENS

Teardown

GEEN GEGEVENS

Datasheet

Fritzing

GEEN GEGEVENS

Downloads

GEEN GEGEVENS