Download The Electronisc Projects

Monday, October 17, 2011

Shift Register 74HC595 Tutorials

I am here providing a simple and very good tutorials for Shift register 74HC595


Basically a shift register will, in the end, let you expand on the digital outputs you have on your mictrocontroller. Each one of these 74HC595s can act like 8 more digital outputs, and you can daisy chain them. So you could hook 8 of them up next to each other and have control of 64 outputs.
But the way it works is a little confusing to think of at first, and these are helpful enough that it is really worth understanding what the heck is going on under the hood.
You can imagine a shift register as a row of chairs. In this particular case, with the 74HC595, we have a row of 8 chairs. Each chair is either empty (0), or someone is sitting it (1).
Now, every 10 seconds or so, someone rings a bell, and everyone has to get up and move one chair to the right. If there was someone in that rightmost chair, well they just go away. In that leftmost chair, you can either tell someone to sit in it, or just leave it empty.
Now bringing this idea back to the 74HC595: This shift register consists of 8 output pins, which are either high (1) or low (0). When you pull the SRCLK (Serial Clock) pin high (analogy to ringing the bell), every pin moves one to the right. The Last pin drops out, and the new pin’s state is defined by the SER (Serial) pin, and you can set that to either 1 (HIGH) or 0 (LOW).
How does this let me control LEDs again? Well, say you have 8 LEDs hooked up to the shift registers outputs, and we want to turn on the 1st, 3rd and the 8th LED. So… what we can do is clear out the register so all LEDs are off. Then we put in one high, move it right 4 spots, add one high, move it over 1, then add another high. See the image on the right, it will make more sense.
The great thing is that the shift register has this pin called RCLK or register clock. You can hold this pin LOW while you get everything setup and nothing on the display pins will change. Then when you are done, and everything is how you want, you pull the RCLK HIGH and the 74HC595 will display the new settings. So even though we are changing values in the register in 8 steps, it looks like it was just one step.

operation of 74HC595

Set MR=1
Set OE=0
Set STCP=0
Set SHCP=0

Give to DS the value of D7
toggle SHCP (to 1 and back to 0)
Give to DS the value of D6
toggle SHCP (to 1 and back to 0)
....
Give to DS the value of D0
toggle SHCP (to 1 and back to 0)
toggle STCP (to 1 and back to 0) to see the data in the output

SHCP shifts the data without changing the output state, when you are done shifting you toggle STCP to output the result




2.2. How to drive it

The circuit description covers use of the 74HC595. Use of the 74HC4094 (which may be cheaper and easier to find) is covered later in this document. First the strobe line is dipped low and back high again. This latches all the inputs into the 74HC165 input shift registers. Then the clocking begins. With each clock pulse, the data line is set to an output, and the appropriate data bit is presented on the line to be clocked into the output shift register. On the same clock pulse, the input shift register presents its next data bit to the microcontroller data pin. The data pin is set to an input, and this data bit read.
The number of clock pulses required is the larger of the number of inputs and the number of outputs. After this number of clock pulses, all the required output states have been shifted into position in the 74HC597 output shift registers, and another dipping of the "strobe" line is performed to set these states on the shift register output pins.
A timing diagram for this operation is shown below:
The points in this diagram are:
  • A: STROBE is pulsed low to latch inputs.
  • B: DATA line is set to an output, and appropriate data placed on it. CLOCK is pulsed high to shift this data bit into the chain, and get next bit from the chain.
  • C: DATA line is set to an input, and the data bit is read from the chain.
  • D: In this example there are more outputs than inputs, so from this point, the rest of the outputs are clocked out.
  • E: This is the rest of the outputs being clocked out.
  • F: Finally, the STROBE line is pulsed again to latch the outputs onto the output shift register output pins.
You can make the chain any length you want, with as many output stages or input stages as required. It may be all input stages, or it may be all output stages too. There are constants in the code where the dimensions of the shift register are defined, and they control how the software drives it.

Sunday, October 16, 2011

Free Ebook For Microcontroller


Introduction to Microcontrollers: Architecture, Programming, and Interfacing for the Motorola 68HC12

Provides a comprehensive introductory text/ reference for electrical and computer engineers, students and even hobbyists who have little experience in high-level programming language. Discusses how a typical microcontroller executes assembler language instruction and addresses models on microprocessors.

