FM3 - ; ECE 362 - Practice Example ; Outcome 3 Final...

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

View Full Document Right Arrow Icon
; ECE 362 - Practice Example ; Outcome 3 Final Assessment ;*********************************************************************** ; ; The objective of this problem is to implement an NBA-style 24-second ; shot clock on the 9S12C32 development kit. The shot clock time will ; be displayed on the emulated terminal screen as "NN.N" and be updated ; every 0.1 second. The TIM module will be used to produce a highly ; accurate periodic interrupt every 10 ms; upon accumulation of 10 of ; these interrupts (i.e., every 100 ms), the shot clock will be ; decremented by 0.1 sec and the display will be refreshed (in place). ; When the shot clock reaches 00.0, it will stop decementing and ; active a "buzzer" (a 60 Hz PWM signal, on PWM Channel 0, which should ; be routed to port pin PT0 and therefore be visible on the right LED). ; ; IMPORTANT: Shot clock must be as accurate as possible - in particular, ; inaccuracy should NOT be introduced by starting and stopping the clock ; multiple times. ; ; The RTI module will provide a periodic interrupt (2.048 ms rate) to ; serve as a time base for sampling the pushbuttons. The following ; design kit resources will be used: ; ; - left pushbutton (PAD7): shot clock reset ; - right pushbutton (PAD6): shot clock start/stop ; - left LED (PT1): shot clock run/stop state ; - right LED (PT0): PWM "buzzer" (shot clock expired) ; ; The SCI transmit section will operate in a buffered, interrupt-driven ; mode, while the SCI receive section will not be used. ; ; **** NOTE THE ROUTINES THAT ARE PROVIDED FOR THIS PROBLEM **** ; ; ================================================================= ; ; Variable declarations (SRAM) ; org $3800 ptone rmb 1 ; 0.1 second flag ("point one") leftpb rmb 1 ; left pushbutton flag rghtpb rmb 1 ; right pushbutton flag prevpb rmb 1 ; previous state of pushbuttons runstp rmb 1 ; run/stop flag timcnt rmb 1 ; TIMCNT variable (to count TIM interrupts) secs rmb 1 ; seconds digits of display (packed BCD) tenths rmb 1 ; tenths digit of display (upper nibble only) tin rmb 1 ; SCI transmit display buffer IN pointer tout rmb 1 ; SCI transmit display buffer OUT pointer tsize equ $10 ; size of transmit buffer tbuf rmb tsize ; SCI transmit display buffer ; ;======================================================================== ; ; 9S12C32 REGISTER MAP INITRM EQU $0010 ; INITRM - INTERNAL RAM POSITION REGISTER INITRG EQU $0011 ; INITRG - INTERNAL REGISTER POSITION REGISTER ; ==== CRG - Clock and Reset Generator
Background image of page 1

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

View Full DocumentRight Arrow Icon
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 ; ==== 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
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

FM3 - ; ECE 362 - Practice Example ; Outcome 3 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