![]() Pretty easy □ Processor Expert Component * send a latch pulse to show the data on the output pins */įor the above pins (DS1, SHCP1 and STCP1) I can use normal GPIO pins in output mode. To latch the bits to the output pins, the Latch() method is using the STCP (Store Clock Pin/Latch): ![]() So I can use several times the ShiftByte() method if I have chained shift registers. The method ShiftByte() only shifts the 8bits, and does not latch them to to the output pins. The macro HC595_SHIFT_MSB_FIRST is used to either shift in the most significant bit first or the least significant one first. * precondition: latch pin, data pin and clock pin are all low */ The following source demonstrates how to shift a byte into the shift register: DIR_EN (Device Enable)/OE => Arduino Header D7 => KL25Z pin 66 => CMP0_IN3/ PTC9/I2C0_SDA/TPM0_CH5.DIR_LATCH (Latch clock)/STCP: => Arduino Header D12 => KL25Z pin 76 => PTD3/SPI0_MISO/UART2_TX/TPM0_CH3/SPI0_MOSI.DIR_CLK (Shift Clock)/SHCP => Arduino Header D4 => KL25Z pin 30 => TSI0_CH5/ PTA4/I2C1_SDA/TPM0_CH1/NMI_b.DIR_SER (Serial Input Pin)/DS => Arduino Header D8 => KL25Z pin 33 => PTA13/TPM1_CH1.The shift register is connected as below to the FRDM-KL25Z board, as defined by the pin mappings of the shield: If I have the devices chained, then the D7 bit would be shifted into the next device through the ‘chain’ pin. It is that device in the middle of the shield: Such a 74HC595 is used on the Arduino Motor/Stepper/Servo Shield introduced in this post. 74HC595 on the Arduino Motor/Stepper/Servo Shield In this article I’m using just one device, but it is really easy to chain multiple 74HC595. An excellent tutorial how to use it to drive 16 LEDs (or more) can be found in this article. I can chain multiple 74HC595, and then I get 8, 16, 24, etc output pins. Using this pin, multiple 74HC595 devices can be chained. This pin is sometimes named ST_CP (Store Clock Pulse). RCLK: Clock to store or latch the shift register content in the device.Sometimes this pin is named SH_CP (Shift Clock Pulse) SRCLK: Serial clock, to shift in the data from the SER pin.Sometimes this pin is named SD (Serial Data). Using this pin, data gets shifted into the device. SN74HC594 Package (Source: Texas Instrument SN54HC595 data sheet)īasically, the device has a serial input pin, two clock pins (one to shift the serial data, and one to latch the data to the output pins, plus 8 output pins):
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |