Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The program should be running with the MSP430 Write an MSP 430 assembly program

ID: 669781 • Letter: T

Question

The program should be running with the MSP430 Write an MSP 430 assembly program that outputs a two-digit binary-coded-decimal (BCD) count on port p1. The count should start at a random value and count upto 99. Then, the count should go to 00 and count to 99 again. This cycle should be repeated until power is removed from the Launchpad. introduce a delay of at least half a second between subsequent count values. Connect an LED to each pin of P1 to display the count output. Use the main function only for initialization and write a second function that implements counting and display. Write a third function that implements the delay to be used between subsequent displayed count values.

Explanation / Answer

mov r1,#00h                            // to count number of 0s

            mov r2,#00h                // to count number of 1s

            mov r7,#08h                // counter for 8-bits

            mov a,#97h                 // data to count number of 1s and 0s

again:   rlc a

            jc next

            inc r1

            sjmp here

next:    inc r2

here:    djnz r7,again

end