Question: I can see some difficulty, so i am posting an exmple. In this exercise we will study how to extract data by using a more
I can see some difficulty, so i am posting an exmple.
In this exercise we will study how to extract data by using a more complex output module, the seven field indicator. Also in this exercise, we will study the creation of a table in the memory of the microcontroller and the drawing of data from a table using the IndeX register. A 7-segment indicator is an array of 8 LED diodes in a special configuration. The 7 passes (A, B, C, D, E, F, G) form the number 8, and there is another pass, called the DP (Decimal Point), which is used for the decimal point. The answer:

My question: Two Push Button Switches are connected to the PTC0, PTC1 of the Microcontroller, and a seven-segment indicator at ports 0-6 of port B. Write a program that will simulate the parking function of a parking lot. Initially, the indicator will be zero, as an indication that there are no parked cars. For each vehicle entering the parking area (push of the PTC0 switch), the display will increase. Correspondingly for each vehicle coming out of the parking space (pushing the PTC1 switch), the display will decrease.
Programming language: Assembly Microcontroller: Motorola MC68HC908GP32 WinIDE editing environment
PORTB. DATA PORTD. DATA PORTB. DIRECTION PORTD. DIRECTION COUNTER1. COUNTER 2 COUNTER ROM. START RESET VECTOR. Init Ports START LOOP DELAY.1SEC LOAD COUNTER2 LOAD. COUNTER1 DELAY. LOOP TABLE $0001. QU $0003 QU $0005 QU EQU $0007 $0040 QU $0041 QU $0042 QU $8000 QU QU FFFE ROM. START ORG 0, $001F BSET #$1F $003C. MOV BSET 5,PORTD. DATA BSET 5, PORTD. DIRECTION CLR PORTB. DATA MOV #9601111111, PORTB. DIRECTI ON CL RX LDA TABLE PORTB. DATA STA DEL .1SEC JSR. INCX CMPX #19 BLS LOOP JMP START MOV 55 ,COUNTER3 MOV 1100, COUNTER2 MOV 180,COUNTER1. DBNZ COUNTER1,DELAY. LOOP DBNZ COUNTER2,LOAD. COUNTER1. DBNZ COUNTER 3,LOAD. COUNTER2 RTS $8300 ORG FCB 86011 11110 9600110000 FCB 9501101101. FCB FCB 9601111001. FCB 9600110011. FCB 9501011011. 9601011111 FCB FCB 9501110000 FCB 9601111111. FCB 9501111011. ORG RESET VECTOR ROM. START FDB
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
