ECE 3610 MICROPROCESSING SYSTEMS AN ENCRYPTED ASCII CODE DECODER

Size: px
Start display at page:

Download "ECE 3610 MICROPROCESSING SYSTEMS AN ENCRYPTED ASCII CODE DECODER"

Transcription

1 ECE 3610 MICROPROCESSIG SYSTEMS A ECRYPTED ASCII CODE DECODER 1

2 PROBLEM SPECIFICATIO Design a microprocessing system to decode messages which are encrypted. Each byte of the message is an encrypted ASCII code. You may use any part from the following in your design: A basic micro-processor (You may use the HC11 or HSC12 instruction set). Three 512x8 ROM chips. Each ROM chip has one active high chip select (CS). One 256x8 ROM chip, with one active high chip select (CS). Eight 32Kx8 RAM chips. Each RAM chip has one active high chip select (CS). One 64x8 RAM chip, with one active high chip select (CS). Many 4-port PCIAs. Each PCIA has one active high chip select (CS). Keypad with given truth table. An ATD converter with the given specifications. A square wave generator with the given specifications. An encrypted ASCII code data supplier with given specifications. ASCII message display unit with given specifications. 2

3 GIVE: KEYPAD KP1 KP0 FUCTIO 0 0 KEY OT PRESSED (KP) 0 1 START PRESSED 1 0 STOP PRESSED 1 1 O FUCTIO KEYPAD KP1 KP0 START STOP 3

4 GIVE: DATA SUPPLIER A device outputs encrypted data as follows: This device outputs encrypted 8-bit words When decrypted, each 8-bit word is an ASCII code. When the device has data ready, it drives its pins with the 8- bit data, and it pulses DR: high-low-high DR Data Supplier 4

5 ECRYPTED ASCII TRUTH TABLE CHAR ASCII CODE UL SOH 01 A1 STX 02 FE ETX EOT F E ECRYPTED CODEWORD CHAR ASCII CODE A B 42 AB C 43 BA D 44 CA E 45 AC F 46 DE G 47 ED H 48 FC I 49 FB J 4A A3 K 4B A5 ECRYPTED CODEWORD 5

6 TOTAL 255 CODEWORDS CHAR ASCII CODE a b 62 AA c 63 FF d e f 66 g h i 69 3F j 6A 77 k 6B 22 ECRYPTED CODEWORD CHAR ASCII CODE DEL 7F B3 C3 FE B2 ECRYPTED CODEWORD 6

7 GIVE: ASCII DISPLAY UIT A device displays ASCII characters To write data to the device: Drive its data pins with an 8-bit ASCII code of the character to be displayed. Then latch the data by providing a negative edge on the LATCH pin. The device will then display the character represented by the ASCII code. LATCH ASCII DISPLAY UIT 7

8 SOLUTIO STARTS HERE 8

9 + 5V PowerOn/Reset Device MIn IRQn RESETn CBUS ABUS μp DBUS The program will continually poll the key pad to input user commands, either START or STOP. VMA Address Decoder φ2 SyRAM_CS PCIA_CS ROM_CS DR DATA SUPPLIER COTROL PAEL START CP1 STOP CP1 A15-A14 8 A8-A0 A5-A0 A4-A0 A8-A0 CS D7-D0 512x8 ROM A5-A0 D7-D0 CS 64x8 SyRAM RS4-RS0 D7-D0 CS 4-Port PCIA PC6 PA7-PA0 PC7 PC4 PC5 PB7-PB0 D7-D0 D7-D0 D7-D0 8 LATCH When the user requests START, the program will execute the following in a loop: Read an encrypted word (byte of data from the DS) Decrypt the byte to ASCII Write the ASCII word (8bit data) to the ASCII Display Unit When the user selects STOP, the program will stop processing the encrypted messages. ASCII CHARACTER DISPLAY DEVICE 9

10 DESCRIPTIO OF DESIG The program will continually poll the key pad to input user commands, either START or STOP. When the user requests START, the program will execute the following in a loop: Read an encrypted word (byte of data from the DS) Decrypt the byte to ASCII Write the ASCII word (8bit data) to the ASCII Display Unit When the user selects STOP, the program will stop processing the encrypted messages. 10

11 Device A15 A14 A13 A12 A11 A10 A9 A8 A7 A6 A5 A4 A3 A2 A1 A0 VMA φ2 ROM PCIA RAM 1 1 x x x x x y y y y y y y y y x x x x x x x x x y y y y y x x x x x x x x y y y y y y 1 1 ROM_CS = A15 A14 VMA φ2 PCIA_CS = A15 A14n VMA φ2 RAM_CS = A15n A14n VMA φ2 ROM_SA: FE00 ROM_EA: FFFF PCIA_SA: 8000 PCIA_EA: 801F RAM_SA: 0000 RAM_EA: 003F 11

