*********************************************** * MOR Byte Definition * *********************************************** org MOR fcb $20

Size: px
Start display at page:

Download "*********************************************** * MOR Byte Definition * *********************************************** org MOR fcb $20"

Transcription

1 * PULSE_V2.ASM - Pulse Generator * * Version * * Real-Time version * * Problems: * * 1- wrong timing cause step > 1 for value * * encoder * * 2- Delay initialize to 0002 with InitDelay * * 3- PB3 not used * * * * using Bourns Encoders * * cleaned up CLK routine, added Power On Msg * * LCD 2 lines - 16 charac. * * MOR Byte Definition * org MOR fcb $20 $BASE 10T ; decimal base * RAM Variables Declaration **************** org ram temp rmb 1 atemp rmb 1 Cfine rmb 1 ; coarse(1)/fine(0) & unit advance flag param rmb 1 ; Param=Clk Per(0,first), Out2 Del(11,last) uflag rmb 1 ; value(0)/units(ffh) flag O12flag rmb 1 ; Out1/Out 2 flag chgflag rmb 1 ; parameter changed flag MSB rmb 1 LSB rmb 1 Units rmb 1 ; tempo units var : 0=us, 1=ms, 2=sec unittens rmb 1 ; tempo paramlo var HunThous rmb 1 ; " paramhi var clkperlo rmb 1 ; ex. ClkPer=3102 unittens=02,hunthous=31 clkperhi rmb 1 ; clkperlo=02,clkperhi=31 clkunit rmb 2 ; Clk unit: 0=us, 1=ms, 2=sec Out1Perlo rmb 1 Out1Perhi rmb 1 ; Variables clkper to Out2Del are listed in the Out1Punit rmb 2 ; same order as displayed on LCD, so can use Out1Widlo rmb 1 ; param value as offset to access variables Out1Widhi rmb 1 ; starting at clkperlo Out1Wunit rmb 2 Out1Dello rmb 1 Out1Delhi rmb 1 Out2Perlo rmb 1 Out2Perhi rmb 1 Out2Punit rmb 2 Out2Widlo rmb 1 Out2Widhi rmb 1 Out2Wunit rmb 2 Out2Dello rmb 1 Out2Delhi rmb 1 DelayFlag rmb 1 ; at start init delay to 2 (0), don't (1) * Program in ROM **************** org rom Page 1

2 start sei clra sta porta sta portb lda #$FF sta ddra lda #$1b sta ddrb bset 4,portb ; Disable interrupt during setup ; zero out po a,b ; define PORT A as output ; reg A to Data Direction Register B ; make PB0,1,3,4 outputs ; PortB ; $1b = ; PB0 is LCD RS, 9513 A0 ; PB1 is LCD Enable ; PB2 is VALUE Encoder OUT#2 ; PB3 is unused ; PB4 is WR output ; PB5 is PARAMETER Encoder Common & ; Coarse/fine Unit adv. switch ; -IRQ is VALUE Encoder OUT#1 ; PA0 drives PARAMETER Encoder OUT#2 ; PA1 drives PARAMETER Encoder OUT#1 ; PA2 drives Coarse/fine unit adv switch ; raise the WR line ; Diactive 9513 from the bus, now ; can access LCD jsr lcd_init ; initialize LCD jsr lcd_clr ; and clear it ldx #112 s ; Power on message lda #255 ; debug value is 1 x1: jsr lcd_dlay ; delay 6 ms deca ; leave up for approx 1 sec bne x1 ; (255 * 6 ms = 1.5 sec) jsr InitScreen jsr ClrVars lda #$82 sta ISCR sta chgflag cli ; place ' CLOCK PER. ' message up ; Reset all variables ; enable IRQ and reset flag ; ISCR (IRQ Status/Control Reg) ; bit 7=1 Clear IRQ interrupt & IRQF flag ; set change flag so values displayed ; enable interrupts ******************* * OPERATE LOOP * ******************* Loop: lda DelayFlag ; Delay initialized? bne L1A jsr InitDelay ; Init delay Out1,Out2 to 0002 at start L1A: jsr GetSwitches ; If parameter, choose & display message ; Check also C/F toggle & Unit switch lda chgflag ; chgflag value changed by Param or Value ; service Request routines beq loop ; loop if no change lda #$40 ; $40=address 1st character, 2nd line jsr lcd_movcurs ; go to line 2 to change value lda uflag ; Display Value(0) or Unit($FF) beq L1 jsr DispUnits ; Display unit if unit parameter bra L2 ; Or Page 2

