This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LED 7 SEGMENT+MSP430G2553

Other Parts Discussed in Thread: MSP430G2553

How to write a program to show a value in register(R4=10bit) in MSP430G2553 by ASM language, because in the instruction of msp430 no command MUL and DIV,

Help me please!

Thanks!

Thuan

 

 

  • Thuan Dao Vinh said:
    no command MUL and DIV,

    So go right back to basics and think how you first learned to do multiplication and division at school:

    Multiplication is just repeated addition - isn't it...?

  • Andy Neil said:
    Multiplication is just repeated addition

    More efficient is a shift-and-add operation, as it only has as many shifsts and a no more but probably less additions that the smaller operands width. (on MSPs with hardware multiplier, just use this one)

    The difficult part is the division. However, replacing a division by a multiplication and a shift is much, MUCH faster, with acceptable precision.

    If really a division is needed: the MSPGCC project has the default multiplication and division function in the default GCCLIB, which is available as source code. The functions are written in MSP assembly language

  • you can multiply a number by repeatedly adding it while divison can be implemented by repeated subtraction.for displaying the value on 7 segment check this
    xanthium.in/interfacing-7-segment-led-with-msp430-launchpad

**Attention** This is a public forum