ECE Experiment #6 Kitchen Timer

Similar documents
ECE Experiment #4 Seven Segment Display Interfacing and Timing

1 Introduction to Modulo 7 Arithmetic

ECE COMBINATIONAL BUILDING BLOCKS - INVEST 13 DECODERS AND ENCODERS

EE1000 Project 4 Digital Volt Meter

Present state Next state Q + M N

Walk Like a Mathematician Learning Task:

Designing A Concrete Arch Bridge

Seven-Segment Display Driver

CSE 373: AVL trees. Warmup: Warmup. Interlude: Exploring the balance invariant. AVL Trees: Invariants. AVL tree invariants review

QUESTIONS BEGIN HERE!

QUESTIONS BEGIN HERE!

An undirected graph G = (V, E) V a set of vertices E a set of unordered edges (v,w) where v, w in V

Module graph.py. 1 Introduction. 2 Graph basics. 3 Module graph.py. 3.1 Objects. CS 231 Naomi Nishimura

CS September 2018

16.unified Introduction to Computers and Programming. SOLUTIONS to Examination 4/30/04 9:05am - 10:00am

Outline. 1 Introduction. 2 Min-Cost Spanning Trees. 4 Example

Physics 3150, Laboratory 9 Clocked Digital Logic and D/A Conversion

CSC Design and Analysis of Algorithms. Example: Change-Making Problem

Aquauno Video 6 Plus Page 1

CSE 373: More on graphs; DFS and BFS. Michael Lee Wednesday, Feb 14, 2018

Cycles and Simple Cycles. Paths and Simple Paths. Trees. Problem: There is No Completely Standard Terminology!

ICM7226A, ICM7226B. 8-Digit, Multi-Function, Frequency Counter/Timer. Features. Description. Applications. Ordering Information.

ICM7226A ICM7226B 8-Digit Multi-Function Frequency Counter/Timers

Module 2 Motion Instructions

Decimals DECIMALS.

COMP108 Algorithmic Foundations

# 1 ' 10 ' 100. Decimal point = 4 hundred. = 6 tens (or sixty) = 5 ones (or five) = 2 tenths. = 7 hundredths.

Page 1. Question 19.1b Electric Charge II Question 19.2a Conductors I. ConcepTest Clicker Questions Chapter 19. Physics, 4 th Edition James S.

Algorithmic and NP-Completeness Aspects of a Total Lict Domination Number of a Graph

Using the Printable Sticker Function. Using the Edit Screen. Computer. Tablet. ScanNCutCanvas

a b c cat CAT A B C Aa Bb Cc cat cat Lesson 1 (Part 1) Verbal lesson: Capital Letters Make The Same Sound Lesson 1 (Part 1) continued...

Outline. Computer Science 331. Computation of Min-Cost Spanning Trees. Costs of Spanning Trees in Weighted Graphs

ICM7216A, ICM7216B ICM7216D 8-Digit Multi-Function Frequency Counter/Timer

ATMOSPHERIC DISTURBANCE MONITOR MAIN CIRCUIT BOARD V5

(2) If we multiplied a row of B by λ, then the value is also multiplied by λ(here lambda could be 0). namely

Weighted graphs -- reminder. Data Structures LECTURE 15. Shortest paths algorithms. Example: weighted graph. Two basic properties of shortest paths

Paths. Connectivity. Euler and Hamilton Paths. Planar graphs.

FSA. CmSc 365 Theory of Computation. Finite State Automata and Regular Expressions (Chapter 2, Section 2.3) ALPHABET operations: U, concatenation, *

Case Study VI Answers PHA 5127 Fall 2006

, each of which is a tree, and whose roots r 1. , respectively, are children of r. Data Structures & File Management

b. How many ternary words of length 23 with eight 0 s, nine 1 s and six 2 s?

A Simple Code Generator. Code generation Algorithm. Register and Address Descriptors. Example 3/31/2008. Code Generation

A Low Noise and Reliable CMOS I/O Buffer for Mixed Low Voltage Applications

OpenMx Matrices and Operators

Nefertiti. Echoes of. Regal components evoke visions of the past MULTIPLE STITCHES. designed by Helena Tang-Lim

NO RECOMMENDED REPLACEMENT

