Chapter 3: HCS12 Hardware and Software Development Tools. The HCS12 Microcontroller. Han-Way Huang. Minnesota State University, Mankato

Size: px
Start display at page:

Download "Chapter 3: HCS12 Hardware and Software Development Tools. The HCS12 Microcontroller. Han-Way Huang. Minnesota State University, Mankato"

Transcription

1 Chapter 3: HCS12 Hardware and Software Development Tools The HCS12 Microcontroller Han-Way Huang Minnesota State University, Mankato September 2009 H. Huang Transparency No.3-1

2 Development Tools Software Development Tools Text editor: for entering source code using a PC Terminal program: allows a PC to communicate with the demo board Cross assembler: running on a PC to assemble programs written in an assembly language Cross compiler: running on a PC to compile programs written in a high-level language Simulator: running on a PC and allows to user to verify the logic of user programs Source-level debugger: running on a PC and allows the user to verify programs by using breakpoints, watch list, run-to-cursor, and so options to verify the correctness of programs Integrated development environment (IDE): a software running on the PC that combines a text editor, terminal program, cross assembler, cross compiler, and source-debugger and allows the user to switch from one tool to another without quitting any of them. H. Huang Transparency No.3-2

3 Software Tools Used in this Book MiniIDE: consisting of a text editor, a cross assembler, a terminal program, and a simple project manager (a freeware) asmide: consisting of a text editor, a cross assembler, a terminal program, and a simple project manager (a freeware) ICC12: consisting of a text editor, a cross C compiler, a terminal program, and a simple project manager (demo version of ImageCraft product 8 kb size limit) CodeWarrior: consisting of a text editor, a cross assembler, a cross C compiler, driver programs for serial monitor and several BDM adaptors, and a source-level debugger (demo version of Freescale product 32 kb size limit) EGNU and GNU C compiler: consisting of a text editor, a C compiler, a terminal program, and a simple project manager (a freeware) H. Huang Transparency No.3-3

4 Hardware Development Tools BDM-based Debug Adapter The HCS12 provides a background debug module that allows the user to perform software debug activities (set break-point, trace program, execute program to a breakpoint or a certain location, etc) via the serial interface. In-Circuit Emulator (ICE) ICE is an expensive hardware that allows the developer to perform program debug activities before their hardware has been constructed. Demo Board A demo board allows the user to test their programs using the target microcontroller before their final hardware has been constructed. Digital or ordinal Oscilloscope A oscilloscope allows the user to observe the waveform generated from the microcontroller And hence enables the user to verify their program logic. Only demo boards will be discussed. H. Huang Transparency No.3-4

5 Types of Demo Boards Demo Boards with the D-Bug12 Monitor Wytec Dragon12-Plus Wytec Mini-Dragon Demo Boards with the Serial Monitor Wytec Dragon12-Plus Wytec Mini-Dragon Demo Boards with the BDM Adaptor Freescale Project boards with a HCS12DT256 module and a P&E BDM interface Axiom Manufacturing CMD-12DP512 with the Turbo BDM Light (TBDML) interface H. Huang Transparency No.3-5

6 The Dragon12-Plus Demo Board - 24 MHz bus speed (generated from a 4-MHz crystal). - D-Bug12 or serial monitor - 16 x 2 LCD kit (4-bit interface) - Eight LEDs - Four seven-segment displays - Keypad connector - Four buttons for input - DIP switches for input - Buzzer for playing siren and songs (wired to the PT5 pin) - Potentiometer for testing A/D function (wired to PAD7 pin) - Infrared transceiver - CAN transceiver (Philips PCA82C250) - A small breadboard - BDM IN and BDM OUT connectors - Two RS232 connector - LTC bit D/A converter chip with SPI interface - 24LC16 serial EEPROM with I 2 C interface - A DIP switch - A Temperature sensor H. Huang Transparency No.3-6

7 H. Huang Transparency No.3-7

8 The Mini-Dragon Demo Board H. Huang Transparency No.3-8

9 The D-Bug12 Monitor - Supports most HCS12 devices with 128KB and 256 KB flash memory - Used in many demo boards - Requires a host terminal program that supports the Xon/Xoff software handshake for proper operation - The HyperTerminal bundled with Windows and the terminal program bundled with asmide, miniide, ICC12, and EGNU IDE can work with D-Bug12 monitor - Supports four operating modes: EVB mode, Jump to EEPROM mode, POD mode, and Serial Bootloader mode - After reset, the D-Bug12 reads the logic levels on the PAD1 and PAD0 pins to decide which of the four D-Bug12 modes to enter. Table 3.1 D-Bug12 operating modes PAD1 PAD0 Operating mode D-Bug12; EVB Jump to internal EEPROM D-Bug12; POD SerialBootloader H. Huang Transparency No.3-9

10 EVB Mode - The D-Bug12 monitor operates from the flash memory - The users are restricted to use SRAM (from $1000 to $3BFF) or EEPROM to run application programs. - The user runs a terminal program on the PC to communicate with the D-Bug12 monitor on the demo board. - EVB operation model is shown in Figure 3.4. HCS12 demo board target system low-level interface routines D-Bug12 PC running a terminal program User Figure 3.4 EVB model conceptual model - When the demo board is powered up and the baud rate is set properly, the message as shown in Figure 3.5 will appear on the terminal screen. D-Bug b24 Copyright Motorola Semiconductor For Commands type "Help" Figure 3.5 D-Bug12 EVB mode sign on message H. Huang Transparency No.3-10

