Timing Generation and Measurements

Size: px
Start display at page:

Download "Timing Generation and Measurements"

Transcription

1 Timing Generation and Measurements Lab #7 Robert McManus & Junsang Cho April 2, 2004

2 Timing Generation and Measurements 1. Objective To gain experience using input capture to measure pulse width. To gain experience using output compare to do width modulation 2. Tasks a. Write assembly code for a program that measures pulse width. Each time the pulse width changes, it should transmit the measurement out the serial port. b. Write assembly code for a program that reads a desired pulse width in number of cycles from the keypad terminated with a # sign. After receiving the # sign, it should output a signal with this pulse width. The main program should be able to accept a new pulse width on the keypad at any time. 3. Test Procedures a. Use a frequency generator to test our pulse width measurement code. b. Use an oscilloscope to test your pulse width modulation code. c. Connect our circuit with the pulse width measurement code loaded to another group circuit with the pulse width modulation code loaded, and check the result. d. Swap codes and check again. 4. Hardware

3 5. Write up The assembly code is attached at the end of this report. 6. Conclusion The lab ended up being several in terms of the amount of coding that was done. Although there was code from Lab2 and Lab5 that could be used, most of it had to be rewritten due to size constraints on the chip and because of incompatibility of the modules. In the construction of the receiver we encountered only one critical problem. Whenever we attempted to send data from the port the chip would freeze. Initially, we simply made a gadly loop that would output the character and return when the character was sent. We assume that the complication was due to some incompatibility of the input capture interrupts and the simple serial output. To resolve this we converted the serial output to a serial interrupt method with a queue system. This prevented the chip from crashing, but would output corrupted data. We realized the issue was with the queue and also with the interference from the input interrupts. After debugging the queue and turning off the interrupts while in the serial interrupt, the program worked flawlessly. The sender had to be coded from scratch for room and because of special characters. A converter module was created to read the input and translate it to a hexadecimal value for output. Programming of the code itself was quick and easy; however, debugging was a nightmare. The program would accept inputs and would output a proper wave response, but only for a split second. We finally got it working by placing a delay function near the end of the output to check the chip step by step. After the placement of the delay function, the program worked flawlessly. We suspect that during the release of the keypad, there is a debouncing issue that triggers the output again with a value of 0. The curious thing however is that we have a debouncing routine built into the input which works for all other keys. Overall, the design of the program was quite challenge and rewarding when it was finally completed.

4 7. Assembly Code This is made by Junsang Cho and Robert McManus on April 2,2004 ECE3720 Lab#7 PulseWidth to serial communication PortA EQU $1000 ;Address for port A PortB EQU $1004 ;Address for port B PortC EQU $1003 ;Port C for input from keypad: PC7-PC0 PortE EQU $100A PACTL EQU $1026 ;Port A control reg. DDRC EQU $1007 TCNT EQU $100E ;Internal counter clock TMSK1 EQU $1022 TMSK2 EQU $1024 TFLG1 EQU $1023 TIC1 EQU $1010 TIC3 EQU $1014 TCTL1 EQU $1020 TCTL2 EQU $1021 BAUD EQU $102B SCCR1 EQU $102C SCCR2 EQU $102D SCSR EQU $102E SCDR EQU $102F LINE_FEED EQU $0A FifoSize EQU 10 Public variables:: org $0100 tx1 rmb 1 tx2 rmb 1 temp rmb 1 ttemp rmb 1 PWidth rmb 2 ;Current Pulse Width OPWidth rmb 2 ;Old Pulse Width

5 Ulimit rmb 2 Llimit rmb 2 NewValue rmb 1 PutPt rmb 2 ;Pointer of where to put next GetPt rmb 2 ;Pointer of where to get next Fifo rmb FifoSize ;The statically allocated fifo data Size rmb 1 ;size of Fifo Interrupt Tables:: ORG $B600 Vector for interrupt PG226 ldaa #$7E ;handler table for SCIhdlr handler staa $00C4 ldx #SCIhdlr stx $00C5 ldaa #$7E ;handler table for IC1I handler staa $00E8 ldx #IC1 stx $00E9 ldaa #$7E ;handler table for IC3I handler staa $00E2 ldx #IC3 stx $00E3 Initialize all necessary resources. ldaa #$00 ;Sets TCNT to 500ns per cycle staa TMSK2 ldaa #$00 ;Change port A to input staa PACTL ldaa #$00 staa TCTL1 Set so that IC1 is triggered on rising edge, and IC2 is triggered on falling ldaa #$12 staa TCTL2 ;Note: Both IC1 and IC2 share the same input wire.

6 ldd #$0500 ;Default value stored into PWidth std PWidth std OPWidth ldaa #$30 ;set 9600 baud staa BAUD ldaa #$00 ;mode staa SCCR1 ldaa #$08 ;Arm TE ( disable Transmit ) staa SCCR2 Test ;Led test Init Main Function - Main ldd OPWidth addd #$0005 std Ulimit ldd OPWidth subd #$0005 std Llimit ldd cpd bge ldd cpd ble bra PWidth Ulimit OUTPUT PWidth Llimit OUTPUT Main TEST:: Turn on all LEDs Test ldaa #$FF staa PortB Wait Wait Wait Init:: Initialize Fifo and interrupt registers

7 Init clra clrb InitFifo ldaa #$04 ;arm IC1I = 1 staa TMSK1 ldaa staa #$04 Clears TFLG1 Flag, initializes input interrupts. TFLG1 cli Interrupt Handler:: Interrupt sub-routines This interrupt is triggered upon a rising edge on the input. Clears input interrupt flag IC1F IC1 ldaa #$01 staa PortB ldaa #$1 ;arm IC3I = 1 staa TMSK1 ldaa #$1 ;clear IC3F staa TFLG1 rti This interrupt is triggered upon a falling edge on the input. IC3 ldaa #$02 staa PortB equal ldd TIC1 cpd TIC3 blt SKIP ldd #$FFFF In the advent of an overflow, TIC1 will be greater than TIC3 subd TIC1 To compensate, we calculate the time difference by subtracting addd #$0001 TIC1 from #$10000, however, since that is larger than 16 bits addd TIC3 we do the subraction to #$FFFF and add the #$0001 later to make it std PWidth to #$10000, TIC3 is then added and the right PWidth difference is found. bra RETURN Note, this does not support PulseWidths greater than SKIP ldd TIC3 subd TIC1 std PWidth

