Making a 24hr Timer.

Slides:



Advertisements
Similar presentations
The essentials managers need to know about Excel
Advertisements

Getting started with LEGO NXT Mindstorms software This is intended to be a short introduction to the LEGO Mindstorms software and programming the LEGO.
JED Microprocessors Pty Ltd Presenting the JED T430 low-cost Projector Controllers Nov 22nd, 2009.
Sweeping a Variable Resistor Wheatstone Bridge. Place the Parts 1.VDC 2.R, which you place 3 times. The numbering of the resistor increases sequentially.
DEVELOPING ICT SKILLS PART -TWO
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
Loading Excel Double click the Excel icon on the desktop (if you have this) OR Click on Start All Programs Microsoft Office Microsoft Office Excel 2003.
Introduction to electronics lab ENGRI 1810 Using: Solderless prototype board (white board) Digital multimeter (DMM) Power Supply Signal Generator Oscilloscope.
PIC Programming with Logicator
To open a new document, double click Word from the programs – or from an existing document, go to the file menu at the top left, and click new. Also from.
De la Rosa-Pohl ECE 1100 Introduction to Engineering Intro to LabVIEW: Programming for Symon University of Houston Diana de la Rosa-Pohl Len Trombetta.
Section 2.3 Gauss-Jordan Method for General Systems of Equations
1 An Introduction to IBM SPSS PSY450 Experimental Psychology Dr. Dwight Hennessy.
Statement of Purpose: To program an incremental counter using the PSoC Designer 5.0, Imagecraft, the programming language C, the PSoCEval USB CY3214 circuit.
Google Earth How to create a Google Earth Tour and place it in your Wiki.
Getting started with Microsoft.NET Gadgeteer Comberton Village College Gadgeteer Club.
Scratch the Cat. Object Oriented Programing Writing computer programs Based on Objects Instead of Actions Based on Data Instead of Logic.
Mobile App Certification Course. In this course we will work you through on how you can start developing mobile apps for yourself or for many industries.
HBar OR Reader Documentation A copy of the PowerPoint Viewer is shipped with the HBar OR Reader on the HBar Official Records [OR] CD. The PowerPoint Viewer.
Advanced Digital Circuits ECET 146 Week 3 Professor Iskandar Hack ET 221B,
by Chris Brown under Prof. Susan Rodger Duke University June 2012
Making a Timer in Alice.
Creating an Astable Circuit This will guide you through constructing an astable circuit.
Weston Schreiber & Joshua Gabrielse Robotics Summer Training Programming #1: EasyC Basics.
High Speed Data Converter University
Introduction to Visual Basic. Quick Links Windows Application Programming Event-Driven Application Becoming familiar with VB Control Objects Saving and.
Mentor Tools tutorial Bold Browser Design Manager Design Architect Library Components Quicksim Creating and Compiling the VHDL Model.
Introduction to Arrays. definitions and things to consider… This presentation is designed to give a simple demonstration of array and object visualizations.
Analog Discovery Arbitrary Function Generator for Windows 7 by Mr
Jim Ng 15/1/2014 CENG4480 TUTORIAL 1. ABOUT ME Current MPhil Student supervised by Prof. Mak You can find me at Rm116 in SHB
How to get started with Excel VBA. We need to enable programming in Excel  the “Developer menu”
Downloading and Installing Autodesk Inventor Professional 2015 This is a 4 step process 1.Register with the Autodesk Student Community 2.Downloading the.
CS320n –Visual Programming More LabVIEW Foundations.
LANDESK SOFTWARE CONFIDENTIAL Tips and Tricks with Filters Jenny Lardh.
JDS5 Training Guide. On Start Up you will see this screen click the OK button Click OK.
Introduction to Drafting and Design In order to begin our drawing we have to set the drawing limits or the paper size.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Wheatstone Bridge. Schematic of a Wheatstone Bridge V BA = 0V and I R3 = I R4 if R 1 = R 2 and R 3 = R 4. Typically, the resistors are selected such that.
screen shots Emma Jarman. Adding attachments What is an attachment? An attachment is an that has a file attached to it. The file could be.
Using a SparkFun™ serial LCD with an Arduino
Computing and Information Technology Building a Web Browser
By Melissa Dalis Professor Susan Rodger Duke University June 2011
Programming and Debugging with the Dragon and JTAG
The first change to your project files that is needed is to change the device to the correct FPGA. This is done by going to the Assignments tab on the.
Computer Programming I
– Officiating Management Software
How to Create an Animoto Video
How to create a flip or camera video
Introduction to Arduino Microcontrollers
fischertechnik® RoboPro Software for Gateway To Technology® RoboPro
Introduction to Object-Oriented Programming
Debugging with Eclipse
Lab 3 Finite State Machine On Xilinx
Welcome to Digital Electronics using the Arduino Board
CTAERN/DOE System Level Counselor Coordinator Profile Entry Initiative
Introduction to TouchDevelop
Go to =>
Computer Skills (1) Internet Explorer.
CTAERN/DOE System Level Counselor Coordinator Profile Entry Initiative
Using screens and adding two numbers - addda.cbl
Aeroponic Engineering and Vertical Farming
Running a Java Program using Blue Jay.
Intro to Arduino Part 2 The Breadboard
EET 2259 Unit 7 Case Structures; Sequence Structures
Navigating Excel.
Getting started with LEGO EV3 Mindstorms software
Debugging with Eclipse
under the direction of Professor Susan Rodger
2019 Investing Now Summer Program
Presentation transcript:

Making a 24hr Timer

1 When you first load up Flowcode select New Project, this will then give you a list of options for which chip you want to programme for, the chip in my pic in my chip is a 16F1937 but you select whichever pic you have This will start a new project for you, but whilst you’re here you want to make sure you have your chip visible (just for reference) as well as your 2D Dashboard panel as this is where you will be able to interact with all the simulated inputs and outputs you choose to put on your pic Bring up your 2D Dashboard panel by clicking on view and enabling it 2

Select an LCD output for our timer to print on to by going to the outputs toggle on the top bar and clicking LCD. This will put an LCD in to our 2D Dashboard panel Right click on the LCD to bring up the properties list and connect our LCD to PORTB 3 4

5 6 7 8 9 6

To make our programme less messy I put my code in a macro, but for simplicity sake you can just put the LCD setup straight in to our programme line by doing the following; Insert a component Macro (on the side bar and drag it in to place between our ‘Begin’ and ‘End’ sequence. Double click on it and it should pop up a ‘Properties Macro’ box, on the list of components click the small plus sign next to LCD to expand the list, then select the ‘start’ command. Press okay and this is the component command that will start out LCD Insert another component macro underneath and select the component this time as LCD ‘clear’, this erases anything that was previously on our LCD Insert component macro underneath the previous one and select the component as LCD ‘cursor’, this will show parameters in the bottom that you can change, we want to set the x to 0 and the y to 0. This outlines where our numericals and letters will print on the LCD Insert component macro underneath once again and select the component as LCD ‘print string’ in the parameters section we want to change our expression to ‘”Hrs Mins Secs”’, putting quotation marks (i.e. “ “) around the expression as seen in step nines image. This is our LCD top line set up and ready to use

On the left hand side, drag a calculation underneath your LCD setup and double click to bring up the calculation properties. This is where we set it up so that the clock starts from zero. We do this by making new ‘variables’ for each of Hrs, Mins and Secs. The initial value for each should be 0, click OK and set up the variables as illustrated in the red box in step 12 In the calculations box select your variable ‘Hrs’ and write ‘Hrs=0’, then press enter to get the line below and select your ‘Mins’ variable and write ‘Mins=0’, press enter to get the line below and then enter ‘Secs=0’ you want it as shown in the blue outlined box 10 12 11

13 From the left side bar drag a loop in to your circuit underneath your previous work, this will make the clock continue clocking Insert a calculation in to the loop that will count up our seconds by inserting in to the calculations box ‘Secs=Secs+1’ Drag an output box from the left side bar underneath your calculation, we’re going to set the output up to the relays we’re going to have attached to PORTC of our pic. Clicking the output brings up the ‘Properties output’ and here we went to set out variable as 2 (this will turn on the second relay on our relay board, the click of the relay coming on and off will simulate the ticking of a clock every second 14 15 16

17. To simulate the relay board in our programme, insert an LED array output, making sure to go in to the properties menu and connect it to PORTC where our relays will be connected to our pic 17

The next step is to display your counting seconds on the bottom line of your LCD display. You do this by inserting a component macro and setting the ‘cursor’ to 10 on the x axis and 1 on the y axis, this will display your counting seconds in the red boxes shown. My LCD display is 16 across and 2 down which is read from the top left hand corner as 0,0 and the bottom right hand corner as 15,1 Insert a delay from the left side bar underneath our LCD cursor, and double click it to bring up the properties. Set the delay value as 1 second. This will be our second timer. 18 (0,0) X Y (10,1) 19

20 The next stage is to print our seconds on to the LCD, this is done by inserting a component macro, selecting ‘Print Number’ from the menu and setting our expression as ‘secs’ To turn the relay off in time ready for it to tick again at the next second, we put a 0 output to PORTC by inserting an output and setting the variable as 0 Now put in a delay of 10ms to allow the relay time to turn on and off in the circuit. Without a delay the off signal doesn’t have enough time to register in the circuit to turn off the relay. Do this by inserting a delay and setting the time properties as 10ms 21 22

Time to make a decision so that when your seconds counter hits 60 it adds a minute to your clock and resets back to zero, this is done by inserting a decision and setting it for if ‘secs=60’ And then inserting the following within this decision; Inserting a calculation for secs=0 Inserting a component macro on the LCD cursor in position (x:10, y:1) Inserting a component macro on the LCD that prints a string code of “ “ (so that it doesn’t print anything as it adds a minute) Insert a calculation now so that the minutes start counting: Mins=Mins+1 Insert a component macro on the LCD cursor in position (x:6, y:1) this will count the minutes below where you set your Minutes read out on the LCD Insert a component macro on the LCD that prints the Minute number  If you’re struggling to remember how to do the previous steps, go back and take a look at the previous stages which break it down a bit more 24 23

This stage is essentially the same as the last but modified to count minutes instead of seconds. Time to make a decision so that when your minutes counter hits 60 it adds an hour to your clock and resets back to zero, this is done by inserting a decision and setting it for if ‘mins=60’ Starting the counting of the hours can be done by Inserting a calculation for mins=0 Inserting a component macro on the LCD cursor in position (x:6, y:1) Inserting a component macro on the LCD that prints a string code of “ “ (so that it doesn’t print anything as it adds an hour) Insert a calculation now so that the minutes start counting: Hrs=Hrs+1 Insert a component macro on the LCD cursor in position (x:1, y:1) this will count the hours below where you set your Hours read out on the LCD Insert a component macro on the LCD that prints the Hours number  If you’re struggling to remember how to do the previous steps, go back and take a look at the previous stages which break it down a bit more 26 25

27 Now what happens once you’ve hit 24hrs? Well, I want my clock to return to zero and stay at zero (but you can easily modify this with a bit of ingenuity) as it is more of a 24hr timer than an actual clock. Insert a decision with the parameters that if ‘Hrs=24’ If you want a 24hr timer like mine then: Insert a loop that will make the circuit remain at 00:00:00 once it has passes 24 hours Within the loop put a calculation of Hrs=0, Mins=0 and Secs=0 Insert a call component macro on the LCD that will clear the bottom line (Y:1)  Insert a call component macro on the LCD that prints a string of “00 00 00 “ (That’s 00 space space space 00 space space 00 space space space) 28

29. Now the best way to make sure your programme works is to run your simulation at every stage to see how it works. Here I’ve run it all the way through and after watching it count through 24hours it has gone to 0 as I have requested of it 29

To get your written programme on to your chip plug your pic via USB cable in to your computer, and turn on your pic power supply , then click the button ‘Compile to chip’ which will pop up another window in Flowcode ‘compiler messages’ , wait for it to display that it has finished and it will have sent your programme to your chip and made your board fully functioning

Components needed: Screwdriver USB cable (from PIC to USB, mine was a standard printer USB cable) Power Supply Unit (to plug in to your PIC and give it power) PIC Multiprogrammer LCD Board Relay Board The components I’m using are all part of a Matrix set we were given to use at work and the PIC I’m using contains the 16F1937 microchip.

PSU USB PORTC PORTB Assembling the PIC: Start off by inserting your Relay Board in to PORTC Now insert your LCD Board in to PORTB Plug your PIC to USB cable in at both the computer end and the PIC end Plug in your power supply unit USB PORTC PORTB

Wiring up the PIC using a screw driver to loosen and tighten the screws in the tops of the pins, it doesn’t really matter too much which type of electrical wire you use as long as it’s copper and is the right length (to illustrate where the wires connect I’ve gone over my picture with corresponding colour lines Connect a wire from the +14V on your PIC to the +V on your Relay Board, this will supply power to your relays (see brown wire) Connect a wire from GND (ground) on your PIC to GND on your Relay Board (see red wire) Connect a wire from +V on your PIC to +V on your LCD Board (see white wire)

Once your PIC has been assembled and your programme put on to your chip have a play about, it should count seconds, minutes and hours perfectly as a 24hour timer and then set to 0 once it’s maxed out. Because of the relays mine now also ticks every second like a real clock! Fun project and a lot easier to do than I’d anticipated.