user23342283
user23342283

Reputation: 1

Daughter-board multiplier

I am writing a program in TI Code Composer Studio assembly-only empty project using the MSP-EXP430FR6989. The assembly-only empty project uses MSP430 Assembler Code Template for use with TI Code Composer Studio. Here is the project requirements:

Use the MSP430 seven-segment daughter board to display and multiply two 8-bit operands. š“ Ɨ šµ = š‘ƒ ā€¢ The hexadecimal value of A(0x00 to 0xFF) should be displayed on the left two digits of the seven-segment display.

ā€¢ The hexadecimal value of A(0x00 to 0xFF) should be updated by moving the potentiometer wheel while holding down pushbutton S3.

ā€¢ The hexadecimal value of B(0x00 to 0xFF) should be displayed on the right two digits of the seven-segment display.

ā€¢ The hexadecimal value of B(0x00 to 0xFF)should be updated by moving the potentiometer wheel while holding down pushbutton S2.

ā€¢ When pushbutton S1is down, the seven segment display should show the value of P (0x0000 to 0xFFFF)

At this moment, I am only trying to display both of the numbers on the daughter-board 7-segment display. So far, I can only get one number to show in all 4 of the digits, not two separate two digit numbers. I have written this code (Only write in "Main loop here" section) that does that:

;-------------------------------------------------------------------------------
; MSP430 Assembler Code Template for use with TI Code Composer Studio
;
;
;-------------------------------------------------------------------------------
            .cdecls C,LIST,"msp430.h"       ; Include device header file
            
;-------------------------------------------------------------------------------
            .def    RESET                   ; Export program entry-point to
                                            ; make it known to linker.
;-------------------------------------------------------------------------------
            .text                           ; Assemble into program memory.
            .retain                         ; Override ELF conditional linking
                                            ; and retain current section.
            .retainrefs                     ; And retain any sections that have
                                            ; references to current section.

;-------------------------------------------------------------------------------
RESET       mov.w   #__STACK_END,SP         ; Initialize stackpointer
StopWDT     mov.w   #WDTPW|WDTHOLD,&WDTCTL  ; Stop watchdog timer
ENIO        clr     PM5CTL0
;-------------------------------------------------------------------------------
; Main loop here
;-------------------------------------------------------------------------------

            ; Configure GPIO for Seven-Segment Display
            mov.b   #0x00, &P1SEL0
            mov.b   #0x00, &P1SEL1
            mov.b   #0x00, &P2SEL0
            mov.b   #0x00, &P2SEL1
            mov.b   #0x00, &P3SEL0
            mov.b   #0x00, &P3SEL1
            mov.b   #0xFF, &P2DIR  ; Set P2.0 to P2.7 as output
            mov.b   #0x0F, &P3DIR  ; Set P3.0-P3.3 for Digit 1-4 as output
            mov.b   #0x0F, &P3OUT

            mov.w   #0x3F00, &P2OUT
            nop

; Seven-segment display patterns for hex digits
SEGMENTS    .word 0x3F00, 0x0600, 0x5B00, 0x4F00, 0x6600, 0x6D00, 0x7D00, 0x0700, 0x7F00, 0x6F00, 0x7700, 0x7C00, 0x3900, 0x5E00, 0x7900, 0x7100
;-------------------------------------------------------------------------------
; Stack Pointer definition
;-------------------------------------------------------------------------------
            .global __STACK_END
            .sect   .stack
            
;-------------------------------------------------------------------------------
; Interrupt Vectors
;-------------------------------------------------------------------------------
            .sect   ".reset"                ; MSP430 RESET Vector
            .short  RESET
            

I have attached a chart showing the daughter-board port connections. Daughter-board port connections

Upvotes: 0

Views: 63

Answers (0)

Related Questions