11 - The D-Bug12 monitor displays the character to indicate it is ready for operation. - When a command issued to D-Bug12 is successfully executed, the monitor displays the execution result and a new character on a new line. - If a command is not successfully executed, one can press the reset button to get out. - An alternative to get out of the unsuccessful command is to press the abort key. - The abort key is connected to the XIRQ signal. - The Dragon12-Plus demo board uses the MC9S12DG256 as their MCU. - The memory maps for these two demo boards are shown in Table 3.2. Table 3.2 D-Bug12 memory map for HCS12Dx256 Address range $0000-$03FF $0400-$0FFF $1000-$3BFF $3C00-$3FFF $4000-$EE7F $EE80-$EEBF $EEC0-$EEFF $EF00-$EF8B $EF8C-$EFFF $F000-$FFFF Description I/O registers on-chip EEPROM on-chip SRAM (available to user) on-chip SRAM (D-Bug12) D-Bug12 code User accessable function table Customization data D-Bug12 startup code Secondary reset/interrupt table Bootloader H. Huang Transparency No.3-11

12 Using the MiniIDE Step 1. Invoke MiniIDE by double clicking the icon of MiniIDE. Step 2. Communicating with the Demo Board. - Press the Terminal menu (shown in Figure C.2) and select Show Terminal Window. - Press the reset button on the demo board and the screen will change to Figure C.3. H. Huang Transparency No.3-12

13 H. Huang Transparency No.3-13

14 H. Huang Transparency No.3-14

15 Step 3. Setting Options. - Set Options can be found under the Build menu and Terminal menu. H. Huang Transparency No.3-15

16 H. Huang Transparency No.3-16

17 Options in General Category H. Huang Transparency No.3-17

18 Options in the Terminal Category H. Huang Transparency No.3-18

19 Options in the Tools Category H. Huang Transparency No.3-19

20 Options in the Assembler Category H. Huang Transparency No.3-20

21 Step 4. Open a new file for entering an assembler program - Press the File menu and select New and the screen is changed to Figure C Enter the program as shown in Figure C Save the file after the whole program is entered. Press the File menu and select Save as shown in Figure C.12 H. Huang Transparency No.3-21

22 H. Huang Transparency No.3-22

23 H. Huang Transparency No.3-23

24 Step 5. Assemble the program. - Press the Build menu and select Build siren.asm as shown in Figure C After a successful assembly, the status window will display the corresponding message as shown in Figure C.14. H. Huang Transparency No.3-24

25 H. Huang Transparency No.3-25

26 Step 6. Download the program onto the demo board. - Type the load command followed by the enter key in the terminal window. - Press the Terminal menu and select Download File (shown in Figure C.15). - A dialog box as shown in Figure C.16 appears. - Enter the name of the file to be downloaded and click on Open. - After a successful download, the screen is changed to Figure C.17. H. Huang Transparency No.3-26

27 H. Huang Transparency No.3-27

28 H. Huang Transparency No.3-28

29 Step 7. Running and debugging the program. - Type g 2000 followed by enter key. - This program will generate a two-tone siren Using the D-Bug12 Commands BF <StartAddress <EndAddress [<Data] - Fill a block of memory locations with the value of <Data. - To fill the memory locations from $1000 to $1FFF with 0, enter the following command: bf FFF 0 MD <StartAddress [< EndAddress ] - Display memory contents from < StartAddress to < EndAddress bytes are displayed on each line. - The <StartAddress is rounded down to the next lower multiple of The <EndAddress is rounded up to the next higher multiple of Only one line is displayed if the EndAddress is not specified. H. Huang Transparency No.3-29