Introduction to Microcontrollers is a comprehensive introductory text/reference for electrical and computer engineers, students, and even hobbyists who have little experience in a high-level programming language. The book helps them understand how a typical microcontroller executes assembly language instructions and addressing modes on microprocessors. The book shows how to program with C++ and compile assembly language statements. The book utilizes the new 16-bit microcontroller, the Motorola 68Hc12, as the primary example. This "chip" replaces the very popular 8-bit microcontroller, the 68Hc11, as the leading microprocessor for a wide variety of applications and as a core tool for teaching engineering students. This new microcontroller is expected to be popular in industry because of its low cost per unit, low power consumption, and high processing speed.

* First introductory level book on the Motorola 68HC12
* Teaches engineers how a computer executes instructions
* Shows how a high-level programming language converts to assembly language
* Teaches the reader how a microcontroller is interfaced to the outside world
* Uses hundreds of examples throughout the text
* Over 200 homework problems give the reader in-depth practice
* A CD-ROM with HiWare's professional C++ compiler is included with the book
* A complete summary chapter on other available microcontrollers

Download Link

PIC Microcontroller: An Introduction to Software & Hardware Interfacing

This book presents a thorough introduction to the Microchip PICR microcontroller family, including all of the PIC programming and interfacing for all the peripheral functions. A step-by-step approach to PIC assembly language programming is presented, with tutorials that demonstrate how to use such inherent development tools such as the Integrated Development Environment MPLAB, PIC18 C compiler, the ICD2 in-circuit debugger, and several demo boards. Comprehensive coverage spans the topics of interrupts, timer functions, parallel I/O ports, various serial communications such as USART, SPI, I2C, CAN, A/D converters, and external memory expansion.

About the Author
Han-Way Huang is a Professor in the Department of Electrical and Computer Engineering and Technology at Minnesota State University, Mankato, MN. He is a member of both IEEE and ASEE. Dr. Huang has taught microprocessor applications for more than 15 years and has authored several books on microprocessors.

Password = www.freebookspot.com
Download Link

Microcontrollers: Fundamentals and Applications with PIC

Microcontrollers: Fundamentals and Applications with PIC

While the official documentation provided for the PIC family from Microchip is extensive, it can also be overwhelming. This book gives users the information necessary to understand the architecture and the programming of microcontrollers. Each topic is described using a reader-centered, top-bottom approach. First, the authors describe the concepts that are common to any microcontroller. Each of the topics is then detailed for PIC microcontrollers. Practical applications supplement each topic to provide further clarity. This book does not limit itself to a digital view of microcontrollers. Instead, it includes aspects of analog signals such as the acquisition and processing of external analog signals.

Download Link


Free 8051 Projects