8 RETURN ldaa #$04 ;arm IC1I = 1 staa TMSK1 ldaa #$4 ;clear IC1F staa TFLG1 rti ISR for Serial communication port SCIhdlr ldaa #$00 ;disable IC1I & IC3I staa TMSK1 ldab stab #$F PortB ldab SCSR ;Status bitb #$80 ;tdre? beq SCIhdlr ldx #temp GetFifo ldaa temp staa SCDR ldaa Size cmpa #$0 bne Done Done ldaa #$08 ;Remove the arming bit of TIE ( disable Transmit ) staa SCCR2 ldaa #$1 ;arm IC3I = 1 staa TMSK1 rti Output:: Loads PWidth and sends the two bytes out to the serial port. May need to do a conversion to ASCII codes Doesn't need to measure while it's outputting. OUTPUT ldaa #$04 staa PortB ldd std staa lsra lsra Wait PWidth OPWidth tx2

9 lsra lsra anda staa ldab ldab andb ldd stab lsrb lsrb lsrb lsrb andb ldab andb ldaa #$0F tx1 tx1 CVRT PutFifo tx2 #$0F CVRT PutFifo OPWidth tx2 #$0F CVRT PutFifo tx2 #$0F CVRT PutFifo LINE_FEED PutFifo ldaa #$88 ;Arm TIE & TE ( enable Transmit ) staa SCCR2 ;enable SCI ldd std jmp PWidth OPWidth Main Convert table:: Input - RegB CVRT cmpb #$09 bgt ALPHA addb #$30 stab temp ldaa temp

10 ALPHA addb #$37 stab temp ldaa temp Wait ldx #$FFFF ;Delay value. Delay dex ;X = X - 1 bne Delay DEBNC ldd #5712 ;wait for 20ms addd TCNT ;time at the end of delay Loop cpd TCNT ;wait for (Endt - TCNT) > 0 bpl Loop FIFO Init function - Initialization of a two pointer FIFO. input:: No parameters output:: application is quit. FIFO is empty if PutPt = GetPt FIFO is full if PutPt+1 = GetPt (with wrap) InitFifo ldx #Fifo tpa sei ;make atomic, entering critical section stx PutPt stx GetPt ;Empty when PutPt=GetPt clrb ;reset the size varialbe stab Size tap ;end critical section, restore CCR FIFO PutFifo function - put a byte into the FiFo Input :: RegA contains 8 bit data to put Output:: RegA is -1 if successful, 0 if data not stored

11 PutFifo psha tpa tab pula pshb ;save old CCR sei ;make atomic, entering critical section ldx PutPt ;RegX is Temporary put pointer staa 0,x ;Try to put data into fifo inx ;x++ cpx #Fifo+FifoSize bne PutNoWrap1 ;skip if no wrapping needed ldx #Fifo ;Wrap PutNoWrap1 clra ;assume it will fail cpx GetPt ;Full if now the same beq PutDone1 coma ;RegA=-1 means OK stx PutPt ldab Size ;RxSize++ incb stab Size PutDone1 tab ;end critical section pula tap ;restore CCR to previous value tba FIFO GetFifo function - Get a byte from the FiFo Input :: RegX points to place for 8 bit data from Get Output:: RegA is -1 if successful, 0 if Fifo was empty when called. Return a byte in RegX GetFifo tpa psha ;save old CCR sei ;make atomic, entering critical section clra ;assume it will fail ldy GetPt cpy PutPt ;Empty if initially the same beq GetDone1 coma ;RegA=-1 means OK ldab 0,y ;Data from FIFO stab 0,x ;Return by reference

12 ldab Size ;RxSize-- decb stab Size iny cpy #Fifo+FifoSize bne GetNoWrap1 ;skip if no wrapping needed ldy #Fifo ;Wrap GetNoWrap1 sty GetPt GetDone1 tab ;end critical section pula tap ;restore CCR to previous value tba ;Transfer from B to A

13 This is made by Junsang Cho and Robert McManus on March. 28,2004 ECE3720 Lab#7 Keypad to pulse modulation PortA EQU $1000 ; Address for port A PortB EQU $1004 ; Address for port B PortC EQU $1003 ;Port C for input from keypad: PC7-PC0 PortE EQU $100A PACTL EQU $1026 ; Port A control reg. DDRC EQU $1007 TCNT EQU $100E ;Internal counter clock PIOC EQU $1002 FifoSize EQU 20 Output Compare Pg 320 TOC2 EQU $1018 ; OC2F set when TOC2=TCNT (Also runs interrupt) TMSK1 EQU $1022 TMSK2 EQU $1024 TFLG1 EQU $1023 OC1M EQU $100C ; Port A alternate function reg.s OC1D EQU $100D TCTL1 EQU $1020 org $0100 PutPt RMB 2 ;Pointer of where to put next GetPt RMB 2 ;Pointer of where to get next Fifo RMB FifoSize ;The statically allocated fifo data Value rmb 1 QCOUNT rmb 1 NewValue rmb 1

14 PWidth rmb 2 CurrentValue rmb 2 TempV rmb 2 Key rmb 2 Oldkey rmb 2 Main Function - ORG $B600 ldaa #$00 staa TMSK2 Vector for interrupt ldaa #$7E staa $00DC ldx #OC2 stx $00DD ; JUMP to OC2 ldaa #$FF ; Change port A to output staa PACTL clra staa DDRC ; All pins on Port C are input ldaa #$40 Sets OC2 interrupt on. Connects to PA6 staa TMSK1 ldaa #$40 staa TCTL1 Sets it so that everytime the OC2 interrupt is hit, it toggles ldd std #$03E8 Test value stored for pulse width PWidth ldd TCNT TOC2=TCNT+PWidth addd PWidth std TOC2

15 clra clrb staa staa OC1M OC1D Turns off OC1 InitFifo Init clra clrb std std std staa QCOUNT Key Oldkey CurrentValue ldaa #$40 Clears TFLG1 Flag staa TFLG1 cli Main KEYIN ldd Key cpd #$0000 bne Main2 ldd #$0000 std Oldkey bra Main2 bra Main LOADQ Main This module is activated everytime TOC2=TCNT OC2 ldd TCNT TOC2=TCNT+PWidth addd PWidth std TOC2 ldaa #$40 Clears TFLG1 Flag staa TFLG1 rti

16 This module will use the modules KEYIN and CONVERT and place a value into the Queue if the key read is not the same key that was read before. Note: This does not support rollovers. LOADQ DEBNC Debounces for 20 ms ldx cpx beq KEYIN Key Oldkey RETURN cpx #$0000 beq RETURN CONVERT ldaa Value Send Value into Queue cmpa #$0B Checking for Pound Sign bne Next Jumps to GETT to set pulse width GETT Next cmpa #$0C Resets value typed in so far if input is beq Init ldx stx Key Oldkey ldaa Value Send Value into Queue PutFifo ldaa QCOUNT Loads Count and increments by 1 inca staa QCOUNT staa PortB RETURN This module reads the contents of the queue and conve the stored values in the queue into the pulse width GETT ldad #$0000