30 md AA C - D7 98 9A 61 - DF BE BC E9-03 AE D0 3D...a...= md AA C - D7 98 9A 61 - DF BE BC E9-03 AE D0 3D...a...= DA DF 39-3F 34 BD A9-2A CA FA DB - AC DA u..9?4..* D 5B 48 BA - B2 F7 B6 1B E5 E4 - A5 E9 01 9F M[H... MDW <StartAddress [<EndAddress] mdw AA85 060C - D798 9A61 - DFBE BCE9-03AE D03D...a...= mdw AA85 060C - D798 9A61 - DFBE BCE9-03AE D03D...a...= DA DF39-3F34 BDA9-2ACA FADB - ACDA 1897 u..9?4..* D5B 48BA - B2F7 B61B E5E4 - A5E9 019F M[H... H. Huang Transparency No.3-30

31 MM <Address [<Data] - Used to examine and modify the contents of memory locations one byte at a time. - If the 8-bit data parameter is present on the command line, the byte at memory location <Address is replaced with <Data and the command is terminated. - If no data is provided, then D-Bug12 enters the interactive memory modify mode. - In the interactive mode, each byte is displayed on a separate line following the address of data. - Single-character sub-commands are used for the modification and verification of memory contents in interactive mode. - The available sub-commands are as follows: [<Data] <CR [<Data] </ or <= [<Data] <^ or <- [<Data] <. Optionally update current location and display the next location. Optionally update current location and redisplay the same location. Optionally update current location and display the previous location. Optionally update current location and exit Memory Modify. H. Huang Transparency No.3-31

32 Example of MM Command mm FF ^ 1001 FF / MMW <Address [<Data] - Allows the contents of memory to be examined and/or modified as 16-bit hex data. - If the 16-bit data is present on the command line, the word at memory location <Address is replaced with <Data and the command is terminated. - If no data is provided, then D-Bug12 enters the interactive memory modify mode. - MMW supports the same set of sub-commands as does the MM command. H. Huang Transparency No.3-32

33 mmw F AA ^ aabb Move <StartAddress <EndAddress <DestAddress - The number of bytes moved is one more than <EndAddress - <StartAddress move ff 1100 RD register display rd PP PC SP X Y D = A:B CCR = SXHI NZVC C E: xx:1521 9C42 CPD $0042 H. Huang Transparency No.3-33

34 RM register modification This command is used to examine or modify the contents of CPU registers. rm PC= SP=0A00 IX= IY=0000 A=00 B=00 ff CCR=90 d1 PC=1500. <RegisterName <RegisterValue - Allow one to change the value of any CPU register. - Each bit of the CCR register can be changed by specifying its name. H. Huang Transparency No.3-34

35 pc 2000 PC SP X Y D = A:B CCR = SXHI NZVC A :FF x 800 PC SP X Y D = A:B CCR = SXHI NZVC A :FF c 0 PC SP X Y D = A:B CCR = SXHI NZVC A :FF z 1 PC SP X Y D = A:B CCR = SXHI NZVC A :FF d 2010 PC SP X Y D = A:B CCR = SXHI NZVC A : H. Huang Transparency No.3-35

36 Table 3.4 Condition code register bits CCR bit name Description Legal Values S H N Z V C IM XM STOP enable Half carry Negative flag Zero flag Two's complement over flg Carry flag IRQ interrupt mask XIRQ interrupt mask 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 0 or 1 ASM <Address - Invokes the one-line assembler/disassembler. - Allows memory contents to be viewed and altered using assembly language mnemonics. - When displaying instructions, each instruction is displayed in its mnemonic form. - The assembly/disassembly process can be terminated by a period. - The one-line assembler displays the current instruction and allows the user to enter new instruction. - User can skip the current instruction by pressing the Enter key. H. Huang Transparency No.3-36

37 The following example displays instruction starting from $2000: asm FC0800 LDD $ CD0900 LDY #$ CE000A LDX #$000A IDIV 200B CB30 ADDB #$30 200D 6B44 STAB 4,Y 200F B7C5 XGDX 2011 CE000A LDX #$000A. The following example enters three instructions (in bold face) starting from $1500: asm FC0800 LDD $ F30802 ADDD $ C0900 STD $ E78C TST 12,SP. H. Huang Transparency No.3-37

38 BR [<Address ] Setting or examine breakpoints - A breakpoint halts the program execution when the CPU reaches the breakpoint address. - When a breakpoint is encountered, the D-Bug12 monitor displays the contents of CPU registers and the instruction at the breakpoint (not executed yet). - Breakpoints are set by typing the breakpoint command followed by one or more breakpoint addresses. - Entering the breakpoint command without any breakpoint addresses will display all the currently set breakpoints. - A maximum of two user breakpoints may be set at one time. br Breakpoints: Breakpoint Table Full ; set three breakpoints H. Huang Transparency No.3-38

39 NOBR [<Address <Address] - Delete one or more previously defined breakpoints - All breakpoints will be deleted if no addresses are specified. br Breakpoints: Breakpoint Table Full nobr 2000 Breakpoints: 2010 ; set four breakpoints ; delete one breakpoints G [<Address] - Begin execution of user code at the specified address. - If no address is specified, CPU starts execution of the instruction at the current PC address. g 1500 User Bkpt Encountered PP PC SP X Y D = A:B CCR = SXHI NZVC C 3C00 7B :E xx:150c 911E CMPA $001E H. Huang Transparency No.3-39

40 GT <Address - Execute instruction until the given address and stop. - User usually needs to specify where the program execution should start before issuing this command. pc 1500 PP PC SP X Y D = A:B CCR = SXHI NZVC C : xx:1500 CF1500 LDS #$1500 gt 1540 Temporary Breakpoint Encountered PP PC SP X Y D = A:B CCR = SXHI NZVC E: xx:1510 3B PSHD H. Huang Transparency No.3-40

41 T [<count] - Used to execute one or multiple instructions starting from the current PC address. - As each program instruction is executed, the CPU register contents and the next instruction to be executed are displayed. - Only one instruction will be executed when no count is specified. pc 1500 PP PC SP X Y D = A:B CCR = SXHI NZVC E: xx:1500 CF1500 LDS #$1500 t PP PC SP X Y D = A:B CCR = SXHI NZVC E: xx:1503 CE1000 LDX #$1000 t 2 PP PC SP X Y D = A:B CCR = SXHI NZVC E: xx: PSHX PP PC SP X Y D = A:B CCR = SXHI NZVC FE E: xx: E LDAA #$1E H. Huang Transparency No.3-41

42 CALL [<Address] - Used to execute a subroutine and returns to the D-Bug12 monitor program. - All CPU registers contain the values at the time the final RTS instruction was executed, with the exception of the program counter. - The program counter contains the starting address of the subroutine when returning from the subroutine. call 1600 Subroutine Call Returned pp PC SP X Y D = A:B CCR = SXHI NZVC A : xx:1600 FC1000 LDD $1000 H. Huang Transparency No.3-42

43 The Pod Mode - This mode is intended to run the demo board as a BDM host to control a target board. - The arrangement is shown in Figure your demo board User Terminal (or PC) D-Bug12 Low-level interface routine Background debug command HCS12 microcontroller Target system Figure 3.19 D-Bug12's POD mode conceptual model H. Huang Transparency No.3-43

44 The Jump-to-EEPROM Mode - Execute a small program from the on-chip EEPROM whenever the EVB is powered up or reset. - This mode provides a way to execute a program in a standalone manner without having to erase and program the on-chip flash memory using the bootloader. The Bootloader Mode - The Bootloader resides from $F000 to $FFFF. - Bootloader can be used to erase and reprogram the remainder of on-chip flash memory or erase the on-chip EEPROM. - Bootloader utilizes the SCI port for communication. - The only required host program is a terminal program that can communicate at 9600 to 115,200 baud and supports XON/XOFF handshaking. - The bootloader mode prompt is as follows: HCS912DP256 Bootloader a) Erase Flash b) Program Flash c) Set Baud Rate d) Erase EEPROM? Figure 3.20 Serial bootloader prompt H. Huang Transparency No.3-44

