Simulator Project Instructions, Slides of Microprocessor and Interfacing

Instructions for a simulator project involving the use of thrsim, setting up switches, writing code for counter functionality, bcd adjustment, and incorporating a delay subroutine. The project's second part includes adding a second 7 segment display for time display in 12-hour format and implementing hour and minute setting functions.

Typology: Slides

2012/2013

Uploaded on 05/07/2013

anjushree
anjushree 🇮🇳

4.4

(54)

147 documents

1 / 7

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Simulator Project
Docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Simulator Project Instructions and more Slides Microprocessor and Interfacing in PDF only on Docsity!

Simulator Project

Simulator Project

  • Overview of the project
  • Some specific items to note

Step 2

  • Write code that does the following
    • The switch on PC0 is the count ON/OFF switch.
      • When it is OFF the counter does not run.
      • When it is ON, the counter runs. (ON = 1)
    • The switch on PC1 is the count up/count down switch - When it is OFF, the counter counts up. - When it is ON, the counter counts down (ON = 1)
    • The byte display of the A accumulator shows the count. The display be in decimal, so count in BCD.

BCD adjustment

  • When counting up – what adjustment is needed in BCD? - Currently at $19 – do an INCA – what do you get? - Get a $1A but want $
  • When counting down – what adjustment is needed in BCD? - Currently at $20 – do an DECA – what do you get? - Get $1F but want $19. - Do a DAA and get $ - How to solve? - Must look at each digit of the two independently.

Sim Proj 2 – extra credit

  • Modify your code from Sim Proj 1 to add the following
    • Add a second 2 digit 7 segment display, this time to port B.
    • Use it and the display from the A accumulator to display time in a 12 hour format.
    • To stay in the 12 hour format the minutes (A accumulator) will count to 59 and then roll over to 00, incrementing the hour.
    • The run button will be modified to a set function. When pressed the hours or minutes will be adjusted.
    • The up/down button will be used to select minutes or hours to set.
    • When running you will only increment the minutes digit every minute in a real application. For this assignment and to allow testing have it change every 3 to 4 seconds. You can do this by writing a new subroutine for this delay that calls the previous delay routine a number of times.