MICROCHIP. STEMSEL LCD Project 6 : Clock. Problem Design a program that displays a clock on the LCD.

Similar documents
STEMSEL LCD Project 8 : Vending Machine MICROCHIP. Figure 1: Inputs and Outputs

Last time, we saw how latches can be used as memory in a circuit

Assignment 2b. ASSIGNMENT 2b. due at the start of class, Wednesday Sept 25.

Embedded Systems. Interfacing PIC with external devices 7-Segment display. Eng. Anis Nazer Second Semester

Embedded Systems. Interfacing PIC with external devices 7-Segment display. Eng. Anis Nazer Second Semester

Assignment 3: 68HC11 Beep Lab

CHAPTER 16 UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL

Logic Design. Flip Flops, Registers and Counters

Laboratory Exercise 7

Laboratory 8. Digital Circuits - Counter and LED Display

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

Fig. 1. The Front Panel (Graphical User Interface)

AD9884A Evaluation Kit Documentation

EE 367 Lab Part 1: Sequential Logic

CSE 352 Laboratory Assignment 3

K9123, K9134, K9135 Remote Programming Instructions and Specifications

Instruction Manual. Montreux

Junior Max (JR Max ) Controller

AMBIENT CLOCKIT MASTER SLATE ACD101

Third Edition. Product instructions (English version) LCD TEST TOOL. Instructions. (All rights reserved, pirates must investigate) 2015/08/

Instruction Manual Reizen Atomic Radio-Controlled USB-Charge Analog Talking Watch (USA-Euro Multi-Band) #704066

Experiment 8 Fall 2012

The basic logic gates are the inverter (or NOT gate), the AND gate, the OR gate and the exclusive-or gate (XOR). If you put an inverter in front of

Catch or Die! Julia A. and Andrew C. ECE 150 Cooper Union Spring 2010

Laboratory 11. Required Components: Objectives. Introduction. Digital Displays and Logic (modified from lab text by Alciatore)

B2 Spice A/D Tutorial Author: B. Mealy revised: July 27, 2006

Laboratory Exercise 7

Laboratory Exercise 6

Module 4: Traffic Signal Design Lesson 1: Traffic Signal (Arduino) Control System Laboratory Exercise Grade 6-8

Objectives: Learn how LED displays work Be able to output your name on the display

A clock is a free-running signal with a cycle time. A clock may be either high or low, and alternates between the two states.

6.3 Sequential Circuits (plus a few Combinational)

TDDFM14 OWNER S MANUAL

Chapter 4: One-Shots, Counters, and Clocks

Thank you for purchasing this product. If installing for someone else, please ensure that the instructions are handed to the householder.

Application Note 11 - Totalization

Distance, Velocity and Acceleration Detection

Lab #10: Building Output Ports with the 6811

Step 1 - shaft decoder to generate clockwise/anticlockwise signals

Implementing a Rudimentary Oscilloscope

Marks and Grades Project

This module senses temperature and humidity. Output: Temperature and humidity display on serial monitor.

NS8050U MICROWIRE PLUSTM Interface

EE 357 Lab 4 Stopwatch

Keymaker for MB trucks.

Side Street. Traffic Sensor. Main Street. Walk Button. Traffic Lights

Defrost Control Installation and Programming of Version 3.1 Cards

DE2-115/FGPA README. 1. Running the DE2-115 for basic operation. 2. The code/project files. Project Files

L5 Sequential Circuit Design

Digital Circuits I and II Nov. 17, 1999

apple Service Source Apple Cinema HD Display 23" LCD (ADC) 11 April Apple Computer, Inc. All rights reserved.

California State University, Bakersfield Computer & Electrical Engineering & Computer Science ECE 3220: Digital Design with VHDL Laboratory 7

Serial Remote Control of the RX2 SERIAL REMOTE CONTROL FOR THE RX2

Programmable Logic Design I

APPLICATION NOTE 4312 Getting Started with DeepCover Secure Microcontroller (MAXQ1850) EV KIT and the CrossWorks Compiler for the MAXQ30

Integration of Virtual Instrumentation into a Compressed Electricity and Electronic Curriculum

UTH-170 Installation and Manual

Laboratory 9 Digital Circuits: Flip Flops, One-Shot, Shift Register, Ripple Counter

COMP2611: Computer Organization Building Sequential Logics with Logisim

Battery Operated Controllers

Tebis application software