45 Tips for Assembly Program Debugging Syntax Errors - Misspelling of instruction mnemonics. - Starting instruction mnemonic at column 1. The mnemonic is treated as a label whereas the operands are treated as mnemonic. - Missing operands - Will be highlighted by the assembler and are easy to fix. Logic Errors 1. Using extended (or direct) mode instead of immediate mode - A program with this type of addressing mode error is on the next page. H. Huang Transparency No.3-45

46 N equ 20 ; array count org $1000 array dc.b 2,4,6,8,10,12,14,16,18,20 dc.b 22,24,26,28,30,32,34,36,38,40 sum ds.w 1 org $1500 ldx array ; place the starting address of array in X movw 0,sum ; initialize sum to 0 ldy N ; initialize loop count to N loop ldab 1,x+ ; place one number in B and move array pointer sex B,D ; sign-extend the 8-bit number to 16-bit addd sum ; add to sum std sum ; update the sum dbne y,loop ; add all numbers to sum yet? swi ; return to monitor end - Assemble and download this program onto the demo board. load... done H. Huang Transparency No.3-46

47 - Use the asm command to make sure that the program is downloaded correctly. asm 1500 xx:1500 FE1000 LDX $1000 xx: MOVW $0000,$1014 xx:1509 DD14 LDY $0014 xx:150b E630 LDAB 1,X+ xx:150d B714 SEX B,D xx:150f F31014 ADDD $1014 xx:1512 7C1014 STD $1014 xx: F3 DBNE Y,$150B xx:1518 3F SWI. - Make sure that program data is downloaded correctly. Use the md command: md A 0C 0E A 1C 1E B9 A9-2A CA FA DB - AC DA "$&(...*... H. Huang Transparency No.3-47

48 Run the Program g 1500 User Bkpt Encountered PP PC SP X Y D = A:B CCR = SXHI NZVC C FF: xx: F4 EORA #$F4 Examine the execution result incorrect!! md FF 07 B9 A9-2A CA FA DB - AC DA The program is short. - Errors can be found by tracing. - Set PC to the start of the program (at $1500) pc 1500 PP PC SP X Y D = A:B CCR = SXHI NZVC C FF: xx:1500 FE1000 LDX $1000 H. Huang Transparency No.3-48

49 Trace One Instruction at a time t 1 PP PC SP X Y D = A:B CCR = SXHI NZVC C FF: xx: MOVW $0000,$ The executed instruction is ldx $1000 which should place the start address of the array in X. - The instruction trace result shows that X receives $0104 not $ This is due to addressing mode error. - Change the instruction to ldx #$1000 and rerun the program. - Reload the program and trace the program. - Trace two instruction this time. H. Huang Transparency No.3-49

50 t 2 PP PC SP X Y D = A:B CCR = SXHI NZVC C FF:F xx: MOVW $0000,$1014 PP PC SP X Y D = A:B CCR = SXHI NZVC C FF:F xx:1509 DD14 LDY $0014 md 1010 ; examine sum at $1014~$ FF 00 B9 A9-2A CA FA DB - AC DA We expect the variable sum (at $1014 and $1015) to receive $0000. But it didn t. - The error is again caused by incorrect use of the addressing mode. - The movm 0,sum instruction copies the contents of memory location 0 to sum. - Change the second instruction to movw #0,sum. Rerun the program and examine the memory contents. It is still incorrect!! H. Huang Transparency No.3-50

51 load * g 1500 User Bkpt Encountered PP PC SP X Y D = A:B CCR = SXHI NZVC C00 100F :F xx: F4 EORA #$F4 md F0 B9 A9-2A CA FA DB - AC DA Trace the program up to the third instruction: H. Huang Transparency No.3-51

52 pc 1500 PP PC SP X Y D = A:B CCR = SXHI NZVC C00 100F :F xx:1500 CE1000 LDX #$1000 ; 1 st instruction t 3 PP PC SP X Y D = A:B CCR = SXHI NZVC C :F xx: MOVW #$0000,$1014 ; 2 nd instruction PP PC SP X Y D = A:B CCR = SXHI NZVC C :F xx:1509 DD14 LDY $0014 ; 3 rd instruction PP PC SP X Y D = A:B CCR = SXHI NZVC B 3C F 00:F xx:150b E630 LDAB 1,X+ - The program intends to load 20 into Y with the third instruction and expect Y to be set to 20. But Y did not get 20. It receives F instead. - This is due to the incorrect use of the addressing mode. - Change the instruction to ldy #20 and rerun the program. H. Huang Transparency No.3-52

53 g 1500 User Bkpt Encountered PP PC SP X Y D = A:B CCR = SXHI NZVC A 3C :A xx:151a F421BD ANDB $21BD md A4 B9 A9-2A CA FA DB - AC DA After this correction, sum receives the correct value $1A4 (420). H. Huang Transparency No.3-53

54 Mismatch of Operand Size Example Program Finding the sum of elements of an array N equ 20 ; array count org $1000 array dc.b 2,4,6,8,10,12,14,16,18,20 dc.b 22,24,26,28,30,32,34,36,38,40 sum ds.w 1 org $1500 ldx #array ; place the starting address of array in X movw #0,sum ; initialize sum to 0 ldy #N ; initialize loop count to N loop ldd 1,x+ ; place one number in D and move array pointer addd sum ; add to sum std sum ; update the sum dbne y,loop ; add all numbers to sum yet? swi ; return to monitor end H. Huang Transparency No.3-54