12 PCIA EQUATES/MEMORY MAP PCIA_BASE EQU $8000 CRA EQU $8000 DRA EQU $8001 DIRA EQU $8002 IERA EQU $8003 IFRA EQU $8004 PRA EQU $8005 CRB EQU $8008 DRB EQU $8009 DIRB EQU $800A IERB EQU $800B IFRB EQU $800C PRB EQU $800D CRC EQU $8010 KP EQU $8011 DRC EQU $8011 DIRC EQU $8012 IERC EQU $8013 IFRC EQU $8014 PRC EQU $8015 Memory Address PCIA_BASE 8000 CRA 8001 DRA 8002 DIRA 8003 IERA 8004 IFRA 8005 PRA CRB 8009 DRB 800A DIRB 800B IERB 800C IFRB 800D PRB 800E 800F 8010 CRC 8011 DRC 8012 DIRC 8013 IERC 8014 IFRC 8015 PRC Memory Contents 12

13 ROM_BASE EQU $FE00 RAM_BASE EQU $

14 F FFF F 8020 FDFF FE00 FFFF 64 x 8 RAM OT USED 4-PORT PCIA OT USED 512 x 8 ROM The RAM is used for variables and the stack. A ROM is placed at the top of the memory space, because the vector table is designed to be at the top of the memory space in the architecture of the basic μp we are studying in this course. The 4-Port PCIA is mapped from 8000 to 801F. The 4 th port (Port D) is not used. 14

15 SOLUTIO #1 POLLIG METHOD 15

16 Power On or Hardware Reset Reset Function Cf: Page 218, Book LDS SSTACK Hardware Function Software Function PIAIIT Polling 16

17 PCIAIIT FLOW CHART (PORT A) DR DATA SUPPLIER 8 PC6 PA7-PA0 Enter PCIAIIT BSET CRA, $01 Enable PortA: CRA0 1 CLR IERA eed to disable interrupts on these bits for safety. IERA % CLR DIRA BSET PRA, $FF Establish PA7-PA0 as input to receive the 8-bit data from the Data Supplier: DIRA % We don t care about the polarity on the data lines PA7-PA0, but choose something. PRA $FF BCLR IFRA, $FF We don t care about the flags of these bits of Port A, but clear them anyway: IFRA 0 Configure Port B, ext Page. 17

18 PCIAIIT FLOW CHART (PORT B) From Previous Page. LATCH ASCII CHARACTER DISPLAY DEVICE BSET DIRB, $FF BSET PRB, $FF 8 PC7 PB7-PB0 Enable PortB: CRB0 1 BSET CRB, $01 Establish PB7-PB0 as output to send ASCII characters to the Display: DIRB % We don t care about the polarity on the data lines PB7-PB0, but choose something. PRB $FF CLR IERB ot using interrupts on these pins, but need to disable interrupts on these bits for safety. IERB % BCLR IFRB, $FF We don t care about the flags of these bits of Port B, but clear them anyway: IFRB 0 Configure Port C, ext Page. 18

19 PCIAIIT FLOW CHART (PORT C) COTROL PAEL START STOP CP1 CP1 LATCH ASCII CHARACTER DISPLAY DEVICE Enable PortC: CRC0 1 BSET CRC, $01 Establish PC7 as output to latch the data into the Display Device; Establish PC6 as input to receive the DR signal from the Data Supplier; Establish PC5-PC4 as input to receive the Control Panel code: DIRC % BSET DIRC, % BCLR DIRC, % BCLR PRC, $FF 8 PC4 PC5 PC7 PB7-PB0 From Previous Page. Configure the polarity of PC6 to be negative edge sensitive to receive the DR signal, and don t care about the others. PRC % PC6 PA7-PA0 8 DR DATA SUPPLIER CLR IERC ot using interrupts in this example. eed to disable interrupts on these bits for safety. IERC % BCLR IFRC, $FF eed to clear the flag IFRC-6; may as well clear them all: IFRC 0 RTS 19

20 PCIAIIT BSET CRA, $01 CLR DIRA BSET PRA, $FF CLR IERA BCLR IFRA, $FF BSET CRB, $01 BSET DIRB, $FF BSET PRB, $FF CLR IERB BCLR IFRB, $FF BSET CRC, $01 BSET DIRC, % BCLR DIRC, % BCLR PRC, $FF CLR IERC BCLR IFRC, $FF RTS 20

