Project 18 Dual 8-Bit Binary Counters

Similar documents
Project 17 Shift Register 8-Bit Binary Counter

Earthshine Design Arduino Starters Kit Manual - A Complete Beginners Guide to the Arduino. Project 15. Shift Register 8-Bit Binary Counter

ShiftOut Tutorial. Maria Taylor

3 Wire LED Module (SKU:DFR0090)

60mA maximum (all channels on)

CMSC838. Tangible Interactive Assistant Professor Computer Science

4X4 Driver Shield Manual

Digital Design through. Arduino

Laboratory 10. Programming a PIC Microcontroller - Part II

Project 16 Using an L293D Motor Driver IC

Chapter 2 The Basic Functions

I2C interface Tutorial

Phi_interfaces. Liu Version /14/2012 2:32:00 AM

THE BASIC STARTER KIT TUTORIAL FOR UNO

Microcontrollers and Interfacing

Overview. Multiplexor. cs281: Introduction to Computer Systems Lab02 Basic Combinational Circuits: The Mux and the Adder

CS12020 (Computer Graphics, Vision and Games) Worksheet 1

Finite State Machine Lab

Physics 364, Fall 2012, Lab #9 (Introduction to microprocessor programming with the Arduino) Lab for Monday, November 5

ECE 362 Experiment 4: Interrupts

Rotary Encoder Basics

Parallel Data Transfer. Suppose you need to transfer data from one HCS12 to another. How can you do this?

3. The MC6802 MICROPROCESSOR

1 MALP ( ) Unit-1. (1) Draw and explain the internal architecture of 8085.

1/Build a Mintronics: MintDuino

WS2812B RGB LED Strip

Introduction the Serial Communications Parallel Communications Parallel Communications with Handshaking Serial Communications

CORTESIA ELECTRONICCA

IME-100 Interdisciplinary Design and Manufacturing

<Table of content> <Parts and description> <Circuit board Guide> <Pins> <Basics of Coding> <Intro to Arduino> <Intro> <Downloading Arduino IDO>

Adapted from a lab originally written by Simon Hastings and Bill Ashmanskas

36mm LED Pixels. Created by Phillip Burgess. Last updated on :45:20 PM EDT

HANDLING MULTIPLE DEVICES

Lab #12: ArithmeticLogic Unit

Ryan Everaert Application Note Team - I Application Note for Toshiba Bipolar Stepper, Part Number TB6560AHQ

Arduino 07 ARDUINO WORKSHOP 2007

Application Note 15 G X24C44 V CC DI DO

Understanding SPI with Precision Data Converters

ADC to I 2 C. Data Sheet. 10 Channel Analog to Digital Converter. with output via I 2 C

Lab 0: Wire Wrapping Project: Counter Board

Date Performed: Marks Obtained: /10. Group Members (ID):. Experiment # 09 MULTIPLEXERS

REMOTE LABORATORIES USING THE TRAINING MODULEM2CI

Interfacing to Digital Potentiometers

Temperature Sensor TMP2 PMOD Part 1

ES 210 Lab. Jack Ou, Ph.D.

4. Configuring Cyclone II Devices

CSCB58 - Lab 3. Prelab /3 Part I (in-lab) /2 Part II (in-lab) /2 TOTAL /8

University of Hull Department of Computer Science C4DI Interfacing with Arduinos

Robotics and Electronics Unit 5

Arduino Cookbook O'REILLY* Michael Margolis. Tokyo. Cambridge. Beijing. Farnham Koln Sebastopol

Laboratory Exercise 7

EECS 140 Laboratory Exercise 4 3-to-11 Counter Implementation

Button Input: On/off state change

SECOND EDITION. Arduino Cookbook. Michael Margolis O'REILLY- Tokyo. Farnham Koln Sebastopol. Cambridge. Beijing

Graphics LCD Display C Library for the PIC18F4550 MCU (or similar advanced microcontrollers)

Using Flexible-LVDS I/O Pins in

Lecture 25 March 23, 2012 Introduction to Serial Communications

Sierra Radio Systems. Digital Compass. Reference Manual. Version 1.0

This tutorial will show you how to take temperature readings using the Freetronics temperature sensor and an Arduino Uno.

CS 61C Summer 2012 Discussion 11 State, Timing, and CPU (Solutions)

Lab 3: Building a Power Supply and a Stereo Amplifier

SILICON MICROSTRUCTURES

Experiment 9: Binary Arithmetic Circuits. In-Lab Procedure and Report (30 points)

8-Channel Relay Output Board Via I 2 C Protocol. I2C-Relay8

Serial versus Parallel Data Transfers

Serial Peripheral Interface (SPI)

MOS INTEGRATED CIRCUIT

Bargraph Breakout Kit

Programmable Logic Design Techniques I

ECE 471 Embedded Systems Lecture 20

A B A+B

CHAPTER NINE - MSI Logic Circuits

Write LED display data, in accordance with the address from the display from low to high, from low to high data byte operation.

ZDL-V200. Refer to Steps: 1 Thru. 4 Please Follow Wiring Steps Carefully.

Device: FDRV-04S. This document version: v1. Matches module version: v2 [2 Oct 2015] Document revision date: 9 November 2015

8051 Microcontroller


cs281: Introduction to Computer Systems Lab03 K-Map Simplification for an LED-based Circuit Decimal Input LED Result LED3 LED2 LED1 LED3 LED2 1, 2

Getting Started Guide

JTAG and I 2 C on ELMB