3 L1: jsr DispBCD2 ; Display value if value parameter L2: lda #$4F ; $4F=address 16rd character, 2nd line jsr lcd_movcurs ; Go to cursor position to change C of F lda cfine beq L3 lda #'C' ; Display C for Coarse bra L4 L3: lda #'F' ; Display F for Fine L4: sei ; disable param advance interupts til 9513 loaded jsr Init9513 jsr set9513 clr chgflag cli bra loop ; 9513 Software reset et init. ; Set Timer 5 to produce Clock square wave output ; Set Timers 1,2 to produce Per,Width,Del Out1 ; Set Timers 3,4 to produce Per,Width,Del Out2 ; Reset chgflag ; re-enable interrupt DispUnits: lda Units beq DU1 cmp #1 beq DU2 lda #'s' lda #'e' lda #'c' bra DU4 ; Display SEC unit DU1: lda #'u' ; Display us unit lda #'s' DU3: lda #' ' DU4: lda #' ' DU2: lda #'m' ; Display ms unit lda #'s' bra DU3 * * Init Delay Out1 & 2 to 0001 at start * * InitDelay: lda #2 ; Set value to 2 sta Out1Dello sta Out2Dello sei jsr Init9513 jsr set9513 cli inc DelayFlag ; disable param advance interupts til 9513 loaded ; 9513 Software reset et init. ; Set 9513 registers ; re-enable interrupt ; Set once Delay Init is done ;********** ; Display 4 digits * Page 3

4 ; ENTRY: 4 BCD values in UnitTens,HunThous * ;********** DispBCD2 ; First, display MSB of HunThous lda HunThous ;ex: A=HunThous=$72 lsra ;Logical shift right A register lsra ;This bring Value MSB to LSB position to add lsra ;$30 to it to access 0-9 character set lsra ;ex: A=$07, we loose LSB value 2 BCD ;A=$07+$30=$37, display = 7XXX ; Then, display LSB of HunThous lda HunThous ; Mask MSB to have only LSB in A and #$0f ; ex: A=$72 AND $0F=02 BCD ;A=$02+$30=$32, display = 72XX lda UnitTens lsra lsra lsra lsra BCD lda UnitTens and #$0f BCD ********************************************** * Parameter encoder & C/F/Unit switch * * service routine. Value encoder is read * * by interrupt, see QuadISR routine * * * * JSR DispMess before leaving * * if C/F Switch --> ChgFlag= #3 on exit * * param unit is set correctly and * * C/F is toggle if requested * ********************************************** GetSwitches: lda #1 sta porta brclr 5,portb,GS4 GS0: ; Active CCW side with PA0=1 ; PARAMETER encoder #1 switch is open ; read COM pin on PB5 ; PARAM encoder being moved lda #2 ; Active CW side with PA1=1 sta porta brclr 5,portb,GS2 ; Counter clockwise motion ; increment the parameter lda param ; Param=Clk Per(0), Out2 Del(11) inca cmp #12 ; Last param = 11+1 = 12 bne GS0 deca sta param jsr DispMess ; stop at last parameter GS1 lda #7 sta porta GS3: brset 5,portb,GS3 ; wait til PARAM encoder stopped & ; coarse/fineswitch released jsr lcd_dlay ; 6 ms debounce GS2: ; decrement the parameter lda param Page 4

5 GS7: deca cmp #$ff bne GS7 clra sta param jsr DispMess bra GS1 GS4: lda #4 ; Check C/F Switch with PA2 sta porta brclr 5,portb,GS3 ; no switched depressed, then exit ; Coarse Fine Toggle/ units advance button pressed lda #3 sta chgflag lda uflag beq GS5 ; Units parameter so advance to next unit lda #3 inc units ; units: 0=us, 1=ms, 2=sec, last=3 cmp units bne GS6 clr units ; Variables ClkPerLo to Out2Dello are listed in RAM in the same order they ; are displayed on LCD. param = display order, so can be used ; as indexed offset to access and store the correct unit GS6: ldx param lslx ; each param is 2 bytes, shift left = 2X lda units ; to jump 2 bytes sta ClkPerLo,x ; store unit: start from ClkPerLo + offset bra GS1 ; ex: Out1Wunit: param=5=0101-lsl->1010=offset 10 ; sta at ClkPerLo+10 --> pointe Out1Wunit ; offset are: Clk(+2) Out1Per(+6) Out1W(+10) ; Out2Per(+16), Out2W(+20) ; value parameter so toggle coarse/fine flag GS5: lda Cfine coma and #1 sta Cfine bra GS1 DispMess: lda #3 sta chgflag clra sta O12flag jsr lcd_movcurs lda param cmp #7 blo PA0 ; Clock or OUT 1 params sub #5 sta temp ; point to proper message for OUT#1 lda #1 sta O12flag ; Out 2 lda temp PA0: ldx #16 mul tax s lda O12flag beq PA4 Page 5