21 ORG RAM_BASE CMD DS.B 1 Enter Polling Subroutine CMD STOP A KP (i.e., DRC) A A % FILTER OUT UWATED BITS CP1 CP0 FUCTIO 0 0 KEY OT PRESSED 0 1 START PRESSED 1 0 STOP PRESSED 1 1 O FUCTIO ext KP EQU $00 START EQU $10 STOP EQU $20 OFUC EQU $30 COTROL PAEL START CP1 STOP CP1 PC4 PC5 A==0 Y CMD A UPDATE CMD CMD== START Y Start CMD== STOP Y Stop 21

22 STOP FLOW CHART Enter Stop Subroutine Return From Stop Subroutine stop rts 22

23 ORG RAM_BASE CMD DS.B 1 Enter Polling Subroutine CMD STOP A KP (i.e., DRC) A A % FILTER OUT UWATED BITS CP1 CP0 FUCTIO 0 0 KEY OT PRESSED 0 1 START PRESSED 1 0 STOP PRESSED 1 1 O FUCTIO ext KP EQU $00 START EQU $10 STOP EQU $20 OFUC EQU $30 COTROL PAEL START CP1 STOP CP1 PC4 PC5 A==0 Y CMD A UPDATE CMD CMD== START Y Start CMD== STOP Y 23

24 ORG RAM_BASE CMD DS.B 1 Enter Polling Subroutine CMD STOP A KP (i.e., DRC) A A % FILTER OUT UWATED BITS CP1 CP0 FUCTIO 0 0 KEY OT PRESSED 0 1 START PRESSED 1 0 STOP PRESSED 1 1 O FUCTIO ext KP EQU $00 START EQU $10 STOP EQU $20 OFUC EQU $30 COTROL PAEL START CP1 STOP CP1 PC4 PC5 A==0 Y CMD A UPDATE CMD CMD== START Y Start 24

25 CMD STOP ext A KP A A % FILTER OUT UWATED BITS update Enter Polling Subroutine A==0 Y CMD A UPDATE CMD cstart ORG RAM_BASE CMD DS.B 1 CMD 0000 Polling ldaa #STOP staa CMD next ldaa KP CMD= CMD= REC anda PLAY #% cmpa #KP beq cstart update staa CMD cstart KP EQU $00 START EQU $10 STOP EQU $20 OFUC EQU $30 DRC EQU $8011 KP EQU $8011 CMD= S Y Y Y Record Playback Stop 25

26 DO POLLIG FLOW CHART Enter CMD STOP P_PTR SBUF_BASE R_PTR SBUF_BASE cstart ldaa CMD cmpa #START A KP A A % bne s1 FILTER OUT UWATED BITS jsr start bra next A=0 Y s1 cmpa #STOP bne next jsr stop next CMD A UPDATE bra CMD next cstart CMD== START Y Start KP EQU $00 START EQU $10 STOP EQU $20 OFUC EQU $30 s1 CMD== STOP Y Stop 26

27 SIMPLIFIED Enter CMD STOP P_PTR SBUF_BASE R_PTR SBUF_BASE cstart ldaa CMD cmpa #START A KP A A % bne next FILTER OUT UWATED jsr BITS start bra next A=0 Y CMD A UPDATE CMD next cstart CMD== START Y Start KP EQU $00 START EQU $10 STOP EQU $20 OFUC EQU $30 27

28 KEYPAD EQUATES KP EQU $00 START EQU $10 STOP EQU $20 OFUC EQU $30 CP1 CP0 FUCTIO 0 0 KEY OT PRESSED 0 1 START PRESSED 1 0 STOP PRESSED 1 1 O FUCTIO 28

29 HOW TO DO THE DECRYPTIO 1. Read the encrypted codeword (8-bit data) from the DS 2. Decrypt the byte to ASCII code 3. Send the ASCII code to the message display unit Read codeword Decrypt Display DR DATA SUPPLIER 8 PC6 PA7-PA0 PC7 PB7-PB0 8 LATCH ASCII CHARACTER DISPLAY DEVICE 29

30 TABLE LOOKUP METHOD STEP #1: CREATE A TABLE I ROM org ROM_BASE TableS dc.b $75, $A1, $FE, TableE dc.b $B2 CHAR ASCII CODE UL ECRYPTED CODEWORD SOH 01 A1 STX 02 FE ETX EOT FE B2 30