SEE PAGE 2 FOR BRUSH MOTOR WIRING SEE PAGE 3 FOR MANUFACTURER SPECIFIC BLDC MOTOR WIRING EXAMPLES EZ SERVO EZSV17 WIRING DIAGRAM FOR BLDC MOTOR

d e c b a d c b a d e c b a a c a d c c e b

Problem solving by search

Graphs. CSC 1300 Discrete Structures Villanova University. Villanova CSC Dr Papalaskari

Exam 1 Solution. CS 542 Advanced Data Structures and Algorithms 2/14/2013

CS 461, Lecture 17. Today s Outline. Example Run

SAMPLE PAGES. Primary. Primary Maths Basics Series THE SUBTRACTION BOOK. A progression of subtraction skills. written by Jillian Cockings

Last time: introduced our first computational model the DFA.

CS 103 BFS Alorithm. Mark Redekopp

Experiment # 3 Introduction to Digital Logic Simulation and Xilinx Schematic Editor

learning objectives learn what graphs are in mathematical terms learn how to represent graphs in computers learn about typical graph algorithms

Tangram Fractions Overview: Students will analyze standard and nonstandard

5/7/13. Part 10. Graphs. Theorem Theorem Graphs Describing Precedence. Outline. Theorem 10-1: The Handshaking Theorem

EE 209 Lab 3 Mind over Matter

Outline. Circuits. Euler paths/circuits 4/25/12. Part 10. Graphs. Euler s bridge problem (Bridges of Konigsberg Problem)

Math 61 : Discrete Structures Final Exam Instructor: Ciprian Manolescu. You have 180 minutes.

DUET WITH DIAMONDS COLOR SHIFTING BRACELET By Leslie Rogalski

Graphs. Graphs. Graphs: Basic Terminology. Directed Graphs. Dr Papalaskari 1

12/3/12. Outline. Part 10. Graphs. Circuits. Euler paths/circuits. Euler s bridge problem (Bridges of Konigsberg Problem)

5/9/13. Part 10. Graphs. Outline. Circuits. Introduction Terminology Implementing Graphs

Basis of test: VDE 0660, part 500/IEC Rated peak withstand current I pk. Ip peak short-circuit current [ka] Busbar support spacing [mm]

Minimum Spanning Trees

5/1/2018. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees. Huffman Coding Trees

0 t b r 6, 20 t l nf r nt f th l t th t v t f th th lv, ntr t n t th l l l nd d p rt nt th t f ttr t n th p nt t th r f l nd d tr b t n. R v n n th r

Why the Junction Tree Algorithm? The Junction Tree Algorithm. Clique Potential Representation. Overview. Chris Williams 1.

TOPIC 5: INTEGRATION

Linear Algebra Existence of the determinant. Expansion according to a row.

CS 241 Analysis of Algorithms

Graph Isomorphism. Graphs - II. Cayley s Formula. Planar Graphs. Outline. Is K 5 planar? The number of labeled trees on n nodes is n n-2

10/30/12. Today. CS/ENGRD 2110 Object- Oriented Programming and Data Structures Fall 2012 Doug James. DFS algorithm. Reachability Algorithms

22 t b r 2, 20 h r, th xp t d bl n nd t fr th b rd r t t. f r r z r t l n l th h r t rl T l t n b rd n n l h d, nd n nh rd f pp t t f r n. H v v d n f

46 D b r 4, 20 : p t n f r n b P l h tr p, pl t z r f r n. nd n th t n t d f t n th tr ht r t b f l n t, nd th ff r n b ttl t th r p rf l pp n nt n th

Aim To manage files and directories using Linux commands. 1. file Examines the type of the given file or directory

n r t d n :4 T P bl D n, l d t z d th tr t. r pd l

Section 3: Antiderivatives of Formulas

CONTINUITY AND DIFFERENTIABILITY

CS200: Graphs. Graphs. Directed Graphs. Graphs/Networks Around Us. What can this represent? Sometimes we want to represent directionality:

A prefix word in each of these sentences is incorrect. Rewrite the prefix words correctly.

SEE PAGE 2 FOR BRUSH MOTOR WIRING SEE PAGE 3 FOR MANUFACTURER SPECIFIC BLDC MOTOR WIRING EXAMPLES A