6 lda #3 jsr lcd_movcurs lda #'2' PA4: lda param cmp #1 beq PA5 cmp #3 beq PA5 cmp #5 ; Units parameters?? beq PA5 cmp #8 beq PA5 cmp #10 beq PA5 ; param is a value so load UnitTens,HunThous from Timer BCD vars clr Uflag ;uflag=0 --> value lda #1 sta cfine ; set up for coarse adj to start ldx param lslx ; each par is 2 bytes lda ClkPerLo,x sta UnitTens lda ClkPerHi,x sta HunThous ; param is a unit so load unit var from Timer vars PA5: clr Uflag dec Uflag ldx param lslx ; each par is 2 bytes ( though only 1 needed for units) lda ClkPerLo,x sta Units InitScreen: clra jsr lcd_movcurs clrx s ***** * VALUE Encoder Interrupt Service Request * ***** QuadISR: lda #3 sta chgflag brset 2,portb,QuadUp ; jsr lcd_wait ; 0.3 ms PB2 debounce delay ; jsr lcd_dlay ; 6 ms debounce QuadDown: lda cfine ; Coarse (1) or Fine (0) bne Q1 jsr decr ; Decr Fine bra Quadexit Q1: jsr D3A ; Decr Coarse bra Quadexit Page 6

7 QuadUp: ;jsr lcd_wait ; 0.3 ms PB2 debounce delay ;jsr lcd_dlay ; 6 ms debounce lda cfine bne Q2 jsr incr ; Incr Fine bra Quadexit Q2: jsr I3A ; Incr Coarse QuadExit: lda uflag bne R2 R1: ; Store displayed BCD value to proper variable ldx param ; use param as index to access proper var. lslx ; each param is 2 bytes (LSL = X2) lda UnitTens sta ClkPerLo,x ;ClkPerLo=Start offset for param UnitTens lda HunThous sta ClkPerHi,x ;ClkPerHi=Start offset for param UnitThous R2: bil R2 bset 1,iscr rti Incr: inc UnitTens lda UnitTens and #$0f cmp #10 beq I2 I2: lda UnitTens and #$f0 add #$10 sta UnitTens cmp #$A0 beq I3 I3: clr UnitTens I3A: inc HunThous lda HunThous and #$0f cmp #10 beq I4 I4: lda HunThous and #$f0 add #$10 sta HunThous cmp #$A0 beq I5 I5: clr HunThous ; Mask out upper nibble Decr: dec UnitTens lda UnitTens cmp #$ff beq D3 and #$0f cmp #$0f beq D2 Page 7

8 D2: lda UnitTens and #$f0 add #$09 sta UnitTens D3: lda #$99 sta UnitTens D3A: dec HunThous lda HunThous cmp #$ff beq d5 and #$0f cmp #$0f beq D4 D4: lda HunThous and #$f0 add #$09 sta HunThous D5: lda #$99 sta HunThous *************************** * Clear all Variables * *************************** ClrVars: lda #50 ;50 RAM locations to reset from top sta temp ;Save nb of location to erase in temp clrx ;Reset X offset clra ;Put A=0 in RAM to reset variable CV1 sta Atemp,x ;Start to erase from Atemp then to the following incx ;byte at location of Atemp+X offset dec temp bne CV1 inc cfine ; set C/F to Coarse ; temp=0 when leaving ***** * LCD routines * ***** *Function names - lcd_clr Clears display - no regs used * - lcd_init Initializes LCD device- MUST be invoked first * - lcd_write Writes char in A at current cursor position * Cursor auto increment * - lwritec Send command to LCD lcd_init ; delay to allow LCD panel to "Wake up" lda #100 ; debug value is 1 li1: jsr lcd_dlay ; delay 6 ms deca bne li1 *********** LCD Functions Setup ******************** lda #$38 jsr lwritec jsr lcd_dlay ;LCD Function Set ;8 bits, dual line ;Delay 6 ms Page 8

9 jsr lcd_dlay lda #$0E jsr lwritec jsr lcd_dlay ;Display On/Off ;Active Display & Cursor lcd_clr lda #$01 ;Command Display Clear jsr lwritec ;Exec time 1.64 ms jsr lcd_dlay lcd_movcurs ; Move cursor to address in A add #$80 ; bit7=1 LCD RAM address mode jsr lwritec ; bit6-0, address, 1st line 00-0Fh ; 2nd line 40-4Fh lcd_wait sta temp lda #$60 ; debug value is 2 lcdw1 deca ; delay= 96*6*0.5us=0.3ms bne lcdw1 lda temp lcd_writebcd ; Write BCD cause numbers are 0-9=BCD code add #$30 ; LCD character set is access in two nibbles bra lcd_write ; 1st must be $3 to access number 0-9 ; so value to display + $30 = 3 + number ; ex: to display 2, A=$02+$30=$32 ************************************ * 6ms delay * ************************************ lcd_dlay sta temp ; Save A into temp lda #8 ; debug value is 1 sta atemp ; 8 *.768ms = ms lcdd0 clra ; correct line ;lcdd0 lda #2 ; debug lcdd1 deca ;0-FF, FF-FE, = 256 loops bne lcdd1 ;256*6* 1/2 us =.768ms dec atemp ;256 = A from 0 to 0 again bne lcdd0 ;6 = nb of cycle for the loop lda temp ;1/2 us = command clock period lwritec bclr 0,portb ; RS low bra ld1 lcd_write bset 0,portb ; RS high ld1: bclr 1,portb ; E low sta prta ; data out to porta bset 1,portb ; strobe ENABLE bclr 1,portb jsr lcd_wait lcd_writes ;Write line 1 of LCD with selected message z0: lda mess1,x ;X contains address of message beq z1 ;mess1 X=00 mess6 X=80 Page 9