31 TABLE LOOKUP METHOD STEP #2: CREATE LOOKUP TABLE FLOW CHART/CODE DR DATA SUPPLIER LATCH ASCII CHARACTER DISPLAY DEVICE 8 8 PC7 PB7-PB0 PC6 PA7-PA0 Return found DRB B PULSE LATCH Y Enter start subroutine ASCII CODE = ACCB = 0 X TableS Y DR IFRC6==1 Y IFRC6 0 A DRA A==(X) B B + 1 X X + 1 X==TableE+1 search org ROM_BASE TableS dc.b $75 ;00 dc.b $A1 ;01 TableE dc.b $B2 ;FE start clrb ldx #TableS brclr IFRC,% ,return bclr IFRC,% ldaa DRA search cmpa 0,X beq found incb inx cpx #TableE+1 bne search bra return found stab DRB bclr DRC,% bset DRC,% return rts 31

32 ALTERATIVE TABLE LOOKUP METHOD FASTER AD LESS CODE METHOD Assume we have a 256x8 ROM starting at $0100. The addresses of this ROM would have the 1 st byte fixed at $01, and the 2 nd byte = Encrypted Codeword: ADDRESS B2 DATA FE 01FE 02 ROM CHAR TRUTH TABLE ASCII CODE UL SOH 01 A1 STX 02 FE ETX EOT FE B2 ECRYPTED CODEWORD For examples: We would put $00 at address $0175, since $75 is the encrypted codeword for ASCII $00. $03 at address $0101, since $01 is the encrypted codeword for ASCII $03. $FE at address $01B2, since $B2 is the encrypted codeword for ASCII $FE. ote that this ROM is 100% populated between $0100 and $01FF. 32

33 ALTERATIVE TABLE LOOKUP METHOD FASTER AD LESS CODE METHOD ADDRESS 0100 DATA B2 FE 01FE 02 ROM DR DATA SUPPLIER 8 brclr IFRC, $40, rtn ldab DRA ldaa #$01 xgdx ldaa 0,X staa DRB bclr DRC, % bset DRC, % bclr IFRC, $40 LATCH ASCII CHARACTER DISPLAY DEVICE 8 PC7 PC6 PB7-PB0 PA7-PA0 CHAR TRUTH TABLE ASCII CODE UL SOH 01 A1 STX 02 FB ETX EOT FE B2 ECRYPTED CODEWORD 33

34 ORG RAM_BASE CMD DS.B 1 ORG RAM_BASE+60 ESTACK DS.B 3 SSTACK DS.B 1 Maximum size of the stack is 4 bytes. This occurs when either the Start or Stop subroutine is called within the Polling subroutine. Therefore the stack occupies space from 003C 003F. CMD 0000 ESTACK 003C SSTACK 003F 34

35 FIRMWARE: ASSEMBLY LAGUAGE IMAGE OF DESIG PCIA_BASE EQU $8000 CRA EQU $8000 DRA EQU $C001 DIRA EQU $8002 IERA EQU $C003 IFRA EQU $8004 PRA EQU $C005 CRB EQU $8008 DRB EQU $C009 DIRB EQU $800A IERB EQU $C00B IFRB EQU $800C PRB EQU $C00D CRC EQU $8010 DRC EQU $C011 DIRC EQU $8012 IERC EQU $C013 IFRC EQU $8014 PRC EQU $C015 ROM_BASE EQU $FE00 RAM_BASE EQU $0000 KP EQU $00 START EQU $10 STOP EQU $20 OFUC EQU $30 ORG RAM_BASE CMD DS.B 1 ORG $FFF8 ISR_Vector FDB Main_SA SWI_Vector FDB Main_SA MI_Vector FDB Main_SA RESET_Vector FDB Main_SA Main_SA ORG ROM_BASE lds #SSTACK jsr PIAIIT Loop jsr Polling bra Loop PCIAIIT BSET CRA, $01 CLR DIRA BSET PRA, $FF CLR IERA BCLR IFRA, $FF BSET CRB, $01 BSET DIRB, $FF BSET PRB, $FF CLR IERB BCLR IFRB, $FF BSET CRC, $01 BSET DIRC, % BCLR DIRC, % BCLR PRC, $FF CLR IERC BCLR IFRC, $FF RTS ORG RAM_BASE+60 ESTACK DS.B 3 SSTACK DS.B 1 35

36 FIRMWARE: ASSEMBLY LAGUAGE IMAGE OF DESIG Polling ldaa #STOP staa CMD next ldaa DRA anda #% cmpa #KP beq cstart update staa CMD cstart ldaa CMD cmpa #START bne s1 jsr start bra next s1 cmpa #STOP bne next jsr stop bra next stop rts start brclr IFRC,% ,return ldaa DRA clrb ldx #TableS bclr IFRC,% search cmpa 0,X beq found incb inx cpx #TableE+1 bne search bra return found stab DRB bclr DRC,% bset DRC,% return rts 36

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

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

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

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