17 std CurrentValue GETT2 ldd CurrentValue Multiply by 10 std TempV lsld Multiply by 8 lsld lsld std CurrentValue ldd TempV Mulitiply by 2 lsld std TempV addd CurrentValue Add to multiply by 10 std CurrentValue End of multiply by 10 ldx #NewValue GetFifo ldaa #$00 ldab NewValue addd std CurrentValue CurrentValue Assumption that value will never be greater than 16 bits ldaa QCOUNT Goes through Queue. deca staa QCOUNT cmpa #$00 bne GETT2 ldd CurrentValue std PWidth stab PortB Wait For some reason...this makes it work. jmp Init Without this, the program will eventually freeze and report wrong data. This module will read the keyboard and return a value into Key Keys pressed on the board return a 0 when pressed, thus the po are inverted here to produce a 1. KEYIN ldaa PortE ldab PortC eora #$0F Inve the bits of input.

18 anda eorb stad #$0F #$FF Key Port E contains 741 and Port C will contain 0852#963 This will be inputted into a variable called key key will be a 16 bit variable and will correspond by the following table Look up table code This module will take the value of Key and convert it into a hexidecimal value The results will be returned in the variable Value [][][][][][7][4][1][0][8][5][2][#][9][6][3] # is designated by 11 is designated by a 12 CONVERT ldx Key ldaa #$00 cpx #$0001 See if key is 3 bne CH1 ldaa #$03 CH1 cpx #$0002 See if key is 6 bne CH2 ldaa #$06 CH2 cpx #$0004 See if key is 9 bne CH3 ldaa #$09 CH3 cpx #$0008 See if key is # bne CH4 ldaa #$0B CH4 cpx #$0010 See if key is 2 bne CH5 ldaa #$02

19 CH5 cpx #$0020 See if key is 5 bne CH6 ldaa #$05 CH6 cpx #$0040 See if key is 8 bne CH7 ldaa #$08 CH7 cpx #$0080 See if key is 0 bne CH8 ldaa #$00 CH8 cpx #$0100 See if key is 1 bne CH9 ldaa #$01 CH9 cpx #$0200 See if key is 4 bne CH10 ldaa #$04 CH10 cpx #$0400 See if key is 7 bne CH11 ldaa #$07 CH11 cpx #$0800 See if key is bne DONE ldaa #$0C DONE staa Value Wait ldx #$FFFF ; Delay value. Delay dex ; X = X - 1 bne Delay FIFO Init function - Initialization of a two pointer FIFO. input:: No parameters output:: application is quit. FIFO is empty if PutPt = GetPt FIFO is full if PutPt+1 = GetPt (with wrap) InitFifo

20 ldx tpa sei stx stx tap #Fifo ;make atomic, entering critical section PutPt GetPt ;Empty when PutPt=GetPt ;end critical section, restore CCR FIFO PutFifo function - put a byte into the FiFo Input :: RegA contains 8 bit data to put Output:: RegA is -1 if successful, 0 if data not stored PutFifo psha tpa tab pula pshb ;save old CCR sei ;make atomic, entering critical section ldx PutPt ;RegX is Temporary put pointer staa 0,x ;Try to put data into fifo inx cpx #Fifo+FifoSize bne PutNoWrap ;skip if no wrapping needed ldx #Fifo ;Wrap PutNoWrap clra ;assume it will fail cpx GetPt ;Full if now the same beq PutDone coma ;RegA=-1 means OK stx PutPt PutDone tab ;end critical section pula tap ;restore CCR to previous value tba FIFO GetFifo function - Get a byte from the FiFo Input :: RegX points to place for 8 bit data from Get Output:: RegA is -1 if successful, 0 if Fifo was empty when called

21 GetFifo tpa psha sei clra ldy GetPt cpy PutPt beq GetDone coma ldab 0,y stab 0,x iny ;save old CCR ;make atomic, entering critical section ;assume it will fail ;Empty if initially the same ;RegA=-1 means OK ;Data from FIFO ;Return by reference cpy #Fifo+FifoSize bne GetNoWrap ;skip if no wrapping needed ldy #Fifo ;Wrap GetNoWrap sty GetPt GetDone tab ;end critical section pula tap ;restore CCR to previous value tba ;Transfer from B to A DEBNC ldd #5712 ;wait for 20ms addd TCNT ;time at the end of delay Loop cpd TCNT ;wait for (Endt - TCNT) > 0 bpl Loop

ECE/CE 3720: Embedded System Design

ECE/CE 3720: Embedded System Design Produce-Consumer Examples Slide 1 ECE/CE 3720: Embedded System Design Chris J. Myers Slide 3 Source/producer Keyboard input Program with data Sink/consumer Program that interprets Printer output Lecture

More information

Programming the Motorola MC68HC11 Microcontroller

Programming the Motorola MC68HC11 Microcontroller Programming the Motorola MC68HC11 Microcontroller COMMON PROGRAM INSTRUCTIONS WITH EXAMPLES aba Add register B to register A Similar commands are abx aby aba add the value in register B to the value in

More information

Table 1: Mnemonics Operations Dictionary. Add Accumulators Add B to Y. Add with carry to B. Add Memory to B. Add 16-bit to D And B with Memory

Table 1: Mnemonics Operations Dictionary. Add Accumulators Add B to Y. Add with carry to B. Add Memory to B. Add 16-bit to D And B with Memory Table 1: Mnemonics s Dictionary ABA ABX ABY ADCA ADCB ADDA ADDB ADDD ANDA ANDB ASL ASLA ASLB ASLD ASR ASRA ASRB BCC BCLR BCS BEQ BGE BGT BHI BHS BITA BITB BLE BLO BLS BLT Add Accumulators Add B to X Add

More information

C SC 230 Computer Architecture and Assembly Language April 2000 Exam Sample Solutions

C SC 230 Computer Architecture and Assembly Language April 2000 Exam Sample Solutions C SC 230 Computer Architecture and Assembly Language April 2000 Exam Sample Solutions 1. (12 marks) Circle the correct answer for each of the following: The 8-bit two's complement representation of -15

More information

Ryerson University Department of Electrical and Computer Engineering ELE 538 Microprocessor Systems Final Examination December 8, 2003

Ryerson University Department of Electrical and Computer Engineering ELE 538 Microprocessor Systems Final Examination December 8, 2003 Ryerson University Department of Electrical and Computer Engineering ELE 538 Microprocessor Systems Final Examination December 8, 23 Name: Student Number: Time limit: 3 hours Section: Examiners: K Clowes,

More information

The Motorola 68HC11 Instruc5on Set

The Motorola 68HC11 Instruc5on Set The Motorola 68HC11 Instruc5on Set Some Defini5ons A, B * accumulators A and B D * double accumulator (A + B) IX, IY * index registers X and Y SP * stack pointer M * some memory loca5on opr * an operand

More information

68HC11 Opera,ng Modes