10 ; incx ; bra z0 ; 4 48 z1: ; 5 64 *********************** * * * 9513 STC loading routines,see manual p * * for command codes * *********************** Init9513: ;Software Init, see 9513 manual p. 2-3 lda #$ff ; $FF = Reset software lda #$5f ; $5F = Load & arm all counters lda #$17 ; $17 = Point to Master Mode Register lda #$df ; $DF = Disarm all timers ****** load 9513 Master Mode Register **************** ; ; C A F 0 ; ; C = BCD Division, Disable incr., bus 8 bits, Fout ON ; A = Fout / 10 ; F = Fout source is F5 ; 0 = TOD disable, Compare 1 & 2 disabled ; lda #$f0 ; LSB lda #$ca ; MSB of 16 bits word LD9513Ctrl: sta porta bset 0,portb ; Set C/-D line, Select Control Port ; C = Control, D = Data bclr 4,portb ; strobe -WR line bset 4,portb ; Transfert bus data to selected location LD9513Data: sta porta bclr 0,portb ; Clr C/-D line bclr 4,portb ; strobe -WR line bset 4,portb ***************************************** * Load Div. by ratio for PERIOD * * Entry A is Data pointer index * * LSB,MSB are two packed * * BCD values to load into counter * ***************************************** SetPeriod: lda LSB lda MSB Page 10

11 ******************************************** * Timer 1,3 are Div by N Rate generator * * which produces the PERIOD of OUTPUT #1,2 * * Mode D, BCD down count,high TC pulse * * Entry A points to C1,C3 Mode Register * * X contains CountSource nibble * ******************************************** SetTimer13: lda #$31 txa ; Rep.count,BCD count Down, High TC pulse ; No gating,ris edge count,source per nibble in X ******************************************** * Timer 2,4 are Delay,Width generators * * for OUTPUTS #1,2 * Mode L, BCD down count,tc toggled * * Entry A points to C2,C4 Mode Register * * X contains CountSource nibble * ******************************************** SetTimer24: lda #$72 txa ; Rep.count,BCD count Down, TC toggled ; N gate,ris edge count,source per nibble in X ** * Set all 9513 registers * * Order of execution is: Set9513 * * jsr SetPeriod * * SetPeriod * * SetOut1 * * SetOut2 * * Set9513 * ** Set9513: ;First determine the CLOCK units ldx #$0b ; F1 clk source (default) lda clkunit beq SC3 ; leave F1 source intact cmp #1 beq SC2 ; units are seconds use F5 SC1: ldx #$0f bra SC3 ; units are millisecs use F4 SC2: ldx #$0e SC3: lda #$05 jsr LD9513ctrl ; point to Timer 5 Mode register lda #$32 ; Mode D,BCD, Down count,outputtoggled jsr LD9513data txa Page 11

12 jsr LD9513data lda clkunit cmp #2 bne SC4 lda clkperlo clr LSB bra SC5 ; No gating, Risedge count ; CLK Source according to value in X ; unit not seconds ; shift value by 100 as clk is sec/100 SC4 lda clkperlo sta LSB lda clkperhi SC5 lda #$0d ; point to Timer 5 Load Register jsr Setperiod ****************** * Set up OUT #1 (Timers 1 and 2 ) * ****************** SetOut1: ; first set Timer 1 for Period ldx #$0b lda Out1Punit beq SO3 ; leave F1 source intact cmp #1 beq SO2 ; units are seconds use F5 SO1: ldx #$0f bra SO3 ; units are millisecs use F4 SO2: ldx #$0e SO3: lda #1 ; point to Timer1 Mode reg. jsr SetTimer13 lda Out1Punit cmp #2 bne SO4 ; unit not seconds lda Out1Perlo ; shift value by 100 as clk is sec/100 clr LSB bra SO5 SO4 SO5 SP1: lda Out1Perlo sta LSB lda Out1Perhi lda #$09 ; point to Timer1 Load register jsr SetPeriod ; now set delay and width ldx #$cb lda Out1WUnit beq SP3 ; leave F1 source intact cmp #1 beq SP2 ; units are seconds use F5 ldx #$cf Page 12

