all information on the lab sheet along with the supporting documents needed, please use edit68k programmer when doing this

1 answer below ยป
all information on the lab sheet along with the supporting documents needed, please use edit68k programmer when doing this

Answered Same DayMar 04, 2021

Answer To: all information on the lab sheet along with the supporting documents needed, please use edit68k...

Pulkit answered on Mar 05 2021
138 Votes
lab6-sol/Lab6/7 segment display.xlsxSheet1
                                a
    3                            3
    3                    f    3    g    3    b
    4                            3
                        e    3        3    c
                                3            h            128    64    32    16    8    4    2    1
                                d                        h    g    f    e    d    c    b    a
                                                    0    0    0    1    1    1    1    1    1    3F
                                                    1    0    0    0    0    0    1    1    0    6
                                                    2    0    1    0    1    1    0    1    1    5B
                                                    3    1    1    0    0    1    1    1    1    4F
                                                    4    0    1    1    0    0    1    1    0    66
                                                    5    0    1    1    0    1    1    0    1    6D
                                                    6    0    1    1    1    1    1    0    1    7D
                                                    7    0    0    0    0    0    1    1    1    7
                                                    8    0    1    1    1    1    1    1    1    7F
                                                    9    0    1    1    0    1    1    1    1    6F
                                                    A    0    1    1    1    0    1    1    1    77
                                                    B    0    1    1    1    1    1    1    1    7F
                                                    C    0    0    1    1    1    0    0    1    39
                                                    D    0    0    1    1    1    1    1    1    3F
                                                    E    0    1    1    1    1    0    0    1    79
                                                    F    0    1    1    1    0    0    0    1    71
                                                    G    0    0    1    1    1    1    0    1    3D
                                                    H    0    1    1    1    0    1    1    0    76
                                                    I    0    0    0    0    0    1    1    0    6
                                                    J    0    0    0    0    1    1    1    0    E
                                                    K    0    1    1    1    0    1    0    1    75
                                                    L    0    0    1    1    1    0    0    0    38
                                                    M1    0    0    1    1    0    1    1    1    37
                                                    M2    0    0    0    0    1    1    1    0    E
                                                    N    0    0    1    1    0    1    1    1    37
                                                    O    0    0    1    1    1    1    1    1    3F
                                                        h    g    f    e    d    c    b    a
                                                        0    1    1    1    0    0    1    1    73
Sheet2
                        7    6    5    4    3    2    1    0
                        h    g    f    e    d    c    b    a    Hex
                        0    0    0    0    0    1    1    0    6
            a
            0
    f    0    g    1    b
            0
    e    0        1    c
            0        0    h
            d
lab6-sol/Lab6/Lab 06 - 7 segment display.pdf
Real Time Embedded Systems Lab
Lab 6: 7 segment display
Note: If the code is not uploaded to the quiz you will not receive any marks.
A seven-segment display (SSD), or seven-segment indicator, is a form of
electronic display device for displaying decimal numerals that is an alternative to
the more complex dot matrix displays.
In this lab you will interact with the 7 segment display. 7 segment displays have 7
segments which are activated by placing a 1 in the appropriate binary field which
represents the display. Take note of the bit patterns to form the digits in the 7-
segment display from comments in the code:
* bit patterns to form digits on readout
*-----------------------------------------------------------
*
A
* -----
* F| |B
* | G |
* -----
* E| |C
* | D |
* ----- .H
*
* Bit Number 128 64 32 16 8 4 2 1
* Segment H G F E D C B A
1. Download the 7 segment code from moodle.
2. Execute and run the program and take note of its behaviour. You will notice the first 3 digits
in the display are set to on followed by a space (The remaining 5 digits do not change)


3. Add code to ask the user to hit enter to continue.
4. Add extra characters to the array to be used to create the below messages. Currently letters
E, H, n & o are listed near the bottom of the program in positions 12 to 15 of the array.
Characters should be stored in alphabetical listing in the array.
5. After the user has hit enter change the display to show the message ALArm with 2 spaces at
the end. Note m requires two display segments (2 ns).
Real Time Embedded Systems Lab


6. Add instructions to ask the user to hit enter to continue.
7. Add to the program so it displays the word ACtivAtE (after the user hits enter).


8. Ask the user to hit enter to continue.
9. Add to the program so it displays the word OPEn with 4 spaces at the end (after the user hits
enter). Describe in your lab report the definition of your characters in binary format.