68HC11 Opera,ng Modes 68HC11 Opera,ng Modes Modes Single- Chip Expanded Mul,plexed Special Bootstrap Special Test Minimal Circuit Layout: Single Chip Timing Diagrams Timing Laboratory 2 Debrief Exercise 1: Serial TX Generally

More information

ECE/CE 3720: Embedded System Design

ECE/CE 3720: Embedded System Design Basic Components of Input Capture Slide 1 ECE/CE 3720: Embedded System Design Chris J. Myers Lecture 12: Input Capture Slide 3 Basic Principles of Input Capture Basic Principles of Input Capture (cont)

More information

Lecture 6 Assembly Programming: Branch & Iteration

Lecture 6 Assembly Programming: Branch & Iteration CPE 390: Microprocessor Systems Spring 2018 Lecture 6 Assembly Programming: Branch & Iteration Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ

More information

Capstone Design Course. Lecture-2: The Timer

Capstone Design Course. Lecture-2: The Timer Capstone Design Course Lecture-2: The Timer By Syed Masud Mahmud, Ph.D. Copyright 2002 by Syed Masud Mahmud 1 The Timer The 68HC11 has a 16-Bit Free Running Timer. The count value of the timer is available

More information

EE 3170 Microcontroller Applications

EE 3170 Microcontroller Applications Q. 3.9 of HW3 EE 37 Microcontroller Applications (a) (c) (b) (d) Midterm Review: Miller Chapter -3 -The Stuff That Might Be On the Exam D67 (e) (g) (h) CEC23 (i) (f) (j) (k) (l) (m) EE37/CC/Lecture-Review

More information

ECE331 Handout 3- ASM Instructions, Address Modes and Directives

ECE331 Handout 3- ASM Instructions, Address Modes and Directives ECE331 Handout 3- ASM Instructions, Address Modes and Directives ASM Instructions Functional Instruction Groups Data Transfer/Manipulation Arithmetic Logic & Bit Operations Data Test Branch Function Call

More information

2) [ 2 marks] Both of the following statements cause the value $0300 to be stored in location $1000, but at different times. Explain the difference.

2) [ 2 marks] Both of the following statements cause the value $0300 to be stored in location $1000, but at different times. Explain the difference. 1) [ 9 marks] Write a sequence of directives for an HCS12 assembly language program that performs all of these tasks, in this order: a) Define an array called Measurements starting from memory location

More information

Addressing Mode Description Addressing Mode Source Format Abbrev. Description

Addressing Mode Description Addressing Mode Source Format Abbrev. Description Addressing Mode Description Addressing Mode Source Format Abbrev. Description Inherent INST (no operands) INH Operands (if any) are in CPU registers Immediate INST #opr8i or INST #opr16i IMM Operand is

More information

ECE/CE 3720: Embedded System Design

ECE/CE 3720: Embedded System Design Sequence of Events During Interrupt 1. Hardwere needs service (busy-to-done) transition. 2. Flag is set in one of the I/O status registers. (a) Interrupting event sets the flag (ex., STAF=1). Slide 1 ECE/CE

More information

AN Kbyte Addressing with the M68HC11. Overview

AN Kbyte Addressing with the M68HC11. Overview Order this document by /D 128-Kbyte Addressing with the M68HC11 By Ross Mitchell MCU Applications Engineering Freescale Ltd. East Kilbride, Scotland Overview The maximum direct addressing capability of

More information

Chapter 2: HCS12 Assembly Programming. EE383: Introduction to Embedded Systems University of Kentucky. Samir Rawashdeh

Chapter 2: HCS12 Assembly Programming. EE383: Introduction to Embedded Systems University of Kentucky. Samir Rawashdeh Chapter 2: HCS12 Assembly Programming EE383: Introduction to Embedded Systems University of Kentucky Samir Rawashdeh With slides based on material by H. Huang Delmar Cengage Learning 1 Three Sections of

More information

Coe538 Final Study Guide 2016 (Questions & Answers)

Coe538 Final Study Guide 2016 (Questions & Answers) Coe538 Study Guide 1 of 8 Coe538 Final Study Guide 2016 (Questions & Answers) This version contains questions AND answers. This study guide is meant to help you review coe538 and prepare for the final.

More information

ECE/CS 3720: Embedded System Design (ECE 6960/2 and CS 6968)

ECE/CS 3720: Embedded System Design (ECE 6960/2 and CS 6968) Sequence of Events During Interrupt 1. Hardwere needs service (busy-to-done) transition. 2. Flag is set in one of the I/O status registers. (a) Interrupting event sets the flag (ex., STAF=1). Slide 1 ECE/CS

More information

EE319K Final Fall 2005 Solution C. (3) Question 1. (3) Question 2. short function(const short in){ return in+5; } const

EE319K Final Fall 2005 Solution C. (3) Question 1. (3) Question 2. short function(const short in){ return in+5; } const EE319K Final Fall 2005 Solution C. Jonathan Valvano (3) Question 1. Consider a matrix with 4 rows and 6 columns, stored in column-major zero-index format. Each element is 16 bits. Which equation correctly

More information

Decimal, Hexadecimal and Binary Numbers Writing an assembly language program

Decimal, Hexadecimal and Binary Numbers Writing an assembly language program Decimal, Hexadecimal and Binary Numbers Writing an assembly language program o Disassembly of MC9S12 op codes o Use flow charts to lay out structure of program o Use common flow structures if-then if-then-else

More information

MACO Multiple Agent Climbing Organism

MACO Multiple Agent Climbing Organism MACO Multiple Agent Climbing Organism Final Report Ted Belser University of Florida, Department of Computer Engineering EEL 5666, Machine Intelligence Design Laboratory Table of Contents MACO... 1 Multiple

More information

ME 6405 Introduction to Mechatronics

ME 6405 Introduction to Mechatronics ME 6405 Introduction to Mechatronics Fall 2005 Instructor: Professor Charles Ume LECTURE 9 Homework 1 Solution 1. Write an assembly language program to clear the usable internal RAM in the M68HC11E9. Solution:

More information

EE319K Fall 2007 Quiz 1A Page 1. (5) Question 2. What will be the value of the carry (C) bit after executing the following? ldab #210 subb #60

EE319K Fall 2007 Quiz 1A Page 1. (5) Question 2. What will be the value of the carry (C) bit after executing the following? ldab #210 subb #60 EE319K Fall 2007 Quiz 1A Page 1 First: Last: This is a closed book exam. You must put your answers on this piece of paper only. You have 50 minutes, so allocate your time accordingly. Please read the entire

More information

Introduction to Mechatronics. Fall Instructor: Professor Charles Ume. Interrupts and Resets

Introduction to Mechatronics. Fall Instructor: Professor Charles Ume. Interrupts and Resets ME645 Introduction to Mechatronics Fall 24 Instructor: Professor Charles Ume Interrupts and Resets Reason for Interrupts You might want instructions executed immediately after internal request and/or request