55 The value of sum is incorrect after running the program: md A6 1F B9 A9-2A CA FA DB - AC DA This program can be debugged by tracing: pc 1500 PP PC SP X Y D = A:B CCR = SXHI NZVC C A6:1F xx:1500 CE1000 LDX #$1000 t PP PC SP X Y D = A:B CCR = SXHI NZVC C A6:1F xx: MOVW #$0000,$1014 t PP PC SP X Y D = A:B CCR = SXHI NZVC C A6:1F xx:1509 CD0014 LDY #$0014 t PP PC SP X Y D = A:B CCR = SXHI NZVC C 3C A6:1F xx:150c EC30 LDD 1,X+ H. Huang Transparency No.3-55

56 t PP PC SP X Y D = A:B CCR = SXHI NZVC E 3C : xx:150e F31014 ADDD $1014 The 4th instruction should place the value 2 in D rather than $0204. This is due to the incorrect use of the instruction of ldd 1,x+. This instruction should be replaced by the following two instructions: ldab 1,x+ clra Other logic errors 1. Inappropriate Use of Index Addressing Mode - Indexed addressing mode is often used to step through array elements. - After accessing each element, the index register must be incremented or decremented. - Program execution can t be correct if index register is incremented or decremented incorrectly. - This error can be found after performing computation in the first one or two elements by program tracing. H. Huang Transparency No.3-56

57 2. Stack frame errors This error will be discussed in Chapter Incorrect algorithm - This type of error can be detected by tracing the program. - The user needs to read the program carefully in order to find out the errors. Using CodeWarrior Has a built-in simulator. Supports debugging using the serial monitor resident on the demo board. Has drivers with several BDM-based debug adapters: 1. P&E Multilink/CyclonePro BDM adaptor 2. TBDML adaptor 3. Abatron BDI adaptor 4. Softec s indart debugger H. Huang Transparency No.3-57

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

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 The HCS12

More information

HC12 Microprocessor. D-Bug12 Functions: Stepping Through Programs & Performing I/O. Dr. Bradley J. Bazuin

HC12 Microprocessor. D-Bug12 Functions: Stepping Through Programs & Performing I/O. Dr. Bradley J. Bazuin ECE 2510/4510/5530 HC12 Microprocessor D-Bug12 Functions: Stepping Through Programs & Performing I/O Dr. Bradley J. Bazuin Associate Professor Department of Electrical and Computer Engineering College

More information

Lab 1 MC9S12 Assembler and Monitor

Lab 1 MC9S12 Assembler and Monitor Lab 1 MC9S12 Assembler and Monitor Introduction and Objectives The purpose of this lab is to help you become familiar with your Dragon12-Plus Evaluation Board (EVB), and some of the software tools which

More information

Lab 1 MC9S12 Assembler and Monitor

Lab 1 MC9S12 Assembler and Monitor Lab 1 MC9S12 Assembler and Monitor Introduction and Objectives The purpose of this lab is to help you become familiar with your Dragon12-Plus Evaluation Board (EVB), and some of the software tools which

More information

Reference Guide For D Bug12 Version 2.1.x

Reference Guide For D Bug12 Version 2.1.x Reference Guide For D Bug12 Version 2.1.x A Debug Monitor For The MC68HC912B32 Microcontroller Written By Gordon Doughman Software Specialist Introduction D Bug12 has undergone considerable revision since

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

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

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

Reference Guide For D BugS08 Version 1.x.x

Reference Guide For D BugS08 Version 1.x.x Reference Guide For D BugS08 Version 1.x.x A Debug Monitor For The MC9S08 Family of Microcontrollers That Runs On The MC9S12Dx256, MC9S12A256, MC9S12Dx128, MC9S12H256 & MC9S12A128 Microcontrollers Written

More information

CE-320 Microcomputers I Winter 2010 LAB 1: MINIIDE GROUP #: NAME: PARTNER: Lab 1 Page 1

CE-320 Microcomputers I Winter 2010 LAB 1: MINIIDE GROUP #: NAME: PARTNER: Lab 1 Page 1 LAB 1: MINIIDE GROUP #: NAME: PARTNER: Lab 1 Page 1 LAB 1: MINIIDE GOALS Understand Wytec s Dragon12+ evaluation board Know how to use Dragon12 commands Understand an integrated development environment

More information

CMS-8GP32. A Motorola MC68HC908GP32 Microcontroller Board. xiom anufacturing

CMS-8GP32. A Motorola MC68HC908GP32 Microcontroller Board. xiom anufacturing CMS-8GP32 A Motorola MC68HC908GP32 Microcontroller Board xiom anufacturing 2000 717 Lingco Dr., Suite 209 Richardson, TX 75081 (972) 994-9676 FAX (972) 994-9170 email: Gary@axman.com web: http://www.axman.com

More information

Chapter 4: Advanced Assembly Programming. EE383: Introduction to Embedded Systems University of Kentucky. Samir Rawashdeh

Chapter 4: Advanced Assembly Programming. EE383: Introduction to Embedded Systems University of Kentucky. Samir Rawashdeh Chapter 4: Advanced Assembly Programming EE383: Introduction to Embedded Systems University of Kentucky Samir Rawashdeh With slides based on material by H Huang Delmar Cengage Learning Chapter Summery

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

ECE L A B 1 Introduction ASSEMBLY PROGRAMMING WITH MINIIDE

ECE L A B 1 Introduction ASSEMBLY PROGRAMMING WITH MINIIDE L A B 1 Introduction ASSEMBLY PROGRAMMING WITH MINIIDE The purpose of this lab is to introduce you to the layout and structure of Assembly Language programs and their format. You will write your own programs

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

ECE 331: PC Lab 3 Stack and Subroutines