DIGITAL SYSTEM FUNDAMENTALS (ECE421) DIGITAL ELECTRONICS FUNDAMENTAL (ECE422) LATCHES and FLIP-FLOPS

Digital Logic. ECE 206, Fall 2001: Lab 1. Learning Objectives. The Logic Simulator

Digital 1 Final Project Sequential Digital System - Slot Machine

Introduction 1. Green status LED, controlled by output signal ST. Sounder, controlled by output signal Q6. Push switch on input D6

STX Stairs lighting controller.

Laboratory 10. Required Components: Objectives. Introduction. Digital Circuits - Logic and Latching (modified from lab text by Alciatore)

EDL8 Race Dash Manual Engine Management Systems

Laboratory Exercise 4

Model 6010 Four Channel 20-Bit Audio ADC Data Pack

Dynamic Scan Clock Control in BIST Circuits

Sequential Logic. Introduction to Computer Yung-Yu Chuang

LED Array Board.

10.1 Sequential logic circuits are a type of logic circuit where the output of the circuit depends not only on

Experiment 3: Basic Embedded System Analysis and Design

Clocks. Sequential Logic. A clock is a free-running signal with a cycle time.

Sauter Components

Training Note TR-06RD. Schedules. Schedule types

First Name Last Name November 10, 2009 CS-343 Exam 2

TSIU03, SYSTEM DESIGN. How to Describe a HW Circuit

Laboratory 7. Lab 7. Digital Circuits - Logic and Latching

Addendum: Rain Dial Installation and Programming Guide Update

FPGA Design. Part I - Hardware Components. Thomas Lenzi

2000 Series Weather Stations Analog Temperature / RH Sensor Upgrade Kit PRODUCT MANUAL KIT # 3613WDU

Technology Control Technology

INTRODUCTION (EE2499_Introduction.doc revised 1/1/18)

SINGLE ZONE CLIMATE ZONING SYSTEM. Technical Manual. Polyaire Pty Ltd

CHAPTER 11 LATCHES AND FLIP-FLOPS

Debugging of VHDL Hardware Designs on Altera s DE2 Boards

Boulder 2020 Advance D/A Converter

Inserting the batteries. Basic settings of the remote control

DX-10 tm Digital Interface User s Guide

DLP600M 6+1 Relay Module for Heating and Cooling Plants

EXPERIMENT 2: Elementary Input Output Programming

EE 109 Homework 6 State Machine Design Name: Score:

Physics 120 Lab 10 (2018): Flip-flops and Registers

VLC-3 USER'S MANUAL. Light Program Controller. M rev. 04 K rev. 00 & ( ( 5, 352*5$0 1 : $ 2 ' 6(77,1*6 )81&7,216

C-net MULTI Operating Instructions MULTI. User s Guide

Design Problem 4 Solutions

SEQUENTIAL CIRCUITS THE RELAY CIRCUIT

Transcription:

STEMSEL LCD Project 6 : Clock Problem Design a program that displays a clock on the LCD. Background Modern society already knows that it is surrounded by hundreds of microchips, doing all sorts of tasks such as waking people up in the morning, preparing food, playing games, or checking emails. Howeer, sometimes humans do not appreciate the programming behind een the most simple-looking deices. Clocks are something we often take for granted, but hae you eer thought about how it works? Our clock will need to be able to not just simply keep and display the time correctly, but will also need some sort of input so that we can set the correct time. Ideas What information does a clock need to display? When does the clock need to increment the numbers? How can users set the time? How is it possible to check if the clock is working properly; do we need to keep the microchip running for a full day? Plan It is possible to a LCD to display the hour and the minute. To be able to set the time effectiely, 2 buttons are needed. When running, the hour ariable will increment once minute reaches 60 and both hour and minute will need to be reset once they reach 13 and 60 respectiely. INPUTS OUTPUTS Push-button x2 MICROCHIP LCD Figure 1: Inputs and Outputs 1 LCD Project 6 Clock Copyright elabtronics 2015. All rights resered

Design Begin a new STEMSEL project in ezcircuit and add a LCD and a push-button to the circuit board. Note that the components should be inserted into the slots which appear as light green. All the components can be found in the circuit group. The completed design should appear as shown below, where Hour is the push-button. Figure 2: Circuit Design Build Insert the white signal wire, red and black wires into B6, positie (+) and negatie (-) slots respectiely. Then plug the LCD into the LCD port on the top of the circuit board. The complete circuit should appear as below. Figure 3: Circuit 2 LCD Project 6 Clock Copyright elabtronics 2015. All rights resered