More information

COE538 Lecture Notes Week 3 (Week of Sept 17, 2012)

COE538 Lecture Notes Week 3 (Week of Sept 17, 2012) COE538 Lecture Notes: Week 3 1 of 11 COE538 Lecture Notes Week 3 (Week of Sept 17, 2012) Announcements My lecture sections should now be on Blackboard. I've also created a discussion forum (and anonymous

More information

SECTION 6 CENTRAL PROCESSING UNIT

SECTION 6 CENTRAL PROCESSING UNIT SECTION 6 CENTRAL PROCESSING UNIT This section discusses the M68HC11 central processing unit (CPU), which is responsible for executing all software instructions in their programmed sequence. The M68HC11

More information

EE319K Fall 2003 Quiz 1 Page 1

EE319K Fall 2003 Quiz 1 Page 1 EE319K Fall 2003 Quiz 1 Page 1 First: Last: This is a closed book exam. You must put your answers on this piece of paper only. You have 50 minutes, so allocate your time accordingly. Please read the entire

More information

EE319K Fall 2006 Quiz 1 Page 1

EE319K Fall 2006 Quiz 1 Page 1 EE319K Fall 2006 Quiz 1 Page 1 First: Last: This is a closed book exam. You must put your answers on this piece of paper only. You have 50 minutes, so allocate your time accordingly. Please read the entire

More information

Lecture 9 Subroutines

Lecture 9 Subroutines CPE 390: Microprocessor Systems Spring 2018 Lecture 9 Subroutines Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 Adapted from HCS12/9S12

More information

ME 4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume.

ME 4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume. ME 4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics Instructor: Professor Charles Ume Timers Lecture Outline General Description of Main Timer Input Capture Concept

More information

Exam 2 E2-1 Fall Name: Exam 2

Exam 2 E2-1 Fall Name: Exam 2 Exam 2 E2-1 Fall 2004 1. Short Answer [20 pts] Exam 2 a. [4 points] Show the contents of registers A, B, SP, and X after the following code executes: lds #$a00 ldab #$23 A = ldaa #$87 ldx #$2543 B = pshd

More information

EE 3170 Microcontroller Applications

EE 3170 Microcontroller Applications Block Diagram of 68HC11A8 EE 3170 Microcontroller Applications Lecture 14: Advanced 68HC11 Hardware- PartI A: Measuring Real-Time in the 68HC11 - Miller 7.7-7.8 Based on slides for ECE3170 by Profs. Davis,

More information

Introduction to Microcontrollers

Introduction to Microcontrollers Motorola M68HC11 Specs Assembly Programming Language BUFFALO Topics of Discussion Microcontrollers M68HC11 Package & Pinouts Accumulators Index Registers Special Registers Memory Map I/O Registers Instruction

More information

Using the stack and the stack pointer

Using the stack and the stack pointer Using the stack and the stack pointer o The Stack and Stack Pointer o The stack is a memory area for temporary storage o The stack pointer points to the last byte in the stack o Some instructions which

More information

ME4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 7

ME4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 7 ME4447/6405 Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics Instructor: Professor Charles Ume LECTURE 7 Reading Assignments Reading assignments for this week and next

More information

538 Lecture Notes Week 3

538 Lecture Notes Week 3 538 Lecture Notes Week 3 (Sept. 16, 2013) 1/18 538 Lecture Notes Week 3 Answers to last week's questions 1 Write code so that the least significant bit of Accumulator A is cleared, the most significant

More information

(5) Question 7. Simplified memory cycles (you may or may not need all 5 entries) R/W Addr Data

(5) Question 7. Simplified memory cycles (you may or may not need all 5 entries) R/W Addr Data EE319K Fall 2003 Quiz 3 Page 1 First: Middle Initial: Last: This is a closed book exam. You must put your answers on this piece of paper only. You have 50 minutes, so allocate your time accordingly. Please

More information

Cross Assembly and Program Development

Cross Assembly and Program Development Cross Assembly and ENGG4640/3640; Fall 2004; Prepared by Radu Muresan 1 Introduction Text Editor Program Ex. DOS, Notepad, Word saved as ASCII Source Code Assembler or Cross-Assembler Object Code Machine

More information

EE319K Fall 2005 Quiz 1A Page 1

EE319K Fall 2005 Quiz 1A Page 1 EE319K Fall 2005 Quiz 1A Page 1 First: Last: This is a closed book exam. You must put your answers on this piece of paper only. You have 50 minutes, so allocate your time accordingly. Please read the entire

More information

1 Execution of main program is suspended. 2 All registers are pushed onto the stack. 3 The ISR, or background thread, is executed.

1 Execution of main program is suspended. 2 All registers are pushed onto the stack. 3 The ISR, or background thread, is executed. Introduction ECE/CS 5780/6780: Embedded System Design Chris J. Myers Lecture 7: Interrupt Synchronization Interrupts provide guarantee on response time. Interrupts allow response to rare but important

More information

Scanning and Decoding Information From Magnetic Strips

Scanning and Decoding Information From Magnetic Strips Scanning and Decoding Information From Magnetic Strips Final Project Report December 9, 1999 E157 Peter Scheidler and James Benham Abstract: Magnetic stripes are used in daily life to store digital information.

More information

Prototype Control Board for an Automated Bar (Robotic Bar Monkey)

Prototype Control Board for an Automated Bar (Robotic Bar Monkey) Prototype Control Board for an Automated Bar (Robotic Bar Monkey) Final Project Report December 9, 1999 E157 Andrew Cosand and Glenn Gebhart Abstract: We are interested in creating an automated beverage

More information

Reading Assignment. 68HC12 Instruction Set. M68HC12 Instruction Set Categories. Some Tips. Endianness (Byte Order) Load and Store Instructions

Reading Assignment. 68HC12 Instruction Set. M68HC12 Instruction Set Categories. Some Tips. Endianness (Byte Order) Load and Store Instructions Reading Assignment EEL 4744C: Microprocessor Applications Lecture 5 68HC12 Instruction Set Software and Hardware Engineering (Old version) Chapter 4 Or Software and Hardware Engineering (New version) Chapter

More information

1. Memory Mapped Systems 2. Adding Unsigned Numbers

1. Memory Mapped Systems 2. Adding Unsigned Numbers 1 Memory Mapped Systems 2 Adding Unsigned Numbers 1 1 Memory Mapped Systems Our system uses a memory space Address bus is 16-bit locations Data bus is 8-bit 2 Adding Unsigned Numbers 2 Our system uses

More information

Disassembly of an HC12 Program It is sometimes useful to be able to convert HC12 op codes into mnemonics. For example, consider the hex code:

Disassembly of an HC12 Program It is sometimes useful to be able to convert HC12 op codes into mnemonics. For example, consider the hex code: Disassembly of an HC12 Program It is sometimes useful to be able to convert HC12 op codes into mnemonics. For example, consider the hex code: ADDR DATA ---- ------------------------------------------------------

More information

CHAPTER 8. Solutions for Exercises

CHAPTER 8. Solutions for Exercises CHAPTER 8 Solutions for Exercises E8.1 The number of bits in the memory addresses is the same as the address bus width, which is 20. Thus the number of unique addresses is 2 20 = 1,048,576 = 1024 1024

More information

Assembly Language Development Process. ECE/CS 5780/6780: Embedded System Design. Assembly Language Listing. Assembly Language Syntax

Assembly Language Development Process. ECE/CS 5780/6780: Embedded System Design. Assembly Language Listing. Assembly Language Syntax Assembly Language Development Process ECE/CS 5780/6780: Embedded System Design Chris J. Myers Lecture 3: Assembly Language Programming Chris J. Myers (Lecture 3: Assembly Language) ECE/CS 5780/6780: Embedded

More information

Administrivia. ECE/CS 5780/6780: Embedded System Design. Assembly Language Syntax. Assembly Language Development Process

Administrivia. ECE/CS 5780/6780: Embedded System Design. Assembly Language Syntax. Assembly Language Development Process Administrivia ECE/CS 5780/6780: Embedded System Design Scott R. Little Lecture 3: Assembly Language Programming 2 versions of CodeWarrior are on the lab machines. You should use the 4.5 version (CW for

More information

COSC345 Software Engineering. Basic Computer Architecture and The Stack

COSC345 Software Engineering. Basic Computer Architecture and The Stack COSC345 Software Engineering Basic Computer Architecture and The Stack Outline Architectural models A little about the 68HC11 Memory map Registers A little bit of assembly (never did us any harm) The program

More information

Exam 2 E2-1 Fall Name: Exam 2

Exam 2 E2-1 Fall Name: Exam 2 Exam 2 E2-1 Fall 2002 1. Short Answer [10 pts] Exam 2 a.[2 pts] Briefly describe what each of the following instructions do so that it is clear what the differences between them are: STAA -2,X STAA 2,-X

More information

ECE/CS 5780/6780: Embedded System Design

ECE/CS 5780/6780: Embedded System Design ECE/CS 5780/6780: Embedded System Design Scott R. Little Lecture 3: Assembly Language Programming Scott R. Little (Lecture 3: Assembly) ECE/CS 5780/6780 1 / 59 Administrivia 2 versions of CodeWarrior are

More information

Interrupts. Interrupts Resets Low Power Modes. Resets Low Power Modes

Interrupts. Interrupts Resets Low Power Modes. Resets Low Power Modes Interrupts Resets Low Power Modes Drop everything and get your priorities straight! Alan Claghorn Chris Golder Raja Shah Outline Interrupts Why use interrupts? Types of interrupts Interrupt Flow Priorities

More information

Department of Computer Science and Engineering

Department of Computer Science and Engineering Department of Computer Science and Engineering Instruction Set Overview This is a complete overview of the instruction set for the Motorola MC9S12DT256 microprocessor. Some of the groups are irrelevant

More information

PROGRAMMING THE MICROCONTROLLER

PROGRAMMING THE MICROCONTROLLER PROGRAMMING THE MICROCONTROLLER ASSEMBLY LANGUAGE Assembly language is of higher level than machine language and hence easier to use. An assembly language code consists of a) Program statement lines b)

More information

TEMPERATURE SENSOR. Revision Class. Instructor / Professor LICENSE

TEMPERATURE SENSOR. Revision Class. Instructor / Professor LICENSE CME-11E9 EVBU LAB EXPERIMENT TEMPERATURE SENSOR Revision 04.02.11 Class Instructor / Professor LICENSE You may use, copy, modify and distribute this document freely as long as you include this license

More information

538 Lecture Notes Week 3

538 Lecture Notes Week 3 538 Lecture Notes Week 3 (Sept. 20, 2017) 1/24 538 Lecture Notes Week 3 Answers to last week's questions 1 Write code so that the least significant bit of Accumulator A is cleared, the most significant

More information

* COMPILER CONSTANTS * ***********************************************************************************

* COMPILER CONSTANTS * *********************************************************************************** Copyright 2005 by Aaron Enes Adam Cardi Matt Wagner ASSEMBLY LANGUAGE CODE FOR THE TEETERING BUFFALO OR THE SELF BALANCING ROBOT OR THE REMOTE CONTROL SEGWAY COMPILER CONSTANTS PROG EQU $E000 CONST EQU

More information

ECE 367 -Experiment #1 Fall 2012

ECE 367 -Experiment #1 Fall 2012 Due at the beginning of lab during week 3 (9/1/2012) Introduction ECE 367 -Experiment #1 Fall 2012 The goal of this experiment is the acquaint you with the Technological Arts nanocore12 microcontroller

More information

CMPEN 472 Sample EXAM II

CMPEN 472 Sample EXAM II CMPEN 472 Sample EXAM II Name: Student ID number (last 4 digit): Please write your name on every page. Write your solutions clearly. You may use backside of each page for scratch but the solutions must

More information

538 Lecture Notes Week 5

538 Lecture Notes Week 5 538 Lecture Notes Week 5 (October 4, 2017) 1/18 538 Lecture Notes Week 5 Announements Midterm: Tuesday, October 25 Answers to last week's questions 1. With the diagram shown for a port (single bit), what

More information

538 Lecture Notes Week 5

538 Lecture Notes Week 5 538 Lecture Notes Week 5 (Sept. 30, 2013) 1/15 538 Lecture Notes Week 5 Answers to last week's questions 1. With the diagram shown for a port (single bit), what happens if the Direction Register is read?

More information

ECE/CS 5780/6780: Embedded System Design

ECE/CS 5780/6780: Embedded System Design ECE/CS 5780/6780: Embedded System Design Scott R. Little Lecture 8: Interrupt Synchronization Scott R. Little (Lecture 8: Interrupts) ECE/CS 5780/6780 1 / 22 Administrivia Midterm 1 will be on February

More information

LECTURE #21: G-CPU & Assembly Code EEL 3701: Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz

LECTURE #21: G-CPU & Assembly Code EEL 3701: Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz LECTURE #21: G-CPU & Assembly Code EEL 3701: Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz G-CPU Important Notes (see Schwartz s lecture for a general overview) - The

More information

Lab 7: Asynchronous Serial I/O

Lab 7: Asynchronous Serial I/O CpE 390 Microprocessor Systems Lab 7: Asynchronous Serial I/O 1. Introduction Serial communications is the transfer of data, one bit at a time, over a communications channel. Serial communications can

More information