UNCORRECTED SAMPLE PAGES 4-1. Naming fractions KEY IDEAS. 1 Each shape represents ONE whole. a i ii. b i ii

Solutions for HW11. Exercise 34. (a) Use the recurrence relation t(g) = t(g e) + t(g/e) to count the number of spanning trees of v 1

THE EFFECT OF SEED AND SOIL APPLIED SYSTEMIC INSECTICIDES ON APHIDS IN SORGHUM. Texas Agricultural Experiment Station, Nueces County, 2000

In order to learn which questions have been answered correctly: 1. Print these pages. 2. Answer the questions.

Lecture 20: Minimum Spanning Trees (CLRS 23)

Formal Concept Analysis

N=4 L=4. Our first non-linear data structure! A graph G consists of two sets G = {V, E} A set of V vertices, or nodes f

4 8 N v btr 20, 20 th r l f ff nt f l t. r t pl n f r th n tr t n f h h v lr d b n r d t, rd n t h h th t b t f l rd n t f th rld ll b n tr t d n R th

DEVELOPING COMPUTER PROGRAM FOR COMPUTING EIGENPAIRS OF 2 2 MATRICES AND 3 3 UPPER TRIANGULAR MATRICES USING THE SIMPLE ALGORITHM

Numbering Boundary Nodes

Analysis for Balloon Modeling Structure based on Graph Theory

Similarity Search. The Binary Branch Distance. Nikolaus Augsten.

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

H SERIES. Decimals. Decimals. Curriculum Ready ACMNA: 103, 128, 129, 130, 152, 154,

Multipoint Alternate Marking method for passive and hybrid performance monitoring

Transcription:

ECE 367 - Exprimnt #6 Kithn Timr Sprin 2006 Smstr Introution This xprimnt hs you onstrut iruit intrfin nin I/O lins from th 68HC11 with two svn smnt isplys n mtrix kyp, n writ ssmbly lnu o to rliz prormmbl ountown kithn timr tht llows th usr to prform vrious funtions: prst ount vlu, strt/rsum n pus ountown. Th purpos of this xprimnt is to th vn hrwr n softwr thniqus of intrfin miroontrollrs. Rquir Hrwr In ition to th MiroStmp11 moul, this xprimnt rquirs two svn smnt LED isplys, mtrix kyp, two TTL hx invrtrs (on 74LS04 IC), th 220Ω DIP rsistors n th 10KΩ SIP rsistors. Hr is photo of th omplt iruit:

Wirin Dirm Buil th followin iruit on solrlss brbor th iruit is vry similr to tht in Exprimnt 5. Th biirtionl rrows nxt to {PD2, PD1, PD0} init tht ths lins will b us for both input n output urin run-tim. Ω b tns of sons iit f b b sons iit f b f f CC CC n.. Ω