ECE 331: PC Lab 3 Stack and Subroutines ECE 331: PC Lab 3 Stack and Subroutines Professor Andrew Mason Michigan State University Rev: S11 p.1 Announcements Objectives Topics Outline Review starting and using ASM development environment Pushing

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

Getting Started with the HCS12 IDE

Getting Started with the HCS12 IDE Getting Started with the HCS12 IDE B. Ackland June 2015 This document provides basic instructions for installing and using the MiniIDE Integrated Development Environment and the Java based HCS12 simulator.

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

EE 308 LAB 1 ASSEMBLER, SIMULATOR, AND MONITOR. Introduction and Objectives

EE 308 LAB 1 ASSEMBLER, SIMULATOR, AND MONITOR. Introduction and Objectives EE 308 LAB 1 ASSEMBLER, SIMULATOR, AND MONITOR Introduction and Objectives This laboratory introduces you to the following 68HC12 assembly language programming tools: The 68HC12 assembler CA6812. This

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

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

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud.

Chapter 1. Microprocessor architecture ECE Dr. Mohamed Mahmoud. Chapter 1 Microprocessor architecture ECE 3130 Dr. Mohamed Mahmoud The slides are copyright protected. It is not permissible to use them without a permission from Dr Mahmoud http://www.cae.tntech.edu/~mmahmoud/

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

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

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

Chapter 1 Microprocessor architecture ECE 3120 Dr. Mohamed Mahmoud http://iweb.tntech.edu/mmahmoud/ mmahmoud@tntech.edu Outline 1.1 Computer hardware organization 1.1.1 Number System 1.1.2 Computer hardware

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

CIS-331 Exam 2 Fall 2015 Total of 105 Points Version 1

CIS-331 Exam 2 Fall 2015 Total of 105 Points Version 1 Version 1 1. (20 Points) Given the class A network address 117.0.0.0 will be divided into multiple subnets. a. (5 Points) How many bits will be necessary to address 4,000 subnets? b. (5 Points) What is

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

Exam I Review February 2017

Exam I Review February 2017 Exam I Review February 2017 Binary Number Representations Conversion of binary to hexadecimal and decimal. Convert binary number 1000 1101 to hexadecimal: Make groups of 4 bits to convert to hexadecimal,

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

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

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

Introduction to Embedded Systems and Chapter 1: Introduction to HCS12/MC9S12. EE383: Introduction to Embedded Systems University of Kentucky

Introduction to Embedded Systems and Chapter 1: Introduction to HCS12/MC9S12. EE383: Introduction to Embedded Systems University of Kentucky Introduction to Embedded Systems and Chapter 1: Introduction to HCS12/MC9S12 EE383: Introduction to Embedded Systems University of Kentucky Samir Rawashdeh With slides based on material by H. Huang Delmar

More information

Lecture 5 Assembly Programming: Arithmetic

Lecture 5 Assembly Programming: Arithmetic CPE 390: Microprocessor Systems Spring 2018 Lecture 5 Assembly Programming: Arithmetic Bryan Ackland Department of Electrical and Computer Engineering Stevens Institute of Technology Hoboken, NJ 07030

More information

CIS-331 Fall 2014 Exam 1 Name: Total of 109 Points Version 1

CIS-331 Fall 2014 Exam 1 Name: Total of 109 Points Version 1 Version 1 1. (24 Points) Show the routing tables for routers A, B, C, and D. Make sure you account for traffic to the Internet. Router A Router B Router C Router D Network Next Hop Next Hop Next Hop Next

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

CIS-331 Exam 2 Spring 2016 Total of 110 Points Version 1

CIS-331 Exam 2 Spring 2016 Total of 110 Points Version 1 Version 1 1. (20 Points) Given the class A network address 121.0.0.0 will be divided into multiple subnets. a. (5 Points) How many bits will be necessary to address 8,100 subnets? b. (5 Points) What is

More information

4. Specifications and Additional Information

4. Specifications and Additional Information 4. Specifications and Additional Information AGX52004-1.0 8B/10B Code This section provides information about the data and control codes for Arria GX devices. Code Notation The 8B/10B data and control

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

Introduction to the 9S12 Microcontroller

Introduction to the 9S12 Microcontroller Introduction to the 9S12 Microcontroller o Harvard architecture and Princeton architecture o Memory map for a Princeton architecture microprocessor o 68HC12 Address Space o 68HC12 ALU o 68HC12 Programming

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

Lab 8: Debugging Embedded Devices and Software

Lab 8: Debugging Embedded Devices and Software Lab 8: Debugging Embedded Devices and Software Summary: Given pre-written code, isolate code and functional errors to create a working memory interfacing program. Learning Objectives: Debug and fix pre-written

More information

CIS-331 Exam 2 Fall 2014 Total of 105 Points. Version 1