Sample Problem Set #1

Sample Problem Set #1 Sample Problem Set #1 Notes: These problems are typical exam problems; most are drawn from previous homeworks and exams. This exam is open book, open notes. It may help to have a calculator. For partial

More information

ECET Chapter 2, Part 2 of 3

ECET Chapter 2, Part 2 of 3 ECET 310-001 Chapter 2, Part 2 of 3 W. Barnes, 9/2006, rev d. 10/07 Ref. Huang, Han-Way, The HCS12/9S12: An Introduction to Software and Hardware Interfacing, Thomson/Delmar. In This Set of Slides: 1.

More information

0b) [2] Can you name 2 people form technical support services (stockroom)?

0b) [2] Can you name 2 people form technical support services (stockroom)? ECE 372 1 st Midterm ECE 372 Midterm Exam Fall 2004 In this exam only pencil/pen are allowed. Please write your name on the front page. If you unstaple the papers write your name on the loose papers also.

More information

EE319 K Lecture 7. Address mode review Assembler, Debugging Psuedo ops 16 bit timer finite state machines. University of Texas ECE

EE319 K Lecture 7. Address mode review Assembler, Debugging Psuedo ops 16 bit timer finite state machines. University of Texas ECE EE319 K Lecture 7 Address mode review Assembler, Debugging Psuedo ops 16 bit timer finite state machines University of Texas ECE Texas and execution A $24 EEPROM $F800 $F801 $86 $F802 $24 $F803 }ldaa #36

More information

MIGRATING TO THE 68HC12 IN C

MIGRATING TO THE 68HC12 IN C MIGRATING TO THE 68HC12 IN C by Jean-Pierre Lavandier (Cosmic Software) and Greg Viot (Motorola) INTRODUCTION An important design goal of the 68HC12 was to maintain software compatibility with the 68HC11

More information

UNIVERSITY OF MANITOBA DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING. Term Test #2 Solution ECE 3610 MICROPROCESSING SYSTEMS

UNIVERSITY OF MANITOBA DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING. Term Test #2 Solution ECE 3610 MICROPROCESSING SYSTEMS ECE 3610 Test 2 Solution 1 of 7 PRINT LAST NAME: STUDENT NUMBER PRINT FIRST NAME: UNIVERSITY OF MANITOBA DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEERING DATE: Feb. 28, 11; TIME: 6:00-8:00 P.M. Term Test

More information

EMCH 367 Fundamentals of Microcontrollers Example_Sort EXAMPLE SORT

EMCH 367 Fundamentals of Microcontrollers Example_Sort EXAMPLE SORT OBJECTIVE This example has the following objectives: EXAMPLE SORT Review the use of keystroke commands for controlling a process Introduce the concept of multiple sort and its sequential sort equivalent

More information

Serial Communication Through an Asynchronous FIFO Buffer

Serial Communication Through an Asynchronous FIFO Buffer Serial Communication Through an Asynchronous FIFO Buffer Final Project Report December 9, 2000 E155 Nick Bodnaruk and Andrew Ingram Abstract: For our clinic, we need to be able to use serial communication

More information

ECET Chapter 2, Part 3 of 3

ECET Chapter 2, Part 3 of 3 ECET 310-001 Chapter 2, Part 3 of 3 W. Barnes, 9/2006, rev d. 10/07 Ref. Huang, Han-Way, The HCS12/9S12: An Introduction to Software and Hardware Interfacing, Thomson/Delmar. In This Set of Slides: 1.

More information

EE345L Spring 2006 May 10, 2006, 2-5pm Page 1 of 8

EE345L Spring 2006 May 10, 2006, 2-5pm Page 1 of 8 EE345L Spring 2006 May 10, 2006, 2-5pm Page 1 of 8 Jonathan W. Valvano You can use the textbook, but no other materials. You must put your answers in the boxes on the answer pages. You have 3 hours, so

More information

Module 1-G. Marcos and Structured Programming

Module 1-G. Marcos and Structured Programming Module 1-G Marcos and Structured Programming 1 Learning Outcome #1 An ability to program a microcontroller to perform various tasks How? A. Architecture and Programming Model B. Instruction Set Overview

More information

Test ROM V2 for MPU boards System 3, 4, 6, 7 and corresponding driver boards. Author: André Boot corrections in this document by coinop

Test ROM V2 for MPU boards System 3, 4, 6, 7 and corresponding driver boards. Author: André Boot corrections in this document by coinop Test ROM V2 for MPU boards System 3, 4, 6, 7 and corresponding driver boards Author: André Boot corrections in this document by coinop 1. INTRODUCTION... 2 2. INSTALLATION OF THE BOOT TEST ROM... 3 3.

More information

; export symbols ; export 'Entry' symbol. ; include derivative specific macros PORTA EQU $0000 PORTB EQU $0001 DDRA EQU $0002 DDRB EQU $0003

; export symbols ; export 'Entry' symbol. ; include derivative specific macros PORTA EQU $0000 PORTB EQU $0001 DDRA EQU $0002 DDRB EQU $0003 ******************************************************* * This program for CSE472, Flash Memory Writing * * By Kyusun Choi, ID=0000 * * Date: 11/14/2009 * * Freescale CodeWarrior, for the MC9S12C32 Program

More information

EE4390 Microprocessors

EE4390 Microprocessors EE4390 Microprocessors Lesson 6,7 Instruction Set, Branch Instructions, Assembler Directives Revised: Aug 1, 2003 1 68HC12 Instruction Set An instruction set is defined as a set of instructions that a

More information

Motorola HC11. Fun with Microcontrollers and Embedded Systems

Motorola HC11. Fun with Microcontrollers and Embedded Systems Motorola HC11 Fun with Microcontrollers and Embedded Systems Original Source: http://www.soe.ucsc.edu/classes/cmpe012c/winter04/notes/12_microcontrollers.ppt Microcontrollers What is a microcontroller?

More information

MC9S12 Assembler Directives A Summary of MC9S12 Instructions Disassembly of MC9S12 op codes. Summary of HCS12 addressing modes ADDRESSING MODES

MC9S12 Assembler Directives A Summary of MC9S12 Instructions Disassembly of MC9S12 op codes. Summary of HCS12 addressing modes ADDRESSING MODES MC9S12 Assembler Directives A Summary of MC9S12 Instructions Disassembly of MC9S12 op codes o Review of Addressing Modes o Which branch instruction to use (signed vs unsigned) o Using X and Y registers

More information

EE345L Spring 2004 Final Version 3 Page 1 of 8

EE345L Spring 2004 Final Version 3 Page 1 of 8 EE345L Spring 2004 Final Version 3 Page 1 of 8 Jonathan W. Valvano May 12, 2004, 9am-12noon This is a closed book exam. You must put your answers in the boxes on the answer pages. You have 3 hours, so