13 bra SP3 ; units are millisecs use F4 SP2: ldx #$ce ; X contains CountSource nibble SP3: lda #2 ; point to Timer2 Mode reg. jsr SetTimer24 lda Out1Wunit cmp #2 bne SP4 ; unit not seconds lda Out1Widlo ; shift value by 100 as clk is sec/100 clr LSB bra SP5 SP4 SP5 lda Out1Widlo sta LSB lda Out1Widhi lda #$12 ; point to Timer2 Hold register jsr SetPeriod lda Out1Dello sta LSB lda Out1delhi lda #$0a ; point to Timer2 Load Register jsr SetPeriod lda #$43 ; load counters 1,2 jsr LD9513ctrl lda #$E2 ; clear the OUT 2 Toggle F-F jsr LD9513ctrl ****************** * Set up OUT #2 (Timers 3 and 4 ) * ****************** SetOut2: TO1: TO2: ; first set Timer 3 for Period ldx #$0b lda Out2Punit beq TO3 ; leave F1 source intact cmp #1 beq TO2 ; units are seconds use F5 ldx #$0f bra TO3 ; units are millisecs use F4 ldx #$0e bra TO3 ldx #$0b TO3: lda #3 ; point to Timer3 Mode reg. jsr SetTimer13 lda Out2Punit cmp #2 bne TO4 ; unit not seconds lda Out2Perlo ; shift value by 100 as clk is sec/100 clr LSB bra TO5 TO4 lda Out2Perlo sta LSB Page 13

14 TO5 lda Out2Perhi lda #$0B ; point to Timer3 Load register jsr SetPeriod ; now set delay and width ldx #$cb lda Out2WUnit beq TP3 ; leave F1 source intact cmp #1 beq TP2 ; units are seconds use F5 TP1: ldx #$cf bra TP3 ; units are millisecs use F4 TP2: ldx #$ce TP3: lda #4 ; point to Timer4 Mode reg. jsr SetTimer24 lda Out2Wunit cmp #2 bne TP4 ; unit not seconds lda Out2Widlo ; shift value by 100 as clk is sec/100 clr LSB bra TP5 TP4 TP5 lda Out2Widlo sta LSB lda Out2Widhi lda #$14 ; point to Timer4 Hold register jsr SetPeriod lda Out2Dello sta LSB lda Out2delhi lda #$0C ; point to Timer4 Load Register jsr SetPeriod lda #$5C ; load counters 3,4,5 jsr LD9513ctrl lda #$E4 ; clear the OUT 4 Toggle F-F jsr LD9513ctrl lda #$3f ; arm all timers ; Return from Set9513 routine * Messages * mess1: db 'Clk Per. Value ' mess2: db 'Clk Per. Units ' mess3: db 'Out1 Per. Value' mess4: db 'Out1 Per. Units' mess5: db 'Out1 Wid. Value' mess6: db 'Out1 Wid. Units' Page 14

15 mess7: db 'Out1 Del. Value' mess8: db 'Pro21 Ver 2.0 ' * Vectors Init. * org $7f8 dw start dw QuadISR dw start dw start ; Vectors starting address ; Timer vector ; External Interrupt Vector (Value Encoder) ; Software Interrupt Vector (SWI) ; RESET pin Interrupt Page 15

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

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

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

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

Freescale Semiconductor, I

Freescale Semiconductor, I Application Note Rev. 1, 11/2001 Interfacing the MC68HC05C5 SIOP to an I 2 C Peripheral By Naji Naufel Introduction SIOP Definition When designing a system based on a standard, non-custom designed, microcontroller

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

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

INTRODUCTION WHY USE A REAL-TIME KERNEL?

INTRODUCTION WHY USE A REAL-TIME KERNEL? Order this document by AN1262 Simple Real-Time Kernels for M68HC05 Microcontrollers By Joanne Field CSIC Applications Freescale Ltd. East Kilbride, Scotland INTRODUCTION This application note demonstrates

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

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

Application Note. Interfacing the CS5525/6/9 to the 68HC05. By Keith Coffey MOSI (PD3) SDO MISO (PD2) SCLK. Figure 1. 3-Wire and 4-Wire Interfaces

