Question: PROBLEM 4: Ashenden 8.28 A Gumnut system includes a 4-digit 7-segment display connected as shown in figure 8.45 (page 392). The anode data register is

PROBLEM 4: Ashenden 8.28 A Gumnut system includes a 4-digit 7-segment display connected as shown in figure 8.45 (page 392). The anode data register is at port address 128, and the cathode data register is at port address 129. Write Gumnut assmembly code for the task 2ms subroutine described in Example 8.17 on page 383 to scan the display. The BCD digits to display are stored in four bytes of memory labelled display_ data. The subroutine should selecte one digit to drive each time it is called. Thus four successive calls are required for a complete scan. The setup and first line of code are given for you. :Task activated every 2ms, scans 4-digit display data anode_port: equ 128 cathode port: equ 129 : The four BCD digits display_data: byte 0, 0, 0, 0 : digit enable lookup table for digits 0 to digit en: byte 0x01, 0x02, 0x04, 0x08 ;current digit index digit sel: byte 0 ; seven-segment decode table for values 0 to 9 decode table: byte 0x3F, 0x06, 0x58, 0x4F 0x66 byte 0x6D, 0x7D, 0x07, 0x7F. 0x6F text task 2ms: ldm r1, digit sel get current digit index PROBLEM 4: Ashenden 8.28 A Gumnut system includes a 4-digit 7-segment display connected as shown in figure 8.45 (page 392). The anode data register is at port address 128, and the cathode data register is at port address 129. Write Gumnut assmembly code for the task 2ms subroutine described in Example 8.17 on page 383 to scan the display. The BCD digits to display are stored in four bytes of memory labelled display_ data. The subroutine should selecte one digit to drive each time it is called. Thus four successive calls are required for a complete scan. The setup and first line of code are given for you. :Task activated every 2ms, scans 4-digit display data anode_port: equ 128 cathode port: equ 129 : The four BCD digits display_data: byte 0, 0, 0, 0 : digit enable lookup table for digits 0 to digit en: byte 0x01, 0x02, 0x04, 0x08 ;current digit index digit sel: byte 0 ; seven-segment decode table for values 0 to 9 decode table: byte 0x3F, 0x06, 0x58, 0x4F 0x66 byte 0x6D, 0x7D, 0x07, 0x7F. 0x6F text task 2ms: ldm r1, digit sel get current digit index
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
