Wednesday, February 14, 2007

Datasheet Report: 8-Bit Shift Register


img pulled off of sparkfun electronics

Today I'm looking at the datasheet of a Texas Instruments SN74HC595 8-bit shift register with 3-state output registers.

Download Datasheet

Features
* 8-Bit Serial-In, Parallel-Out Shift
* Voltage operating range of 2V - 6V
* Low power consumption (80µA)
* Low input current of 1 µA max.
* High-Current 3-State outputs which can drive up to 15 LSTTL loads
(btw, LSTTL stands for "Low-power Schottky" Transistor to Transistor Logic, TTL being a kind of solid state logic)
* Shift register has direct clear

The below diagram shows the pin mappings for this chip, depending on which package you are using:



What does it do?
So, what does an 8-bit shift register do? It's commonly used to increase the output capacity of a microcontroller. Data is shifted down along 8 pins (or more, depending on what kind of shift register you get), and passed out through each pin, expanding the number of possible output pins available to your microcontroller. This is also called 'multiplexing' a signal.

How to Connect
At a minimum, three pins of your microcontroller are required to connect to the 8-bit shift register: one for the clear pin (SRCLR), one for the clock pin (which controls the frequency at which signals are transmitted) (RCLK and SRCLK: these can be connected together or independently), and one for the data you are looking to send through the register, i.e., the input pin (OE).

The clear pin, when set to low, clears all the pins on the shift register of their current state (high/low), and when set to high, allows the pins to receive input from your microcontroller. Because this shift register has a D-type storage register built into it, this means that once you set the pins high or low, they retain that state. Therefore, the clear pin is necessary in order to literally 'clear' the current states of the shift register pins.

In order to get the input signals into the shift register, you must PWM (pulse width modulate) a clock signal for 8 cycles, or however many bits your shift register is designed to carry. Most shift registers use 'synchronus' communication, meaning that the rate at which signals are sent to the IC, rely on the clock signal of the microcontroller, which is transmitted via the RCLK and SRCLK pins.



The shift and storage registers each have their own clocks. When connected together, the shift register is always one clock pulse ahead of the storage register. I'm guessing this is so to keep the data moving ahead in order to make room for the next signal coming down the pipe.

Saturday, February 10, 2007

Sensors and Time


sensorGraph
Originally uploaded by 0x000000.
I built a little visualisation tool, using processing, for graphing sensor activity. In this case, I was specifically looking at a photocell. The nature of the data being sensed, in this case, light, informed the way I chose to display the data.

There are three parameters being graphed here: raw data, averaged readings, and the standard deviation between readings.

The circuit is really simple. It's just a photocell hooked up to an arduino board analog in pin. My arduino board communicates serially to my processing app, which then displays the data accordingly.

Download my code here: arduino | processing