Simply Do The Following Complete projects Of 8051 You only need to register there
Electronic code lock with user defined password using 8051 microcontroller (AT89C51)
How to interface LEDs with 8051 microcontroller (AT89C51)
How to interface 16x2 LCD with 8051 microcontroller (AT89C51)
LCD based digital alarm clock with digital thermometer using 8051 microcontroller (AT89C51)
How to interface computer's Serial Port (RS232) with 8051 microcontroller (AT89C51)
Simple Digital clock using 8051 microcontroller (AT89C51)
Celsius scale digital thermometer using 8051 microcontroller (AT89C51)
Automatic bidirectional visitor counter using 8051 microcontroller (AT89C51)
How to interface RFID with 8051 microcontroller (AT89C51)
How to make an alphabetic keypad using 8051 microcontroller (AT89C51)
Distance measurement using InfraRed sensor with ADC0804 & 8051 microcontroller (AT89C51)
How to interface GSM Module with 8051 microcontroller (AT89C51) using PC
How to interface keypad with 8051 microcontroller (AT89C51)
LCD based voting machine using 8051 microcontroller (AT89C51)
Liquid level alarm using 8051 microcontroller (AT89C51)
LCD based digital clock using 8051 microcontroller (AT89C51)
How to interface seven segment display with 8051 microcontroller (AT89C51)
How to Interface Serial EEPROM 24C02 with 8051 microcontroller (AT89C51)
Simple toll plaza system using low frequency RFID interfaced with 8051 microcontroller (AT89C51)
Digital clock using RTC DS12C887 and 8051 microcontroller (AT89C51) with time set
How to interface ADC0804 using 8051 microcontroller (AT89C51)
How to display text on 16x2 LCD using 8051 microcontroller (AT89C51)
RFID based Secured access system using 8051 microcontroller (AT89C51)
Interfacing GSM Module with 8051 microcontroller (AT89C51) without using PC
Celsius and Fahrenheit scale digital thermometer using 8051 microcontroller (AT89C51)
8 candidate quiz buzzer using 8051 microcontroller (AT89C51)
How to create custom characters on 16x2 LCD using 8051 microcontroller (AT89C51)
Servo Motor control through Keypad using 8051 Microcontroller (AT89C51)
Stopwatch using 8051 microcontroller (AT89C51)
LCD based clock using RTC DS12C887 and 8051 microcontroller (AT89C51) using update interrupt
How to Interface RTC DS12C887 with 8051 microcontroller (AT89C51)
Seven segment based alarm clock using 8051 microcontroller (AT89C51)
Electronic voting machine using seven segment multiplexing with 8051 microcontroller (AT89C51)
How to interface Stepper Motor with 8051 Microcontroller (AT89C51)
Clock using RTC DS12C887 & 8051 microcontroller (AT89C51) with alarm set function
Up down counter using 8051 microcontroller (AT89C51)
Keypad based simple electronic lock using 8051 microcontroller (AT89C51)
How to interface GSM Module with 8051 microcontroller (AT89C51) using PC and LCD
How to interface Servo Motor with 8051 Microcontroller (AT89C51)
Interfacing RFID with 8051 microcontroller (AT89C51) using serial interrupt
How to interface GPS with 8051 Microcontroller (AT89C51)
How to generate sound using 8051 microcontroller (AT89C51)
How to interface Humidity Sensor with 8051 Microcontroller (AT89C51)
How to create text animation on 16x2 LCD using 8051 microcontroller (AT89C51)
How to interface ADC0808 with 8051 microcontroller (AT89C51) using clock from D-flip flop
How to interface Graphics LCD with 8051 Microcontroller (AT89C52)
Seven segment multiplexing using 8051 microcontroller (AT89C51)
Countdown timer using 8051 microcontroller (AT89C51)
Toll plaza system based on vehicle category interface with 8051 microcontroller (AT89C51)
How to display an image on Graphics LCD using AT89C52
How to interface ADC0808 using clock from 8051 microcontroller (AT89C51)
Interfacing ADC0804 with Serial port (RS232) using 8051 micocontroller (AT89C51)
Digital dice using 8051 microcontroller (AT89C51)
How to interface Sharp's distance sensor with 8051 microcontroller (AT89C51)
Seven segment based digital clock with time set option using 8051 microcontroller (AT89C51)
Clap counter using 8051 microcontroller (AT89C51)
How to display number on 16x2 LCD using 8051 microcontroller (AT89C51)
LCD based digital alarm clock using 8051 microcontroller (AT89C51)
How to control Stepper Motor using ULN2003 and 8051 Microcontroller (AT89C51)
How to display Hindi alphabets on 16x2 LCD using 8051 microcontroller (AT89C51)
Digital clock using DS12C887 and 8051 microcontroller (AT89C51) in 12 hour mode
EEPROM (24C02) Memory Reset using 8051 microcontroller (AT89C51)
Interfacing ADC0808 with Serial port (RS232) & 8051 microcontroller using clock from D-flip flop
LCD based sound operated display using 8051 microcontroller (AT89C51)
How to display custom animations on 16x2 LCD using 8051 microcontroller (AT89C51)
LCD based dual message display using 8051 microcontroller (AT89C51)
How to extract details from GPS Receiver using 8051 Microcontroller
How to display string on Graphics LCD using 8051 Microcontroller (AT89C52)
User input based seven segment display using 8051 microcontroller (AT89C51)
How to interface LDR with ADC0808 using interrupt clock from 8051 microcontroller (AT89C51)
How to interface three input channels of ADC0808 using 8051 microcontrollers (AT89C51)
Interfacing ADC0808 with Serial port (RS232) using interrupt clock from 8051 microcontroller (AT89C51)
How to interface Serial ADC0831 with 8051 Microcontroller (AT89C51)