FM2 - ; ECE 362 - Practice Example ; Outcome 2 Final...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ; ECE 362 - Practice Example ; Outcome 2 Final Assessment ;*********************************************************************** ; ; The objective of this problem is to implement stopwatch that can count ; in increments of 0.1 second up to 99.9 seconds. The RTI module will provide ; a periodic interrupt (1.408 ms rate) to serve as a time base for sampling ; the pushbuttons and updating the display. Note that this application is ; intended to run in a "turn-key" fashion and therefore will be stored in ; flash. Use AsmIDE to develop your solution and to load it into your ; board's flash memory. ; ; The following docking board resources will be used: ; ; - left pushbutton (PAD7): stopwatch reset ; - right pushbutton (PAD6): stopwatch start/stop ; - left LED (PT1): stopwatch run/stop state ; - right LED (PT0): stopwatch maxed out (99.9) state ; ; The three-digit stopwatch value (NN.N) is to be updated in place ; on the emulated terminal screen every one-tenth second. ; ;======================================================================== ; ; 9S12C32 REGISTER MAP INITRM EQU $0010 ; INITRM - INTERNAL RAM POSITION REGISTER INITRG EQU $0011 ; INITRG - INTERNAL REGISTER POSITION REGISTER ; ==== CRG - Clock and Reset Generator SYNR EQU $0034 ; CRG synthesizer register REFDV EQU $0035 ; CRG reference divider register CRGFLG EQU $0037 ; CRG flags register CRGINT EQU $0038 CLKSEL EQU $0039 ; CRG clock select register PLLCTL EQU $003A ; CRG PLL control register RTICTL EQU $003B COPCTL EQU $003C ; ==== Digital Input (Pushbuttons) - Port AD PTAD EQU $0270 ; Port AD data register DDRAD EQU $0272 ; Port AD data direction register ATDDIEN EQU $008D ; Port AD digital input enable ; (programs Port AD bit positions as digital inputs) ; ==== Direct Port Pin Access/Control - Port T PTT EQU $0240 ; Port T data register DDRT EQU $0242 ; Port T data direction register ; ==== SCI Register Definitions SCIBDH EQU $00C8 ; SCI0BDH - SCI BAUD RATE CONTROL REGISTER SCIBDL EQU $00C9 ; SCI0BDL - SCI BAUD RATE CONTROL REGISTER SCICR1 EQU $00CA ; SCI0CR1 - SCI CONTROL REGISTER SCICR2 EQU $00CB ; SCI0CR2 - SCI CONTROL REGISTER SCISR1 EQU $00CC ; SCI0SR1 - SCI STATUS REGISTER SCISR2 EQU $00CD ; SCI0SR2 - SCI STATUS REGISTER SCIDRH EQU $00CE ; SCI0DRH - SCI DATA REGISTER SCIDRL EQU $00CF ; SCI0DRL - SCI DATA REGISTER PORTB EQU $0001 ; PORTB - DATA REGISTER DDRB EQU $0003 ; PORTB - DATA DIRECTION REGISTER ;*********************************************************************** ; ; ASCII character definitions ; CR equ $0d ; RETURN ; ====================================================================== ; ; Variable declarations (SRAM) ; (add any others deemed necessary) ; tnsflg equ $3800 ; one-tenth second flag (1 -> set, 0 -> clear) leftpb equ $3801 ; left pushbutton flag (1 -> set, 0 -> clear) rghtpb equ $3802 ; right pushbutton flag (1 -> set, 0 -> clear) runstp equ $3803 ; run/stop flag (1 -> run, 0 -> stop) rticnt equ $3804 ; RTICNT (variable) prevpb equ $3805 ; previous state of pushbuttons (variable)...
View Full Document

Page1 / 9

FM2 - ; ECE 362 - Practice Example ; Outcome 2 Final...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online