More information

ASSIGNMENT 3: PLAYING WITH THE 68HC11. Due Wednesday, Oct 9, 2002

ASSIGNMENT 3: PLAYING WITH THE 68HC11. Due Wednesday, Oct 9, 2002 ASSIGNMENT 3: PLAYING WITH THE 68HC11 Due Wednesday, Oct 9, 2002 Introduction In this assignment, you will (1) construct a minimal 68HC11 system on your breadboard, and (2) use the serial port of a computer

More information

Introduction to Microcontrollers III

Introduction to Microcontrollers III Introduction to Microcontrollers III Timing Functions Delay5u.a11, Delay1m.a11 µp Laboratory #3 Data Entry : µp Laboratory #2 Hints Use the pushbutton routine from count.a11 or count_br.a11 (WAIT0 and

More information

Microcontrollers. 2IN60: Real-time Architectures (for automotive systems) Mike Holenderski,

Microcontrollers. 2IN60: Real-time Architectures (for automotive systems) Mike Holenderski, Microcontrollers 2IN60: Real-time Architectures (for automotive systems) Goals for this slide set Describe the architecture of a microcontroller Explain the purpose of an Instruction Set Architecture and

More information

Introduction to Microcontrollers II

Introduction to Microcontrollers II Introduction to Microcontrollers II brset, brclr Indexed Addressing Example µp Laboratory #2 BUFFALO Assembling Code EECE 143 Digital Design Project Purpose: To allow students to design their own digital

More information

EE319 K Lecture 3. Introduction to the 9S12 Lab 1 Discussion Using the TExaS simulator. University of Texas ECE

EE319 K Lecture 3. Introduction to the 9S12 Lab 1 Discussion Using the TExaS simulator. University of Texas ECE EE319 K Lecture 3 Introduction to the 9S12 Lab 1 Discussion Using the TExaS simulator University of Texas ECE Introduction (von Neumann architecture) processor Bus Memory Mapped I/O System Input Devices

More information

Module 2.F. Buffered, Interrupt-Driven Printer Design Example. Tim Rogers 2017

Module 2.F. Buffered, Interrupt-Driven Printer Design Example. Tim Rogers 2017 Module 2.F Buffered, Interrupt-Driven Printer Design Example Tim Rogers 2017 Learning Outcome #2 An ability to interface a microcontroller to various devices How? A. Bus Timing Analysis B. 9S12C Multiplexed

More information

EE 308 Spring The HCS12 has 6 addressing modes

EE 308 Spring The HCS12 has 6 addressing modes The HCS12 has 6 addressing modes Most of the HC12 s instructions access data in memory There are several ways for the HC12 to determine which address to access Effective Address: Memory address used by

More information

EE319K Fall 2010 Exam 1B Page 1

EE319K Fall 2010 Exam 1B Page 1 EE319K Fall 2010 Exam 1B Page 1 First: Last: This is a closed book exam. You must put your answers on pages 1,2,3,4 only. You have 50 minutes, so allocate your time accordingly. Show your work, and put

More information

Introduction to Semaphores. ECE/CS 5780/6780: Embedded System Design. Spin-Lock Counting Semaphore. Spin-Lock Semaphore

Introduction to Semaphores. ECE/CS 5780/6780: Embedded System Design. Spin-Lock Counting Semaphore. Spin-Lock Semaphore Introduction to Semaphores ECE/CS 5780/6780: Embedded System Design Chris J. Myers Lecture 11: Semaphores Semaphores used to implement synchronization, sharing, and communication between threads. A semaphore

More information

Introduction to Semaphores. ECE/CS 5780/6780: Embedded System Design. Spin-Lock Counting Semaphore. Spin-Lock Semaphore

Introduction to Semaphores. ECE/CS 5780/6780: Embedded System Design. Spin-Lock Counting Semaphore. Spin-Lock Semaphore Introduction to Semaphores ECE/CS 5780/6780: Embedded System Design Scott R. Little Lecture 12: Semaphores Semaphores used to implement synchronization, sharing, and communication between threads. A semaphore

More information

Introduction to Microcontrollers III

Introduction to Microcontrollers III Introduction to Microcontrollers III Timing Functions Delay5u.a11, Delay1m.a11 µp Laboratory #3 Data Entry : µp Laboratory #2 Hints Use the pushbutton routine from count.a11 or count_br.a11 (WAIT0 and

More information

; export symbols XDEF Entry ; export 'Entry' symbol ABSENTRY Entry ; for assembly entry point

; export symbols XDEF Entry ; export 'Entry' symbol ABSENTRY Entry ; for assembly entry point **************************************************************** * This program for CMPEN 472, Flash Memory Writing * * By Kyusun Choi, ID=0000 * * Date: 11/15/2017 * * Freescale CodeWarrior, for the HCS12C128

More information

Lecture 7 Assembly Programming: Shift & Logical

Lecture 7 Assembly Programming: Shift & Logical CPE 390: Microprocessor Systems Fall 2017 Lecture 7 Assembly Programming: Shift & Logical Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030

More information

EE 308 Spring A software delay

EE 308 Spring A software delay A software delay To enter a software delay, put in a nested loop, just like in assembly. Write a function delay(num) which will delay for num milliseconds void delay(unsigned int num) volatile unsigned

More information

AN1064. Motorola Semiconductor Application Note. Use of Stack Simplifies M68HC11 Programming By Gordon Doughman. Introduction

AN1064. Motorola Semiconductor Application Note. Use of Stack Simplifies M68HC11 Programming By Gordon Doughman. Introduction Order this document by /D Motorola Semiconductor Application Note Use of Stack Simplifies M68HC11 Programming By Gordon Doughman Introduction The architectural extensions of the M6800 incorporated into

More information

538 Lecture Notes Week 2

538 Lecture Notes Week 2 538 Lecture Notes Week 2 (Sept. 13, 2017) 1/15 Announcements 538 Lecture Notes Week 2 Labs begin this week. Lab 1 is a one-week lab. Lab 2 (starting next week) is a two-week lab. 1 Answers to last week's

More information

Val - the Valet Robot Intelligent Machine Design Lab EEL 5666 Daniel Copeland

Val - the Valet Robot Intelligent Machine Design Lab EEL 5666 Daniel Copeland Val - the Valet Robot Intelligent Machine Design Lab EEL 5666 Daniel Copeland Table of Contents Abstract 3 Introduction 3,4 Mobile Platform 5 Actuation 5,6 Sensors 7-10 Bump Switches 7 Infrared Emitters/Detectors

More information

HC11 Instruction Set

HC11 Instruction Set HC11 Instruction Set Instruction classes 1. Accumulator and Memory 2. Stack and Index Register 3. Condition Code Register 4. Program control instructions CMPE12 Summer 2009 19-2 1 Accumulator and memory

More information