Application Note. Interfacing the CS5525/6/9 to the 68HC05. By Keith Coffey MOSI (PD3) SDO MISO (PD2) SCLK. Figure 1. 3-Wire and 4-Wire Interfaces Application Note Interfacing the CS5525/6/9 to the 68HC05 By Keith Coffey INTRODUCTION This application note details the interface of Crystal Semiconductor s CS5525/6/9 Analog-to-Digital Converter (ADC)

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 (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

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

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

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

Freescale Semiconductor, I

Freescale Semiconductor, I nc. 11/2003 I 2 C Slave on the HC908QT/QY Family MCU By Stanislav Arendarik Freescale Czech System Application Laboratory Roznov pod Radhostem, Czech Republic Introduction I 2 C Overview The I 2 C (inter-integrated

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

CPU08RM/AD REV 3 8M68HC08M. CPU08 Central Processor Unit. Reference Manual

CPU08RM/AD REV 3 8M68HC08M. CPU08 Central Processor Unit. Reference Manual CPU08RM/AD REV 3 68HC08M6 HC08M68HC 8M68HC08M CPU08 Central Processor Unit Reference Manual blank CPU08 Central Processor Unit Reference Manual Motorola reserves the right to make changes without further

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

AN1287. MC68HC708LN56 LCD Utilities. Introduction. LCD Hardware General Information

AN1287. MC68HC708LN56 LCD Utilities. Introduction. LCD Hardware General Information Order this document by /D MC68HC708LN56 LCD Utilities By Rick Cramer CSIC Product Engineering Austin, Texas Introduction LCD Hardware General Information A set of software utilities that causes the LCD

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

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

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

Add a Non-Volatile Clock to the MC68HC705J1A. Some applications of using the DS1307 are:

Add a Non-Volatile Clock to the MC68HC705J1A. Some applications of using the DS1307 are: Order this document by /D Add a Non-Volatile Clock to the MC68HC705J1A By Mark Glenewinkel Field Applications Engineering Consumer Systems Group Austin, Texas Introduction Many embedded systems require

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

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

AN1742. Motorola Semiconductor Application Note. Programming the 68HC705J1A In-Circuit By Chris Falk CSG Product Engineering Austin, Texas

AN1742. Motorola Semiconductor Application Note. Programming the 68HC705J1A In-Circuit By Chris Falk CSG Product Engineering Austin, Texas Order this document by /D Motorola Semiconductor Application Note Programming the 68HC705J1A In-Circuit By Chris Falk CSG Product Engineering Austin, Texas Introduction This application note describes

More information

NAM M6800 DISK-BUG DS VER 3.5 OPT PAG

NAM M6800 DISK-BUG DS VER 3.5 OPT PAG NAM M6800 DISK-BUG DS VER 3.5 OPT PAG Floppy Disk Controller Debug Monitor Written 27 Aug 1980 Michael Holley Record of modifications 18 OCT 1981 Disk routines DC-1 23 JAN 1982 Command Table 8 MAY 1982

More information

AN1818. Motorola Semiconductor Application Note

AN1818. Motorola Semiconductor Application Note Order this document by /D Motorola Semiconductor Application Note Software SCI Routines with the 16-Bit Timer Module By Brad Bierschenk MMD Applications Engineering Austin, Texas Introduction Many applications

More information

Application Note. Interfacing the CS5521/22/23/24/28 to the 68HC05. Figure 1. 3-Wire and 4-Wire Interfaces

Application Note. Interfacing the CS5521/22/23/24/28 to the 68HC05. Figure 1. 3-Wire and 4-Wire Interfaces Application Note Interfacing the CS5521/22/23/24/28 to the 68HC05 TABLE OF CONTENTS 1. INTRODUCTION... 1 2. ADC DIGITAL INTERFACE... 1 3. SOFTWARE DESCRIPTION... 2 3.1 Initialize... 2 3.2 Write Channel

More information

Topics. Interfacing chips

Topics. Interfacing chips 8086 Interfacing ICs 2 Topics Interfacing chips Programmable Communication Interface PCI (8251) Programmable Interval Timer (8253) Programmable Peripheral Interfacing - PPI (8255) Programmable DMA controller

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

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

ECET Chapter 2, Part 3 of 3

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

More information

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

AN1292. Adding a Voice User Interface to M68HC05 Applications. nc... Freescale Semiconductor, I. Introduction

AN1292. Adding a Voice User Interface to M68HC05 Applications. nc... Freescale Semiconductor, I. Introduction Order this document by /D Adding a Voice User Interface to M68HC05 Applications By Derrick B. Forte and Hai T. Nguyen CSIC Development Tools Austin, Texas Introduction As embedded microcontroller-based

More information

AN1227. Using 9346 Series Serial EEPROMs with 6805 Series Microcontrollers. Abstract

AN1227. Using 9346 Series Serial EEPROMs with 6805 Series Microcontrollers. Abstract Order this document by AN1227/D Rev. 1.0 AN1227 Using 9346 Series Serial EEPROMs with 6805 Series Microcontrollers using By William G. Grim Abstract This application note describes how the HC05 Family

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

9. PERIPHERAL CHIPS 9a

9. PERIPHERAL CHIPS 9a 9. PERIPHERAL CHIPS 9a 8255: Programmable Peripheral Interface. Draw the pin diagram of PPI 8255. Ans. The pin diagram of 8255 is shown in Fig. 9a. PA 3 4 PA 4 PA2 2 39 PA 5 PA 3 38 PA 6 PA 4 37 PA7 RD

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

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

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

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

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

Freescale Semiconductor, I

Freescale Semiconductor, I nc. Application ote 03/2004 Low Frequency EEPROM Emulation on the MC68HLC908Q4 By Alan Devine 8/16-Bit Division East Kilbride, Scotland Introduction To avoid the cost of using external EEPROM devices,

More information

AN-HK-33. In-Circuit Programming of FLASH Memory in the MC68HC908JL3. Roger Fan Applications Engineering Microcontroller Division Hong Kong

AN-HK-33. In-Circuit Programming of FLASH Memory in the MC68HC908JL3. Roger Fan Applications Engineering Microcontroller Division Hong Kong Order this document by AN-HK-33/H Rev. 1 AN-HK-33 In-Circuit Programming of FLASH Memory in the MC68HC908JL3 By Roger Fan Applications Engineering Microcontroller Division Hong Kong This application note

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

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

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

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

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

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

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

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

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

Exam 2 E2-1 Fall Name: Exam 2

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

More information

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

Immediate vs. Extended mode: Immediate values are marked with a # symbol. They also are different instructions when assembled.

Immediate vs. Extended mode: Immediate values are marked with a # symbol. They also are different instructions when assembled. So, you basically didn t study and now you re in the final and you hope to pass this test and save your miserable grade... And you expect this cheat sheet to save you? Well, I sincerely hope it does. Slacker.

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

Question Bank Microprocessor and Microcontroller

Question Bank Microprocessor and Microcontroller QUESTION BANK - 2 PART A 1. What is cycle stealing? (K1-CO3) During any given bus cycle, one of the system components connected to the system bus is given control of the bus. This component is said to

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

AN2093. Motorola Semiconductor Application Note. Creating Efficient C Code for the MC68HC08. Freescale Semiconductor, I.

AN2093. Motorola Semiconductor Application Note. Creating Efficient C Code for the MC68HC08. Freescale Semiconductor, I. nc. Motorola Semiconductor Application Note Order this document by /D Creating Efficient C Code for the MC68HC08 by Stuart Robb East Kilbride, Scotland 1 Introduction The C programming language is a powerful,

More information

ECE 3610 MICROPROCESSING SYSTEMS AN ENCRYPTED ASCII CODE DECODER

ECE 3610 MICROPROCESSING SYSTEMS AN ENCRYPTED ASCII CODE DECODER ECE 3610 MICROPROCESSIG SYSTEMS A ECRYPTED ASCII CODE DECODER 1 PROBLEM SPECIFICATIO Design a microprocessing system to decode messages which are encrypted. Each byte of the message is an encrypted ASCII

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

Interface DAC to a PC. Control Word of MC1480 DAC (or DAC 808) 8255 Design Example. Engineering 4862 Microprocessors

Interface DAC to a PC. Control Word of MC1480 DAC (or DAC 808) 8255 Design Example. Engineering 4862 Microprocessors Interface DAC to a PC Engineering 4862 Microprocessors Lecture 22 Cheng Li EN-4012 licheng@engr.mun.ca DAC (Digital-to-Analog Converter) Device used to convert digital pulses to analog signals Two methods

More information

The PC's keyboard. PC Keyboard Theory. Quality Information in one Place...

The PC's keyboard. PC Keyboard Theory. Quality Information in one Place... Interfacing the PC / Beyond Logic Quality Information in one Place... Parallel Ports Serial Ports Interrupts AT Keyboard Ports USB The PC's keyboard. Why would you want to interface the Keyboard? The IBM

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

The 6502 Instruction Set

The 6502 Instruction Set The 6502 Instruction Set Load and Store Group LDA Load Accumulator N,Z LDX Load X Register N,Z LDY Load Y Register N,Z STA Store Accumulator STX Store X Register STY Store Y Register Arithmetic Group ADC

More information

ME 4447 / ME 6405: Introduction to Mechatronics

ME 4447 / ME 6405: Introduction to Mechatronics ME 4447 / ME 6405: Introduction to Mechatronics Interrupts and Resets Rohan Bansal Edward Chyau Anirudh Rudraraju Interrupts and Resets 1 Telephone Analogy How do we know if someone is calling? Use polling

More information

AN-HK-32. Motorola Semiconductor Application Note. In-Circuit Programming of FLASH Memory in the MC68HC908GP32. PART 1 Introduction

AN-HK-32. Motorola Semiconductor Application Note. In-Circuit Programming of FLASH Memory in the MC68HC908GP32. PART 1 Introduction Motorola Semiconductor Application Note 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

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

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

; Once Initialized, monitor character in calls to CN05 ; set carry for input, to be tested CN35 C SEC

; Once Initialized, monitor character in calls to CN05 ; set carry for input, to be tested CN35 C SEC // // Serialcode.s // 256 Byte Prom P8 and 512 Byte PROM P9A (second version) for Apple II Serial Card // P9A differs from P9 by adding RTS/ACK software flow control to output and // by removing batch

More information

Introduction to the MC9S12 Hardware Subsystems

Introduction to the MC9S12 Hardware Subsystems Setting and clearing bits in C Using pointers in C o Program to count the number of negative numbers in an area of memory Introduction to the MC9S12 Hardware Subsystems o The MC9S12 timer subsystem Operators

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

Computers and Microprocessors

Computers and Microprocessors Computers and Microprocessors - Introduction Over the last few decades, computers, and microprocessors in particular, have begun to have an enormous impact upon our lives. In early stages of development,

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

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss

Grundlagen Microcontroller Processor Core. Günther Gridling Bettina Weiss Grundlagen Microcontroller Processor Core Günther Gridling Bettina Weiss 1 Processor Core Architecture Instruction Set Lecture Overview 2 Processor Core Architecture Computes things > ALU (Arithmetic Logic

More information

Module 1-G. Marcos and Structured Programming

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

More information

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

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

MC68HC05J1A/D Rev. 1.0 HC 5 MC68HC05J1A MC68HCL05J1A MC68HSC05J1A. HCMOS Microcontroller Units TECHNICAL DATA

MC68HC05J1A/D Rev. 1.0 HC 5 MC68HC05J1A MC68HCL05J1A MC68HSC05J1A. HCMOS Microcontroller Units TECHNICAL DATA MC68HC0J1A/D Rev. 1.0 HC MC68HC0J1A MC68HCL0J1A MC68HSC0J1A HCMOS Microcontroller Units TECHNICAL DATA Technical Data Motorola reserves the right to make changes without further notice to any products

More information

H8/300L Series Programming Manual

H8/300L Series Programming Manual H8/300L Series Programming Manual Notice When using this document, keep the following in mind: 1. This document may, wholly or partially, be subject to change without notice. 2. All rights are reserved:

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

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

AN1228. Motorola Semiconductor Application Note. Interfacing the M68HC05 MCU to the MC A/D Converter. Freescale Semiconductor, I.

AN1228. Motorola Semiconductor Application Note. Interfacing the M68HC05 MCU to the MC A/D Converter. Freescale Semiconductor, I. nc. Motorola Semiconductor Order this document by AN1228/D Rev. 2.0 AN1228 Interfacing the M68HC05 MCU to the MC145051 A/D Converter By Mark Glenewinkel CSIC Applications Austin, Texas Introduction This

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

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

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

Principle and Interface Techniques of Microcontroller

Principle and Interface Techniques of Microcontroller Principle and Interface Techniques of Microcontroller --8051 Microcontroller and Embedded Systems Using Assembly and C LI, Guang ( 李光 ) Prof. PhD, DIC, MIET WANG, You ( 王酉 ) PhD, MIET 杭州 浙江大学 2011 Chapter

More information

MOS 6502 Architecture

MOS 6502 Architecture MOS 6502 Architecture Lecture 3 Fall 17 1 History Origins lie in the Motorola 6800. Was very expensive for consumers. ($300, or about $1500 in 2017 $s) Chuck Peddle proposes lower-cost, lower-area 6800

More information

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture Department of Electrical Engineering Lecture 4 The 8051 Architecture 1 In this Lecture Overview General physical & operational features Block diagram Pin assignments Logic symbol Hardware description Pin

More information

Application Note. Interfacing the X9241 XDCPs to 8051 Microcontrollers AN20. by Applications Staff, June 2000

Application Note. Interfacing the X9241 XDCPs to 8051 Microcontrollers AN20. by Applications Staff, June 2000 Interfacing the X9241 XDCPs to 8051 Microcontrollers by Applications Staff, June 2000 The X9241 has a variety of different instructions that provide flexibility to the designer. Additionally, the nonvolatile

More information

If the display shift operation is used on a 20 x 4 display, the addressing is shifted as follows:

If the display shift operation is used on a 20 x 4 display, the addressing is shifted as follows: If the display shift operation is used on a 2 x 4 display, the addressing is shifted as follows: Left Shift Column 2 3... 8 9 2 line 2 3 2 3 4 line 2 4 42 43 52 53 54 line 3 5 6 7 26 27 28 line 4 55 56

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

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

Practical Course File For

Practical Course File For Practical Course File For Microprocessor (IT 473) B.Tech (IT) IV-SEM Department of IT University Institute of Engineering & Technology Panjab University, Chandigarh Page 1 INTRODUCTION... 4 EXPERIMENT-1:

More information