10. Save the program as you work.
11. Do not display any dots in your 7-segment display (look at H in the comments).
12. Add to the program so that it will ask user to hit Enter to Continue
13. Add to the program so that it will display your First name. Create the letters as close as you
can. E.g see how v and t are represented above. If your first name is more than 8 characters,
use an abbreviated version.
14. Add to the program so that it will ask user to hit Enter to Continue
15. Add to the program to display your Surname. Again, create characters as close as you can
and no more than 8 characters required.
16. Document the program in quiz 6 and explain how it works.
Please reflect upon how 7 segment displays work and the logic behind them.
When you have completed your program complete Lab 6 Quiz and answer all questions.
Be sure to upload your code or you will not receive any marks for the quiz.
Real Time Embedded Systems Lab
Further info on 7-segment displays:
https://en.m.wikipedia.org/wiki/Seven-segment_display
lab6-sol/Lab6/Lab_06_7_segment_display.L6800001000 Starting Address
Assembler used: EASy68K Editor/Assembler v5.16.01
Created On: 05-03-2021 00:04:13
00000000 1 *-----------------------------------------------------------
00000000 2 * Program :
00000000 3 * Written by :
00000000 4 * Date :
00000000 5 * Description:
00000000 6 *-----------------------------------------------------------
00001000 7 ORG $1000
00001000 8 START: ; first instruction of program
00001000 9
00001000 10
00001000 11
00001000 12
00001000 13
00001000 14
00001000 15 *----------------------------------------------------------
00001000 16 * Display a digit on the 7-segment display
00001000 17 * Pre: D3.B contains 1 digit to display
00001000 18 * A2 points to 7-segment LED to use
00001000 19 * Post: A2 points to next 7-segment LED
00001000 20
00001000 103C 0020 21 move.b #32,d0 trap task to get address of hardware
00001004 123C 0000 22 move.b #0,d1 0 in D1 means display
00001008 4E4F 23 trap #15 display hardware window
0000100A 24
0000100A 123C 0001 25 move.b #1,d1 1 in D1 means get address of 7 segment when trap 32 is run
0000100E 4E4F 26 trap #15 get address of 7-segment display and stores it in D1
00001010 2841 27 move.l d1,a4 A4 = Address of 7-segment display
00001012 28
00001012 29 * move.b #2,d1 2 in d1 means get address of LEDS
00001012 30 * trap #15 get address of LEDs
00001012 31 * move.l d1,a3 A3 = Address of LEDs (we don't use this, this is just as example)
00001012 32
00001012 244C 33 move.l a4,a2 Address of 7 segment display needs to be in A2 for segment7 sub routine
00001014 34
00001014 35
00001014 36
00001014 37 *------------ identify the characters load them into D3 one at a time and display them one at a time----------
00001014 163C 000F 38 move.b #15,d3 place the value from array position 15 (char 0) in D3 and call segment7 subroutine
00001018 6100 0018 39 bsr segment7
0000101C 40
0000101C 163C 000E 41 move.b #14,d3 12th item which is the char n
00001020 6100 0010 42 bsr segment7
00001024 43
00001024 163C 000A 44 move.b #10,d3 10th item which is the blank char
00001028 6100 0008 45 bsr segment7
0000102C 46
0000102C 47 *~~ Ask user to hit enter to continue and then put ALArm in 7 Segment etc ~~*
0000102C 48
0000102C 49 *~~ INSERT CODE HERE ~~*
0000102C 50
0000102C 51 *------------ end of display characters
0000102C 52
0000102C 103C 0009 53 MOVE.B #9,D0
00001030 4E4F 54 TRAP #15 ; halt simulator
00001032 55
00001032 56 * Variables and Strings
00001032 57
00001032 58 segment7:
00001032 48E7 1080 59 movem.l d3/a0,-(a7) save registers
00001036 41F9 0000104E 60 lea digits,a0 starting address of bit pattern array table now in A0
0000103C C6BC 000000FF 61 and.l #$00ff,d3 we force the top 8 bits of D3 to 0 by anding with #$00ff (leave only the byte unchanged)
00001042 14B0 3000 62 move.b (a0,d3),(a2) display digit by placing in A2 the contents of A0 position value in D3 e.g (digits,pos 12)
00001046 548A 63 adda.l #2,a2 move to next digit in 7-segment display
00001048 4CDF 0108 64 movem.l (a7)+,d3/a0 restore registers
0000104C 4E75 65 rts
0000104E 66
0000104E 67 *Note: Adda is used with address registers, which are never byte-size so is extended to 32 bits
0000104E 68 *Note: movem moves to or from memory. For more see: http://68k.hax.com/MOVEM
0000104E 69
0000104E 70 * bit patterns to form digits on readout
0000104E 71 *-----------------------------------------------------------
0000104E 72 * A
0000104E 73 * -----
0000104E 74 * F| |B
0000104E 75 * | G |
0000104E 76 * -----
0000104E 77 * E| |C
0000104E 78 * | D |
0000104E 79 * ----- .H
0000104E 80 *
0000104E 81 * Bit Number 128 64 32 16 8 4 2 1
0000104E 82 * Segment H G F E D C B A
0000104E 83 *
0000104E 84 * Total of all is 255 (Hex FF) => 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
0000104E 85
0000104E 86 digits:
0000104E= 3F 87 dc.b $3F digit 0 63 in decimal 1+2+4+8+16+32 #0
0000104F= 06 88 dc.b $06 digit 1 #1
00001050= 5B 89 dc.b $5B digit 2 #2
00001051= 4F 90 dc.b $4F digit 3 #3
00001052= 66 91 dc.b $66 digit 4 #4
00001053= 6D 92 dc.b $6D digit 5 #5
00001054= 7D 93 dc.b $7D digit 6 #6
00001055= 07 94 dc.b $07 digit 7 #7
00001056= 7F 95 dc.b $7F digit 8 #8
00001057= 6F 96 dc.b $6F digit 9 #9
00001058= 00 97 dc.b $00 digit off #10
00001059= 40 98 dc.b $40 dash #11
0000105A 99
0000105A= 79 100 dc.b $79 letter E decimal value 121 in decimal pos #12 in the array
0000105B= 76 101 dc.b $76 letter H decimal value 118 in decimal #13
0000105C= 54 102 dc.b $54 letter n decimal value 84 in decimal #14
0000105D= 5C 103 dc.b $5C letter o decimal value 92 in decimal pos #15 in the array
0000105E 104
0000105E 105
0000105E 106 ds.w 0 force word boundary always the last element in the array of digits
0000105E 107
0000105E 108
0000105E 109 END START ; last line of source
No errors detected
No warnings generated
SYMBOL TABLE INFORMATION
Symbol-name Value
-------------------------
DIGITS 104E
SEGMENT7 1032
START 1000
lab6-sol/Lab6/Lab_06_7_segment_display.S68S021000036384B50524F47202020323043524541544544204259204541535936384B6D
S1231000103C0020123C00004E4F123C00014E4F2841244C163C000F61000018163C000E76
S121102061000010163C000A61000008103C00094E4F48E7108041F90000104EC6BCAD
S123103E000000FF14B03000548A4CDF01084E753F065B4F666D7D077F6F00407976545CB3
S804001000EB
lab6-sol/Lab6/Lab_06_7_segment_display.X68*-----------------------------------------------------------
* Program :
* Written by :
* Date :
* Description:
*-----------------------------------------------------------
    ORG    $1000
START:                ; first instruction of program
*----------------------------------------------------------
* Display a digit on the 7-segment display
* Pre: D3.B contains 1 digit to display
* A2 points to 7-segment LED to use
* Post: A2 points to next 7-segment LED
    move.b    #32,d0     trap task to get address of hardware
    move.b    #0,d1 0 in D1 means display
    trap    #15     display hardware window
    
    move.b    #1,d1 1 in D1 means get address of 7 segment when trap 32 is run
    trap    #15     get address of 7-segment display and stores it in D1
    move.l    d1,a4     A4 = Address of 7-segment display
    
*    move.b    #2,d1 2 in d1 means get address of LEDS
*    trap    #15     get address of LEDs
*    move.l    d1,a3     A3 = Address of LEDs (we don't use this, this is just as example)
    move.l a4,a2 Address of 7 segment display needs to be in A2 for segment7 sub routine
*------------ identify the characters load them into D3 one at a time and display them one at a time----------
    move.b    #15,d3     place the value from array position 15 (char 0) in D3 and call segment7 subroutine
    bsr    segment7
    
    move.b    #14,d3        12th item which is the char n
    bsr    segment7
    
    move.b    #10,d3 10th item which is the blank char
    bsr    segment7
*~~ Ask user to hit enter to continue and then put ALArm in 7 Segment etc ~~*
*~~ INSERT CODE HERE ~~*
*------------ end of display characters
    MOVE.B    #9,D0
    TRAP    #15        ; halt simulator
* Variables and Strings
segment7:
movem.l d3/a0,-(a7) save registers
lea digits,a0 starting address of bit pattern array table now in A0
and.l #$00ff,d3 we force the top 8 bits of D3 to 0 by anding with #$00ff (leave only the byte unchanged)
move.b (a0,d3),(a2) display digit by placing in A2 the contents of A0 position value in D3 e.g (digits,pos 12)
adda.l #2,a2 move to next digit in 7-segment display
movem.l (a7)+,d3/a0 restore registers
rts

*Note: Adda is used with address registers, which are never byte-size so is extended to 32 bits
*Note: movem moves to or from memory. For more see: http://68k.hax.com/MOVEM

* bit patterns to form digits on readout
*-----------------------------------------------------------
* A
* -----
* F| |B
* | G |
* -----
* E| |C
* | D |
* ----- .H
*
* Bit Number 128 64 32 16 8 4 2 1
* Segment H G F E D C B A
*
* Total of all is 255 (Hex FF) => 128 + 64 + 32 + 16 + 8 + 4 + 2 + 1
digits:
dc.b $3F digit 0 63 in decimal 1+2+4+8+16+32 #0
dc.b $06 digit 1 #1
dc.b $5B digit 2 #2
dc.b $4F digit 3 #3
dc.b $66 digit 4 #4
dc.b $6D digit 5 #5
dc.b $7D digit 6 #6
dc.b $07 digit 7 #7
dc.b $7F digit 8 #8
dc.b $6F digit 9 #9
dc.b $00 digit off #10
dc.b $40 dash #11

dc.b $79 letter E decimal value 121 in decimal pos #12 in the array
dc.b $76 letter H decimal value 118 in decimal #13
dc.b $54        letter n decimal value 84 in decimal #14
dc.b $5C letter o decimal value 92 in decimal pos #15 in the array
ds.w 0 force word boundary always the last element in the array of digits
    END    START        ; last line of source
*~Font name~Courier New~
*~Font name~Courier New~
*~Font size~10~
*~Tab type~1~
*~Tab size~8~
lab6-sol/Lab_06_-_7_segment_display ACtivAtE.L6800001000 Starting Address
Assembler used: EASy68K Editor/Assembler v5.16.01
Created On: 05-03-2021 00:00:13
00000000 1 *-----------------------------------------------------------
00000000 2 * Program :
00000000 3 * Written by :
00000000 4 * Date :
00000000 5 * Description:
00000000 6 *-----------------------------------------------------------
00001000 7 ORG $1000
00001000 8 START: ; first instruction of program
00001000 9
00001000 10
00001000 11
00001000 12
00001000 13
00001000 14
00001000 15 *----------------------------------------------------------
00001000 16 * Display a digit on the 7-segment display
00001000 17 * Pre: D3.B contains 1 digit to display
00001000 18 * A2 points to 7-segment LED to use
00001000 19 * Post: A2 points to next 7-segment LED
00001000 20
00001000 103C 0020 21 move.b #32,d0 trap task to get address of hardware
00001004 123C 0000 22 move.b #0,d1 0 in D1 means display
00001008 4E4F 23 trap #15 display hardware window
0000100A 123C 0001 24 move.b #1,d1 1 in D1 means get address of 7 segment
0000100E 4E4F 25 trap #15 get address of 7-segment display and stores it in D1
00001010 2841 26 move.l d1,a4 A4 = Address of 7-segment display
00001012 123C 0002 27 move.b #2,d1 2 in d1 means get address of LEDS
00001016 4E4F 28 trap #15 get address of LEDs
00001018 2641 29 move.l d1,a3 A3 = Address of LEDs
0000101A 30
0000101A 244C 31 move.l a4,a2 Address of 7 segment display needs to be in A2 for segment7 sub routine
0000101C 32
0000101C 33 *------------ identify the characters load them into D3 one at a time and display them one at a time----------
0000101C 163C 000C 34 move.b #12,d3 12th item, letter A, place the array position in D3 and call segment7 subroutine 12th item which is the char o
00001020 6100 0040 35 bsr segment7
00001024 36
00001024 163C 000D 37 move.b #13,d3 13th item, letter C
00001028 6100 0038 38 bsr segment7
0000102C 39
0000102C 163C 0015 40 move.b #21,d3 21th item, letter t
00001030 6100 0030 41 bsr segment7
00001034 42
00001034 163C 000F 43 ...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here