MC68705P3 Bootstrap ROM

MC68705P3 Bootstrap ROM MC68705P3 Bootstrap ROM ;This is a listing of the Bootstrap ROM which resides in Motorola's MC68705P3 single chip ;micros. Its sole purpose is to program its own EPROM by copying the data from an external

More information

Go Gators! Relax! May the Schwartz be with you!

Go Gators! Relax! May the Schwartz be with you! Page 1/12 Exam 1 Instructions: Turn off cell phones beepers and other noise making devices. Show all work on the front of the test papers. If you need more room make a clearly indicated note on the front

More information

Exam 1 Feb. 23, 25, 27?

Exam 1 Feb. 23, 25, 27? Exam 1 Feb. 23, 25, 27? You will be able to use all of the Motorola data manuals on the exam. No calculators will be allowed for the exam. Numbers Decimal to Hex (signed and unsigned) Hex to Decimal (signed

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

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

Introduction to Programming the 9S12 in C Huang Sections 5.2 and 5.3. You will be able to use all of the Motorola data manuals on the exam.

Introduction to Programming the 9S12 in C Huang Sections 5.2 and 5.3. You will be able to use all of the Motorola data manuals on the exam. Introduction to Programming the 9S12 in C Huang Sections 5.2 and 5.3 o Comparison of C and Assembly programs for the HC12 o How to compile a C program using the GNU-C compiler o Using pointers to access

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

University of Florida EEL 4744 Fall 1998 Dr. Eric M. Schwartz

University of Florida EEL 4744 Fall 1998 Dr. Eric M. Schwartz Department of Electrical & Computer Engineering 15 October 199 Professor in ECE 31-Dec-9 12:22 PM Page 1/ Instructions: Show all work on the front of the test papers. If you need more room, make a clearly

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

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

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

A 3-SPEED STEPPER MOTOR

A 3-SPEED STEPPER MOTOR ECE 36 Projects; Stepper Motor 1 of 5 A 3-SPEED STEPPER MOTOR 1. Design a microprocessing system to implement a 3-speed stepper motor. Your design is constrained to use the parts shown in Fig. 1 and described

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

MC68HC12 Parallel I/O

MC68HC12 Parallel I/O EEL 4744C: Microprocessor Applications Lecture 6 Part 2 MC68HC12 Parallel I/O Dr. Tao Li 1 Software and Hardware Engineering (new version): Chapter 11 Or SHE (old version): Chapter 7 And Reading Assignment

More information

It translates (converts) assembly language to machine code.

It translates (converts) assembly language to machine code. Assemblers 1 It translates (converts) assembly language to machine code. Example: LDAA $0180 Uses an instruction set manual: Tests/Final Exam. B6 01 80 Use software: Like the IDE in the Lab. 2 Assembler:

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

Total: EEL 3701 Digital Logic & Computer Systems Final Exam Fall Semester 2007 COVER SHEET: Re-Grade Information: 1 (10) 2 (10) 3 (10) 4 (14) 5 (14)

Total: EEL 3701 Digital Logic & Computer Systems Final Exam Fall Semester 2007 COVER SHEET: Re-Grade Information: 1 (10) 2 (10) 3 (10) 4 (14) 5 (14) COVER SHEET: Prob. Points: Re-Grade Information: Total: 1 (10) 2 (10) 3 (10) 4 (14) 5 (14) 6 (15) 7 (15) 8 (12) (100) 1 Remember to show ALL work here and in EVERY problem on this exam. [10%] 1. Circuit

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

What is an Addressing Mode?

What is an Addressing Mode? Addressing Modes 1 2 What is an Addressing Mode? An addressing mode is a way in which an operand is specified in an instruction. There are different ways in which an operand may be specified in an instruction.

More information

Programming Book for 6809 Microprocessor Kit

Programming Book for 6809 Microprocessor Kit Programming Book for 6809 Microprocessor Kit Wichit Sirichote, wichit.sirichote@gmail.com Image By Konstantin Lanzet - CPU collection Konstantin Lanzet, CC BY-SA 3.0, Rev1.2 March 2018 1 Contents Lab 1

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

MC68705U3 Bootstrap ROM

MC68705U3 Bootstrap ROM MC68705U3 Bootstrap ROM ;This is a listing of the Bootstrap ROM which resides in Motorola's MC68705U3 single chip ;micros. Its sole purpose is to program its own EPROM by copying the data from an external

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

N bit is set if result of operation in negative (MSB = 1) Z bit is set if result of operation is zero (All bits = 0)

N bit is set if result of operation in negative (MSB = 1) Z bit is set if result of operation is zero (All bits = 0) Addition and Subtraction of Hexadecimal Numbers. Setting the C (Carry), V (Overflow), N (Negative) and Z (Zero) bits How the C, V, N and Z bits of the CCR are changed Condition Code Register Bits N, Z,

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

EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1. Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University

EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1. Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1 Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University What is Assembly Language? Assembly language is a programming language

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

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

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

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

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

Freescale Semiconductor, Inc.

Freescale Semiconductor, Inc. Order this document by /D Software I 2 C Communications By Brad Bierschenk MMD Applications Engineering Austin, Texas Introduction I 2 C Overview The I 2 C (inter-integrated circuit) protocol is a 2-wire

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

Lecture 20: Interrupt Devices

Lecture 20: Interrupt Devices Lecture 20: Interrupt Devices Today s Goals Use an edged-triggered interrupt capable device to cause interrupts. Use a time-based interrupt capable device to cause periodic interrupts. Edge-triggered Device

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

AN1742. Programming the 68HC705J1A In-Circuit By Chris Falk CSG Product Engineering Austin, Texas. Introduction. Overview

AN1742. Programming the 68HC705J1A In-Circuit By Chris Falk CSG Product Engineering Austin, Texas. Introduction. Overview Order this document by /D Programming the 68HC705J1A In-Circuit By Chris Falk CSG Product Engineering Austin, Texas Introduction Overview This application note describes how a user can program the 68HC705J1A

More information

Program Development. Chapter 5

Program Development. Chapter 5 Chapter 5 Program Development Expected Outcomes Distinguish between various codes in the programming language Explain the role of assembler and compiler Distinguish between different data types Use directive

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

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

History of the Microprocessor. ECE/CS 5780/6780: Embedded System Design. Microcontrollers. First Microprocessors. MC9S12C32 Block Diagram

History of the Microprocessor. ECE/CS 5780/6780: Embedded System Design. Microcontrollers. First Microprocessors. MC9S12C32 Block Diagram History of the Microprocessor ECE/CS 5780/6780: Embedded System Design Chris J. Myers Lecture 1: 68HC12 In 1968, Bob Noyce and Gordon Moore left Fairchild Semiconductor and formed Integrated Electronics

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

AN1745. Interfacing the HC705C8A to an LCD Module By Mark Glenewinkel Consumer Systems Group Austin, Texas. Introduction

AN1745. Interfacing the HC705C8A to an LCD Module By Mark Glenewinkel Consumer Systems Group Austin, Texas. Introduction Order this document by /D Interfacing the HC705C8A to an LCD Module By Mark Glenewinkel Consumer Systems Group Austin, Texas Introduction More and more applications are requiring liquid crystal displays

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

2. Arithmetic Instructions addition, subtraction, multiplication, divison (HCS12 Core Users Guide, Sections 4.3.4, and ).

2. Arithmetic Instructions addition, subtraction, multiplication, divison (HCS12 Core Users Guide, Sections 4.3.4, and ). AS12 Assembler Directives A Summary of 9S12 instructions Disassembly of 9S12 op codes Huang Section 1.8, Chapter 2 MC9S12 V1.5 Core User Guide Version 1.2, Section 12 o A labels is a name assigned the

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

ECE3120: Computer Systems Hardware & Software Development Tools

ECE3120: Computer Systems Hardware & Software Development Tools ECE3120: Computer Systems Hardware & Software Development Tools Manjeera Jeedigunta http://blogs.cae.tntech.edu/msjeedigun21 Email: msjeedigun21@tntech.edu Tel: 931-372-6181, Prescott Hall 120 Using the

More information

Parallel Interfacing

Parallel Interfacing Chapter 12 Parallel Interfacing Expected Outcomes Identify the internal registers of MC6821 Design the hardware interface for various I/O devices using MC6821 Develop and write codes using MC6821 Parallel

More information

Homework 12 Solutions

Homework 12 Solutions Page 1/6 1. Here is a short program that shows all addressing modes: We are given a table of student's test scores where there are three scores in a semester per student. Unfortunately, the person who

More information

AN1239. HC05 MCU Keypad Decoding Techniques Using the MC68HC705J1A. Introduction

AN1239. HC05 MCU Keypad Decoding Techniques Using the MC68HC705J1A. Introduction Order this document by /D Rev. 1.0 HC05 MCU Keypad Decoding Techniques Using the MC68HC705J1A By David Yoder CSIC Applications Introduction This application note demonstrates the use of a matrix keypad

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

The 9S12 in Expanded Mode - How to get into expanded mode Huang Chapter 14

The 9S12 in Expanded Mode - How to get into expanded mode Huang Chapter 14 The 9S2 in Expanded Mode - How to get into expanded mode Huang Chapter 4 DATA/ADDR (6) HCS2 _ R/W E LSTRB DEMUX ADDR(6) CE _ WE CS _ UB _ LB DATA ADDR CE - Output Enable (Read) _ WE Write Enable CS Chip

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

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

Introduction to Programming the 9S12 in C Huang Sections 5.2 and 5.3

Introduction to Programming the 9S12 in C Huang Sections 5.2 and 5.3 Introduction to Programming the 9S12 in C Huang Sections 5.2 and 5.3 o Comparison of C and Assembly programs for the HC12 o How to compile a C program using the GNU-C compiler o Using pointers to access

More information

BINARY LOAD AND PUNCH

BINARY LOAD AND PUNCH BINARY LOAD AND PUNCH To easily decrease the amount of time it takes to load a long tape (Cassette or paper) a BINARY formatting technique can be used instead of the conventional ASCII format used by the

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

CodeWarrior. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

CodeWarrior. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff CodeWarrior 1 Assembler An assembler is a program that translates assembly language into machine code. Machine code are the numbers that the CPU recognizes as instructions. $B6 $10 $00 Assembly language

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

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

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

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

A Simple MC9S12 Program

A Simple MC9S12 Program A Simple MC9S12 Program All programs and data must be placed in memory between address 0x1000 and 0x3BFF. For our programs we will put the first instruction at 0x2000, and the first data byte at 0x1000

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

CONTENTS. 1.0 Introduction Description of the Circuit Installation Demonstration Examples 3

CONTENTS. 1.0 Introduction Description of the Circuit Installation Demonstration Examples 3 1 CONTENTS PAGE NO 1.0 Introduction 2 2.0 Description of the Circuit 2 3.0 Installation 2 4.0 Demonstration Examples 3 4.1 Demonstration Program for MPS 85-3 Trainer 4 4.2 Demonstration Program for ESA

More information

Lab 2 Part 1 Assembly Language Programming and 9S12 Ports

Lab 2 Part 1 Assembly Language Programming and 9S12 Ports Lab 2 Part 1 Assembly Language Programming and 9S12 Ports In this sequence of three labs, you will learn how to write simple assembly language programs for the MC9S12 microcontroller, and how to use general

More information

Comparison of C and Assembly How to compile a C program using CodeWarrior

Comparison of C and Assembly How to compile a C program using CodeWarrior Comparison of C and Assembly How to compile a C program using CodeWarrior o Using pointers to access contents of specific addresses in C o Including and using derivative.h or hcs12.h to use in MC9S12 port

More information

INTRODUCTION HARDWARE INTERFACE

INTRODUCTION HARDWARE INTERFACE Order this document by AN1241 Interfacing the MC68HC705J1A to 9356/9366 EEPROMs By Mark Glenewinkel CSIC Applications INTRODUCTION This application note describes the hardware and software interface used

More information

EB301. Motorola Semiconductor Engineering Bulletin. Programming EEPROM on the MC68HC811E2 during Program Execution. Freescale Semiconductor, I

EB301. Motorola Semiconductor Engineering Bulletin. Programming EEPROM on the MC68HC811E2 during Program Execution. Freescale Semiconductor, I Order this document by /D Motorola Semiconductor Programming EEPROM on the MC68HC811E2 during Program Execution By Brian Scott Crow Austin, Texas Introduction The Problem The MC68HC811E2 microcontroller

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

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

Experiment No. 7 PARALLEL INTERFACING USING THE PERIPHERAL INTERFACE ADAPTER (PIA) ECE 441

Experiment No. 7 PARALLEL INTERFACING USING THE PERIPHERAL INTERFACE ADAPTER (PIA) ECE 441 Experiment No. 7 PARALLEL INTERFACING USING THE PERIPHERAL INTERFACE ADAPTER (PIA) ECE 441 Peter Chinetti November 21, 2013 1 Introduction 1.1 Purpose Date Performed: November 14, 2013 Partners: Zelin

More information

Lecture 13 Serial Interfaces

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

More information

An ability to program a microcontroller to perform various tasks

An ability to program a microcontroller to perform various tasks Learning Outcome #1 An ability to program a microcontroller to perform various tasks How? A. Architecture and Programming Model B. Instruction Set Overview C. Assembly Control Structures D. Control Structure

More information

Timing Generation and Measurements

Timing Generation and Measurements Timing Generation and Measurements Lab #7 Robert McManus & Junsang Cho April 2, 2004 Timing Generation and Measurements 1. Objective To gain experience using input capture to measure pulse width. To gain

More information

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers o How to disassemble an MC9S12 instruction sequence o Binary numbers are a code and represent what the programmer intends for the

More information

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers o How to disassemble an MC9S12 instruction sequence o Binary numbers are a code and represent what the programmer intends for the

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

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

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

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

AN-HK-32. In-Circuit Programming of FLASH Memory in the MC68HC908GP32. nc... Freescale Semiconductor, I. PART 1 Introduction

AN-HK-32. In-Circuit Programming of FLASH Memory in the MC68HC908GP32. nc... Freescale Semiconductor, I. PART 1 Introduction Order this document by AN-HK-32/H Rev. 2.0 AN-HK-32 In-Circuit Programming of FLASH Memory in the MC68HC908GP32 By T.C. Lun Applications Engineering Microcontroller Division Hong Kong PART 1 Introduction

More information

COSC 243. Instruction Sets And Addressing Modes. Lecture 7&8 Instruction Sets and Addressing Modes. COSC 243 (Computer Architecture)

COSC 243. Instruction Sets And Addressing Modes. Lecture 7&8 Instruction Sets and Addressing Modes. COSC 243 (Computer Architecture) COSC 243 Instruction Sets And Addressing Modes 1 Overview This Lecture Source Chapters 12 & 13 (10 th editition) Textbook uses x86 and ARM (we use 6502) Next 2 Lectures Assembly language programming 2

More information

Controlling the QED Digital-to-Analog Converter from within an Interrupt Service Routine

Controlling the QED Digital-to-Analog Converter from within an Interrupt Service Routine Mosaic Industries Controlling the QED Digital-to-Analog Converter from within an Interrupt Service Routine APPLICATION NOTE MI-AN-059 Summary There are times you may want to control the QED Board s digital-to-analog

More information

68HC12 Training Lab Student Exercise Book

68HC12 Training Lab Student Exercise Book 68HC12 Training Lab Student Exercise Book Date: 13 September, 2000 Document Revision:1.01 BiPOM Electronics 16301 Blue Ridge Road, Missouri City, Texas 77489 USA Telephone: (713) 661-4214 Fax: (281) 416-2806

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

Addition and Subtraction of Hexadecimal Numbers Simple assembly language programming

Addition and Subtraction of Hexadecimal Numbers Simple assembly language programming Addition and Subtraction of Hexadecimal Numbers Simple assembly language programming o A simple Assembly Language Program o Assembling an Assembly Language Program o Simple 9S12 programs o Hex code generated

More information

instruction 1 Fri Oct 13 13:05:

instruction 1 Fri Oct 13 13:05: instruction Fri Oct :0:0. Introduction SECTION INSTRUCTION SET This section describes the aressing modes and instruction types.. Aressing Modes The CPU uses eight aressing modes for flexibility in accessing

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

Lecture 10 I/O and Interrupts

Lecture 10 I/O and Interrupts CPE 390: Microprocessor Systems Spring 2018 Lecture 10 I/O and Interrupts Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030 Adapted from

More information

EEL 4744C: Microprocessor Applications. Lecture 7. Part 2. M68HC12 Interrupt. Dr. Tao Li 1

EEL 4744C: Microprocessor Applications. Lecture 7. Part 2. M68HC12 Interrupt. Dr. Tao Li 1 EEL 4744C: Microprocessor Applications Lecture 7 Part 2 M68HC12 Interrupt Dr. Tao Li 1 Reading Assignment Software and Hardware Engineering (New version): Chapter 12 or SHE (old version) Chapter 8 And

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

ECE 3610 MICROPROCESSING SYSTEMS

ECE 3610 MICROPROCESSING SYSTEMS 24.361 Lab. 4 31 ECE 3610 MICROPROCESSING SYSTEMS Laboratory 4 LAB 4: ASSEMBLER DIRECTIVES, THE STACK, SUBROUTINES, AND BUBBLE SORTING 1 INTRODUCTION This lab deals with the use of the stack and subroutines

More information

EE 308 Spring A software delay. To enter a software delay, put in a nested loop, just like in assembly.

EE 308 Spring A software delay. To enter a software delay, put in a nested loop, just like in assembly. More on Programming the 9S12 in C Huang Sections 5.2 through 5.4 Introduction to the MC9S12 Hardware Subsystems Huang Sections 8.2-8.6 ECT_16B8C Block User Guide A summary of MC9S12 hardware subsystems

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

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

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