CIS-331 Exam 2 Fall 2014 Total of 105 Points. Version 1 Version 1 1. (20 Points) Given the class A network address 119.0.0.0 will be divided into a maximum of 15,900 subnets. a. (5 Points) How many bits will be necessary to address the 15,900 subnets? b. (5

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

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

Contents. Join the Technical Community Today!

Contents. Join the Technical Community Today! Contents CHAPTER 1: INTRODUCTION... 5 1. WELCOME... 5 1.2 PS 8051 BOARD OVERVIEW... 6 1.3 PS 8051 SPECIFICATIONS... 7 CHAPTER 2: SYSTEM DESCRIPTION... 9 2.1 HARDWARE... 9 2.2 MAPPING OF DEVICES... 11 2.2.1

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

Microcontrollers and the Freescale/Motorola HC11

Microcontrollers and the Freescale/Motorola HC11 Microcontrollers and the Freescale/Motorola HC11 What is a microcontroller? A computer on a chip used to control electronic devices A microprocessor Usually not cutting edge (4-bit to 32-bit) Dependable

More information

M68HC12A4EVB EVALUATION BOARD USER S MANUAL

M68HC12A4EVB EVALUATION BOARD USER S MANUAL nc. HC12A4EVBUM/D May 1996 M68HC12A4EVB EVALUATION BOARD USER S MANUAL MOTOROLA Inc., 1996; All Rights Reserved nc. Motorola reserves the right to make changes without further notice to any products herein

More information

Chapter 7 Central Processor Unit (S08CPUV2)

Chapter 7 Central Processor Unit (S08CPUV2) Chapter 7 Central Processor Unit (S08CPUV2) 7.1 Introduction This section provides summary information about the registers, addressing modes, and instruction set of the CPU of the HCS08 Family. For a more

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

Programming in the MAXQ environment

Programming in the MAXQ environment AVAILABLE The in-circuit debugging and program-loading features of the MAXQ2000 microcontroller combine with IAR s Embedded Workbench development environment to provide C or assembly-level application

More information

MC9S12 Address Space

MC9S12 Address Space MC9S12 Address Space MC9S12 has 16 address lines MC9S12 can address 2 16 distinct locations For MC9S12, each location holds one byte (eight bits) MC9S12 can address 2 16 bytes 2 16 = 65536 2 16 = 2 6 2

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

indart -HC08 In-Circuit Debugger/Programmer for Freescale HC08 Family FLASH Devices User s Manual Rev. 2.0 Copyright 2006 SofTec Microsystems DC01027

indart -HC08 In-Circuit Debugger/Programmer for Freescale HC08 Family FLASH Devices User s Manual Rev. 2.0 Copyright 2006 SofTec Microsystems DC01027 indart -HC08 In-Circuit Debugger/Programmer for Freescale HC08 Family FLASH Devices User s Manual Rev. 2.0 Copyright 2006 SofTec Microsystems DC01027 SofTec Microsystems E-mail (general information): info@softecmicro.com

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

Gateway Ascii Command Protocol

Gateway Ascii Command Protocol Gateway Ascii Command Protocol Table Of Contents Introduction....2 Ascii Commands.....3 Messages Received From The Gateway....3 Button Down Message.....3 Button Up Message....3 Button Maintain Message....4

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

Input and Output Ports. How do you get data into a computer from the outside?

Input and Output Ports. How do you get data into a computer from the outside? Input and Output Ports How do you get data into a computer from the outside? SIMPLIFIED INPUT PORT D 7 Any read from address $0000 gets signals from outside H C 2 D a t a D D D4 D3 S i g n a l s F r o

More information

CIS-331 Fall 2013 Exam 1 Name: Total of 120 Points Version 1

CIS-331 Fall 2013 Exam 1 Name: Total of 120 Points Version 1 Version 1 1. (24 Points) Show the routing tables for routers A, B, C, and D. Make sure you account for traffic to the Internet. NOTE: Router E should only be used for Internet traffic. Router A Router

More information

Menu Computer Organization Programming Model for the an example microprocessors (the G-CPU & Motorola 68HC11) Assembly Programming Look into my...

Menu Computer Organization Programming Model for the an example microprocessors (the G-CPU & Motorola 68HC11) Assembly Programming Look into my... Menu Computer Organization Programming Model for the an example microprocessors (the G-CPU & Motorola 68HC11) Assembly Programming Look into my... See examples on web: DirAddr.asm, ExtAddr.asm, IndAddr.asm,

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

C1098 JPEG Module User Manual

C1098 JPEG Module User Manual C1098 JPEG Module User Manual General Description C1098 is VGA camera module performs as a JPEG compressed still camera that can be attached to a wireless or PDA host. Users can send out a snapshot command

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

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

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

Small Computer Monitor User Guide

Small Computer Monitor User Guide Small Computer Monitor User Guide Monitor version 0.5 for the Z80 CPU Software and Documentation by Stephen C Cousins Edition 0.5.0 CONTENTS OVERVIEW...3 Conventions... 3 Serial port... 4 RC2014 systems...

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

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

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

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

CIS-331 Spring 2016 Exam 1 Name: Total of 109 Points Version 1

CIS-331 Spring 2016 Exam 1 Name: Total of 109 Points Version 1 Version 1 Instructions Write your name on the exam paper. Write your name and version number on the top of the yellow paper. Answer Question 1 on the exam paper. Answer Questions 2-4 on the yellow paper.

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

Small Computer Monitor User Guide

Small Computer Monitor User Guide Small Computer Monitor User Guide Monitor version 0.3 for the Z80 CPU Software and Documentation by Stephen C Cousins Edition 0.3.0 CONTENTS OVERVIEW... 3 Conventions... 3 Serial Port... 4 RC2014 Systems...4

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

Once the program is installed, a shortcut to the program will be added to your desktop. This will make starting it up easier.

Once the program is installed, a shortcut to the program will be added to your desktop. This will make starting it up easier. ubug12je User Manual Introduction Print Welcome! ubug12je is a Java-based multi-platform program designed specifically to interact with the serial monitors programmed into the Flash of most Technological

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

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

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-470/570: Microprocessor-Based System Design Fall 2014.

ELECTRICAL AND COMPUTER ENGINEERING DEPARTMENT, OAKLAND UNIVERSITY ECE-470/570: Microprocessor-Based System Design Fall 2014. ECE-47/57: Microprocessor-Based System Design Fall 214 Notes - Unit 3 OVERVIEW OF THE HCS12 MICROCONTROLLER The HCS12 is a family of Freescale microcontrollers (MCUs) targeted to automotive and process

More information

The Newest S08/RS08 Tool New breed of SPYDER discovered

The Newest S08/RS08 Tool New breed of SPYDER discovered Inga Harris The Newest S0/RS0 Tool New breed of SPYDER discovered Figre : Core Roadmap Performance/ Integration HC OTP MHz HC0 OTP MHz Past HC MHz HC0 MHz Freescale Semiconductor is a global leader in

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

Most of the HC12 s instructions access data in memory There are several ways for the HC12 to determine which address to access

Most of the HC12 s instructions access data in memory There are several ways for the HC12 to determine which address to access HC12 Addressing Modes Instruction coding and execution o Inherent, Extended, Direct, Immediate, Indexed, and Relative Modes o Summary of MC9S12 Addressing Modes o Using X and Y registers as pointers o

More information

ECE 3120: Computer Systems Chapter 8: ECE-3120-A Musical

ECE 3120: Computer Systems Chapter 8: ECE-3120-A Musical ECE 3120: Computer Systems Chapter 8: ECE-3120-A Musical Manjeera Jeedigunta http://blogs.cae.tntech.edu/msjeedigun21 Email: msjeedigun21@tntech.edu Tel: 931-372-6181, Prescott Hall 120 Output Compare

More information

CIS-331 Final Exam Spring 2015 Total of 115 Points. Version 1

CIS-331 Final Exam Spring 2015 Total of 115 Points. Version 1 Version 1 1. (25 Points) Given that a frame is formatted as follows: And given that a datagram is formatted as follows: And given that a TCP segment is formatted as follows: Assuming no options are present

More information

CIS-331 Final Exam Spring 2018 Total of 120 Points. Version 1

CIS-331 Final Exam Spring 2018 Total of 120 Points. Version 1 Version 1 Instructions 1. Write your name and version number on the top of the yellow paper and the routing tables sheet. 2. Answer Question 2 on the routing tables sheet. 3. Answer Questions 1, 3, 4,

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

EVBQE128. Evaluation Board for Freescale Flexis QE128. User s Manual

EVBQE128. Evaluation Board for Freescale Flexis QE128. User s Manual EVBQE128 Evaluation Board for Freescale Flexis QE128 User s Manual EVBQE128 Evaluation Board for Freescale Flexis QE128 Microcontrollers (80-Pin LQFP) User s Manual Revision 1.1 Copyright 2007 SofTec

More information

Dragon12-Plus2 Trainer

Dragon12-Plus2 Trainer Dragon12-Plus2 Trainer For Freescale HCS12 microcontroller family User s Manual for Rev. A board Version 1.01 Table OF Contents Chapter 1. Introduction... 4 1.1 Welcome... 4 1.2 MC9S12DG256 features and

More information

DRAGON12. EVBplus MC9S12DP256 Development Board. Getting Started Manual. Version 1.14 For REV. D board. Table of Contents GETTING STARTED..

DRAGON12. EVBplus MC9S12DP256 Development Board. Getting Started Manual. Version 1.14 For REV. D board. Table of Contents GETTING STARTED.. DRAGON12 EVBplus MC9S12DP256 Development Board Getting Started Manual Version 1.14 For REV. D board Table of Contents INTRODUCTORY... 1 GETTING STARTED.. 2 SOFTWARE DEVELOPMENT...,. 3 ON-BOARD HARDWARE.

More information

Mark II Aiken Relay Calculator

Mark II Aiken Relay Calculator Introduction to Embedded Microcomputer Systems Lecture 6.1 Mark II Aiken Relay Calculator 2.12. Tutorial 2. Arithmetic and logical operations format descriptions examples h 8-bit unsigned hexadecimal $00

More information

Systems/DBG Debugger Version 2.20

Systems/DBG Debugger Version 2.20 Systems/DBG Debugger Version 2.20 Copyright c 2018, Dignus, LLC Systems/DBG Debugger Version 2.20 i Copyright c 2018 Dignus LLC, 8378 Six Forks Road Suite 203, Raleigh NC, 27615. World rights reserved.

More information

Microcontrollers. Microcontroller

Microcontrollers. Microcontroller Microcontrollers Microcontroller A microprocessor on a single integrated circuit intended to operate as an embedded system. As well as a CPU, a microcontroller typically includes small amounts of RAM and

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

Example Programs for 6502 Microprocessor Kit

Example Programs for 6502 Microprocessor Kit Example Programs for 6502 Microprocessor Kit 0001 0000 0002 0000 GPIO1.EQU $8000 0003 0000 0004 0000 0005 0200.ORG $200 0006 0200 0007 0200 A5 00 LDA $0 0008 0202 8D 00 80 STA $GPIO1 0009 0205 00 BRK 0010

More information

ECHO Process Instrumentation, Inc. Modbus RS485 Module. Operating Instructions. Version 1.0 June 2010

ECHO Process Instrumentation, Inc. Modbus RS485 Module. Operating Instructions. Version 1.0 June 2010 ECHO Process Instrumentation, Inc. Modbus RS485 Module Operating Instructions Version 1.0 June 2010 ECHO Process Instrumentation, Inc. PO Box 800 Shalimar, FL 32579 PH: 850-609-1300 FX: 850-651-4777 EM:

More information

Session 1520 EXPERIENCE OF TEACHING THE PIC MICROCONTROLLERS

Session 1520 EXPERIENCE OF TEACHING THE PIC MICROCONTROLLERS Session 520 EXPERIENCE OF TEACHING THE PIC MICROCONTROLLERS Han-Way Huang, Shu-Jen Chen Minnesota State University, Mankato, Minnesota/ DeVry University, Tinley Park, Illinois Abstract This paper reports

More information