Objectives: Learn how to input and output analogue values Be able to see what the Arduino is thinking by sending numbers to the screen

SECURE DIGITAL ACCESS SYSTEM USING IBUTTON

4 CHANNEL RELAY BOARD- BLUETOOTH

Please see the Pin Descriptions section for more information about the 10 available connections.

Week 11 Programmable Interrupt Controller

USB-4303 Specifications

Laboratory Exercise 3

MICROPROCESSOR B.Tech. th ECE

Building your own special-purpose embedded system gadget.

EE 3170 Microcontroller Applications

Note. The above image and many others are courtesy of - this is a wonderful resource for designing circuits.

IME-100 ECE. Lab 3. Electrical and Computer Engineering Department Kettering University. G. Tewolde, IME100-ECE,

Microcontrollers and Interfacing week 10 exercises

Module 3. Embedded Systems I/O. Version 2 EE IIT, Kharagpur 1

Code No: R Set No. 1

Project 2: Sensor Light


Summer 2003 Lecture 21 07/15/03

Adafruit INA219 Current Sensor Breakout

PARALLEL COMMUNICATIONS

Transcription:

Project 18 Dual 8-Bit Binary Counters In Project 18, you will daisy chain (or cascade) another 74HC595 IC onto the one used in Project 17 to create a dual binary counter. Parts Required 2 74HC595 Shift Register IC 16 Current Limiting Resistors 8 Red LEDs 8 Green LEDs 124

Connect It Up The first 595 is wired the same as in Project 15.7 The second 595 has +5V and Ground wires going to the same pins as on the first 595. Then, add a wire from Pin 9 on IC 1 to Pin 14 on IC 2. Add another from Pin 11 on IC 1 to Pin 11 on IC 2, and Pin 12 on IC 1 to Pin 12 on IC 2. The same outputs as on the first 595 going to the first set of LEDs go from the second IC to the second set of LEDs. Examine the diagrams carefully in Figures 6-4 and 6-5. Figure 6-4. The circuit for Project 18 (see insert for color version) 125

Figure 6-5. Close up of the wiring of the ICs for Project 18 (see insert for color version) Enter the Code Enter the following code in Listing 6-2 and upload it to your Arduino. When you run this code, you will see the green set of LEDs count up (in binary) from 0 to 255 and the red LEDs count down from 255 to 0 at the same time. Listing 6-2. Code for Project 18 // Project 18 int latchpin = 8; //Pin connected to Pin 12 of 74HC595 (Latch) int clockpin = 12; //Pin connected to Pin 11 of 74HC595 (Clock) int datapin = 11; //Pin connected to Pin 14 of 74HC595 (Data) void setup() { //set pins to output pinmode(latchpin, OUTPUT); pinmode(clockpin, OUTPUT); pinmode(datapin, OUTPUT); 126

void loop() { for (int i = 0; i < 256; i++) { //count from 0 to 255 digitalwrite(latchpin, LOW); //set latchpin low to allow data flow shiftout(i); shiftout(255-i); //set latchpin to high to lock and send data digitalwrite(latchpin, HIGH); delay(250 ); void shiftout(byte dataout) { boolean pinstate; // Shift out 8 bits LSB first, on rising edge of clock digitalwrite(datapin, LOW); //clear shift register ready for sending data digitalwrite(clockpin, LOW); for (int i=0; i<=7; i++) { // for each bit in dataout send out a bit digitalwrite(clockpin, LOW); //set clockpin to LOW prior to sending bit // if value of DataOut and (logical AND) a bitmask are true, set pinstate to 1 (HIGH) if ( dataout & (1<<i) ) { pinstate = HIGH; else { pinstate = LOW; //sets datapin to HIGH or LOW depending on pinstate digitalwrite(datapin, pinstate); digitalwrite(clockpin, HIGH); //send bit out on rising edge of clock digitalwrite(datapin, LOW); digitalwrite(clockpin, LOW); //stop shifting Project 18 - Code & Hardware Overview The code for Project 18 is identical to that in Project 17 apart from the addition of shiftout(255-i); in the main loop. The shiftout routine sends 8 bits to the 595. In the main loop, you have put two sets of calls to shiftout, one sending the value of i and the other sending 255-i. You call shiftout twice before you set the latch to HIGH. This will send two sets of 8 bits, or 16 bits in total, to the 595 chips before the latch is set HIGH to prevent further writing to the registers and to output the contents of the shift register to the output pins, which in turn make the LEDs go on or off. 127

The second 595 is wired up exactly the same as the first one. The Clock and Latch pins are tied to the pins of the first 595. However, you have a wire going from Pin 9 on IC 1 to Pin 14 on IC 2. Pin 9 is the data output pin and Pin 14 is the data input pin. The data is input to Pin 14 on the first IC from the Arduino. The second 595 chip is daisy chained to the first chip by Pin 9 on IC 1, which is outputting data into Pin 14 on the second IC, which is the data input. As you enter a ninth bit and above, the data in IC 1 gets shunted out of its data pin and into the data pin of the second IC. So, once all 16 bits have been sent down the data line from the Arduino, the first 8 bits sent would have been shunted out of the first chip and into the second. The second 595 chip will contain the FIRST 8 bits sent out and the first 595 chip will contain bits 9 to 16. An almost unlimited number of 595 chips can be daisy chained in this manner. EXERCISE Using the same circuit for Project 18 and all 16 LEDs, recreate the Knight Rider (or Cylon) light effect, making the LEDs bounce back and forth across all 16 LEDs.