On in, for your rfrn, hr r pinout irms of th mtrix kyp n svn smnt LED isply in your lb prts kit: )(*$+%&,(*$+% -(*$+%,(*$+%',(!.( " -( " /'0 1 0 #! " " # $%& $% $% $%' f CC b Smnt: Output Lin: PA7 b PD5 PD4 PD3 PD2 f PD1 PD0 CC (lft iit) PA6 CC (riht iit) PA5 f b CC p

Softwr Dsin OC1F = 1? no OC2F = 1? no OC3F = 1? no ys xut Tsk1 ys xut Tsk2 ys xut Tsk3 offst1 to TOC1, rst OC1F offst1 to TOC2, rst OC2F offst3 to TOC3, rst OC3F In this xprimnt you will b usin TCNT n thr Output Compr ristrs to xut thr tsks t iffrnt frqunis. Hr is hih-lvl sription of th thr tsks: Tsk1 kps ount of tim usin thr iml iits (s in 54.7 s). This ount is rmnt vry 0.1 s whn th timr is runnin. Tsk1 xuts vry 1/10 s. Tsk2 multiplxs n upts th 7-smnt isplys; it xuts vry 1/200 s. Tsk3 polls th kyp to tt ky prsss n rspons orinly; it xuts vry 1/20 s.

Tsk1 Dtils Th mmory byt Mo is us to init whthr or not th ountr is runnin or is pus: Mo = 1 inits tht th timr is ountin own, n Mo = 0 inits tht it is frozn t th urrnt ount. Tsk1 psuoo: (xut vry 0.1 s) Diit3 Diit2 Diit1 (Th hrwr isplys only Diit3 n Diit2) if (Mo = 1 n Ky_Prss = 0) Diit1 Diit1 1 if (Diit1 = 1) Diit1 9 Diit2 Diit2 1 if (Diit2 = 1) Diit2 9 Diit3 Diit3 1 if (Diit3 = 1) Diit1 0 Diit2 0 Diit3 0 Mo 0 ; rmnt 0.1 s iit ; rmnt 1.0 s iit ; rmnt 10 s iit ; n of ountown is rh ; stop ountr (initilly Diit1 = 0, Diit2 = 0, Diit3 = 0, Mo = 0) S Tsk3 sription for xplntion of Ky_Prss.

Tsk2 Dtils Tsk2 prforms tim-ivision multiplxin by ltrntin th iit bin isply vry 1/200 s. This rsults in n ovrll 100 Hz rfrsh rt for both iits. Mmory byt Diit_Slt is n initor of wht iit (lft or riht) is urrntly bin isply. Tsk2 psuoo: (xut vry 0.005 s) if (Diit_Slt = 0) Diit_Slt 1 PA6 1 PA5 0 Diit Diit3 ls Diit_Slt 0 PA6 0 PA5 1 Diit Diit2 ; tivt lft 7-s. isply ; isply tns of s vlu ; tivt riht 7-s. isply ; isply s vlu Thn, output 7-smnt t orrsponin to mmory vlu Diit just s it ws on in Exprimnts 4 n 5. (initilly Diit_Slt = 0, Diit = 0, PA6 = 0, PA5 = 1)

Tsk3 Dtils Tsk3 xuts vry 1/20 s; it hks if ny ky is prss n rspons orinly. Mmory byt Ky_Prss kps trk of th kyp sttus: Ky_Prss = 1 whn kyprss is tt, Ky_Prss = 0 whn no kys r prss. To frz th ount, on must prss ny ky in th first thr olumns of th kyp (A, B, C, D kys r intiv). To strt th ountown squn on must prss n rls ithr E or F whn th ount is frozn. To ntr nw strtin tim vlu on must prss numri kys whn th ount is frozn. Tsk3 psuoo: (xut vry 0.05 s) if (ny ky is prss) if (Ky_Prss = 0) Ky_Prss 1 if (Mo = 1) Mo 0 ls if (E or F is prss) Mo 1 ls Ky_Prss 0 ls ; if now ountin thn ; stop ountin ; strt/rsum ountin Diit3 Diit2, Diit1 0 ; initiliz ount by shiftin in iits from th riht if (0 is prss) Diit2 0 lsif (1 is prss) Diit2 1 lsif (2 is prss) Diit2 2 lsif (9 is prss) Diit2 9 (initilly Ky_Prss = 0)

Bus w r shrin I/O lins btwn kyp n isply vis, som of th biirtionl lins of PortD will prioilly b onfiur for input (to r mtrix kyp t) n thn onfiur for output (to output t to th isplys). Th subroutin oin this on-th-fly ronfiurin is Tsk3. To sv you som prormmin tim hr is th o listin for subroutin Tsk3 (bs on th psuoo shown prviously): ;-------------------------------------------------------------------------- ; Tsk 3 (xut vry 1/20 s) - Poll th mtrix kyp: Tsk3: BCLR PortA,X,$60 ; PA6,PA5 <-- 0 (turn off both isplys) BCLR DDRD,X,$07 ; mk PD2...PD0 inputs, to r kyp ols ; riv ll kyp row lins hih: BSET PortA,X,$80 ; PA7 <-- 1 BSET PortD,X,$38 ; PD5...PD3 <-- 1 ; r kyp olumn lins to tt if ny ky is prss: BRCLR PortD,X,$07,C0 ; (hkin if PD2...PD0 r ll zro) JMP C1 C0: CLR Ky_Prss ; no ky is now prss C1: LDAA #0 ; on of th kys is now prss CMPA Ky_Prss BEQ C2 ; ky ws prss lst tim, so o ; nothin n wit for its rls C2: LDAA #1 ; nw kyprss is tt STAA Ky_Prss LDAA #0 CMPA Mo BEQ C3 CLR Mo ; stop th ountown if runnin C3: ; nw kyprss is tt in pus mo ; hk for ky prss in Row4 of th mtrix kyp: BCLR PortA,X,$80 ; PA7 <-- 0 (Row1) BCLR PortD,X,$20 ; PD5 <-- 0 (Row2) BCLR PortD,X,$10 ; PD4 <-- 0 (Row3) BSET PortD,X,$08 ; PD3 <-- 1 (Row4) BRSET PortD,X,$01,C4 ; jump to C4 if E is prss BRSET PortD,X,$02,C4 ; jump to C4 if F is prss JMP C5 C4: ; E or F ky is prss, hn mo to rsum ountown: LDAA #1 STAA Mo

C5: ; on of th numri kys is prss in pus mo; lr th ; tnths-of-s iit n shift in th numri ky vlu from ; th riht: (tns s iit) <-- (s iit) <-- (ky vlu) CLR LDAA STAA Diit1 Diit2 Diit3 ; tt ky0 prss (hk in Row4 still in fft from bov) BRCLR PortD,X,$04,C6 LDAA #0 C6: ; hk for ky prss in Row1 of th mtrix kyp: BSET PortA,X,$80 ; PA7 <-- 1 (Row1) BCLR PortD,X,$20 ; PD5 <-- 0 (Row2) BCLR PortD,X,$10 ; PD4 <-- 0 (Row3) BCLR PortD,X,$08 ; PD3 <-- 0 (Row4) ; tt ky1 prss: BRCLR PortD,X,$04,C7 LDAA #1 C7: ; tt ky2 prss: BRCLR PortD,X,$02,C8 LDAA #2 C8: ; tt ky3 prss: BRCLR PortD,X,$01,C9 LDAA #3 C9: ; hk for ky prss in Row2 of th mtrix kyp: BCLR PortA,X,$80 ; PA7 <-- 0 (Row1) BSET PortD,X,$20 ; PD5 <-- 1 (Row2) BCLR PortD,X,$10 ; PD4 <-- 0 (Row3) BCLR PortD,X,$08 ; PD3 <-- 0 (Row4) ; tt ky4 prss: BRCLR PortD,X,$04,C10 LDAA #4 C10: ; tt ky5 prss: BRCLR PortD,X,$02,C11 LDAA #5 C11: ; tt ky6 prss: BRCLR PortD,X,$01,C12 LDAA #6

C12: ; hk for ky prss in Row3 of th mtrix kyp: BCLR PortA,X,$80 ; PA7 <-- 0 (Row1) BCLR PortD,X,$20 ; PD5 <-- 0 (Row2) BSET PortD,X,$10 ; PD4 <-- 1 (Row3) BCLR PortD,X,$08 ; PD3 <-- 0 (Row4) ; tt ky7 prss: BRCLR PortD,X,$04,C13 LDAA #7 C13: ; tt ky8 prss: BRCLR PortD,X,$02,C14 LDAA #8 C14: ; tt ky9 prss: BRCLR PortD,X,$01,Quit_Tsk3 LDAA #9 Quit_Tsk3: BSET DDRD,X,$07 ; rturn PD2...PD0 to output mo ;Not: w h turn off both isplys by lrin PA5 n PA6, ; but Tsk2 will rfrsh thm in t most 1/200 s so w n ; not o tht hr. ;inrmnt TOC3 by 1/20 s from its lst vlu: LDD TOC3,X ; D <-- TOC3 ADDD #Inr3 ; D <-- D + Inr3 STD TOC3,X ; TOC3 <-- D LDAA #$20 STAA TFLG1,X ; Clr th TCNT Output Compr 3 fl RTS ;-------------------------------------------------------------------------- You my opy n pst from n on-lin listin of this subroutin tht is foun t: http://www..ui.u/~onhro/367_xp6_tsk3.txt Your job is to writ th rst of th o n to implmnt this kithn timr, buil th iruit, n monstrt its oprtion to your T.A. Thr will b som flikr in th isply. Cn you xplin why? How woul you sust to limint it? Why wr two output lins it to th ommon tho trminls of th svn smnt isplys, s ompr to only on lin in Exprimnt 5?