cmpen472 hw8

0 comments

Due: March 24, 2021 11:30pm

Objective

To learn interrupts and timming: Real Time Interrupt (RTI).

Textbook Reading (for next homework):

  1. Chapter 9
  2. MC9S12C Family Referemce Manual/Data Sheet: Chapters 1, 5, 9, 13, and 15

Instruction

  1. Write a program to make a digital clock, displayed on the 7-segment displays
    attached to PORTB and the HyperTerminal connected to the HCS12 board.
    (Full 12 hour digital clock in hh:mm:ss format but only the seconds are displayed.)
  2. The digital clock rules are:
    1. 60 second clock
    2. “s” for ‘set time’ command and “q” for ‘quit’ command, only two commands
    3. Update the time display every second
    4. Time display on the 7-segment displays attached to PORTB and the commands on terminal screen
    5. Show ‘Clock> ‘prompt and echo print user keystrokes unltil Return key
    6. In case of an invalid input format, print error message on the next line: ‘Invalid input format’
    7. Use Real Time Interrupt feature to keep the time
  3. The Terminal display should look something like the following:
    Clock>
    Clock> s 59
    Clock> 
    Clock> s 9
    Clock> 
    Clock> s 09
    Clock> 
    Clock> s 552
           Invalid time format. Correct example => 0 to 59
    Clock> s 75
           Invalid time format. Correct example => 0 to 59
    Clock> s A2
           Invalid time format. Correct example => 0 to 59
    Clock>
    Clock> q
           Stop clock and start Typewrite program
    
    
  4. Run and study the following sample programs that use Real Time Interrupt:

    Simple LED blinking example program – hw8sample1b.asm file.

    (For the CodeWarrior simulation, please follow the Homework 8 Full Chip Simulator guide.)

  5. Make your program user friendly by giving directions as to how to correctly use your program.
  6. Also, make your program ‘fool-proof’, never crash or stop based on wrong user response.
  7. You may add other features or decorations.
  8. Design the program to start at $3100 and data to start at $3000.
  9. Be sure to put much comments so that grader and others can clearly and quickly understand your program.
    Comments are very important in assembly language programs.
  10. You may want to see and check the Sample Grading Sheet for this homework.
  11. Copy your ‘main.asm’ file to ‘cmpen472hw8_YourLastName.asm’. For example, mine
    will be ‘cmpen472hw8_choi.asm’ Do NOT ZIP your ‘cmpen472hw8_YourLastName.asm’ file.
  12. Turn-in your project source code file through Penn State CANVAS.
    Upload your source code file into the CANVAS Assignment’s Homework submission.
    Be sure to select CMPEN 472 class and correct Homework number, and with correct file name.

Congratulations on your eighth CMPEN 472 homework completion!

About the Author

Follow me


{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}