Programming With the design and assembly completed, send the design to CoreChart to program the microchip. Make sure the button is pushed when connecting the STEMSEL controller board to the computer. Before starting to program, make sure the circuit board and the components are tested using the testing program. 1. Our first step is to use two SetNumber icons create our ariables that will store our minutes and hours. We will be starting at 12:00 midnight, so our hours are set to 12, minutes to 0. 2. We will not want to reset these eery time we loop back, so add an address called Loop. 3. Now we will display the time. Add an LCDFormat icon, and use it to clear the LCD with no delay. 4. Use two DispNumberLCD icons to show Hours and Minutes on the LCD, with a LCDMessage icon in between to display a full stop to separate hours and minutes. 5. So that we don t hae to wait for a full 12 hours to check our clock is working correctly (otherwise we would need to watch the clock tick for 12 hours...), we will use a shorter time delay of 10 hundredths of a second. 6. Now, increment the minutes ariable using an Add icon to add 1 to Minutes, saing the result back as Minutes. Our clock will now count up by one minute eery tenth of a second, or one hour eery 6 seconds. 7. Use a Compare icon to see if Minutes is aboe 59. If it is, use an Add icon to add one to Hours, and a SetNumber icon to reset Minutes to 0. Group these together into a group called Increment_H so they both fit below the decision. 8. Similarly, use another Compare icon to see if the Hours ariable is aboe 12. If so, then reset Hours to 1. 9. Finally, add a GoTo icon to return to the Loop address added earlier. Send this program to chip and test it. Note that due to the short time delay used, the display may flicker. 3 LCD Project 6 Clock Copyright elabtronics 2015. All rights resered

Figure 4: basic clock program Next, the program should be able to set the clock using two pushbuttons. 1. First, group all the display icons (clear LCD, DispNumberLCD, LCDMessage) into one group called DisplayTime. The group DisplayTime will be used later so it is possible to see the time while the clock is being set. 2. Group the Time Delay, Add Minutes and Compare Minutes into another group called Increment_Min add the group DisplayTime inside the newly created Time Delay and return back to the main core chart. 3. Inside the group of Increment_H the program needs to check whether if the hour is greater than 12. Add a compare icon and compare Hours to 12 and if it is aboe 12, set the Hours back to 1. 4 LCD Project 6 Clock Copyright elabtronics 2015. All rights resered

4. To check if the Hour button is being pressed by using another group icon. First add a decision icon to check whether the button is being pushed or not. Add a time increment of 50 hundredth of second and add another DisplayTime group icon. Merge the time increment and DisplayTime together and call it Set_Hour. 5. Now we need to be able to set the minutes, using the decision icon we want to check whether the minute button (A3_Pushbutton currently onboard) is being pushed if the push button is OFF, we want to Increment_min and DisplayTime and add a 50 hundredth of a second time delay. 6. Group the Increment_min, DisplayTime and time delay into a group called Set_Minutes. Because we don t want to double the minutes we will need another Decision Icon. If the A3_Pushbutton is OFF we want to go back to the subroutine that was just created Set_Minutes. 7. Send this new program to the chip and try setting the time. Figure 5: Display_Time Subroutine 5 LCD Project 6 Clock Copyright elabtronics 2015. All rights resered

Figure 6: Increment_H and Set_Minutes Subroutines Figure 7: Set_Hour and Increment_Min Subroutine 6 LCD Project 6 Clock Copyright elabtronics 2015. All rights resered

Figure 8: End Program with setting functions Extension There are many changes we could make to our clock, such as making it display in 24-hour time, displaying seconds, or adding a buzzer to make it an alarm clock. See how you go implementing one or een all of these ideas. NOTE: seconds is a ariable already used for the TimeDelay icon, so cannot be used for your seconds ariable. Name your seconds ariable Sec or something similar. Summary In this project we programmed a microchip which used a push-button as an input, and would actiate a LCD to perform the operation of a clock. After this project, we should hae a better understanding of how a clock works. Also the project should help deelop our skills on programming the STEMSEL controller board using ezsystem. At the end of the exercise, you should be able to: Manipulate the add and subtract functions in CoreChart. Use a LCD to display information in different formats. Use a push-button to control the program. 7 LCD Project 6 Clock Copyright elabtronics 2015. All rights resered