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.

MSP430FR2100: Can the hardware multiplier MPY32 peripheral registers be accessed with address instruction MOVA ?

Part Number: MSP430FR2100

The User Manual only shows word length .W or byte length .B read/write examples to MPY32 registers but forgets to make a mention  whether .A 20 bit access is prohibited or not. The general description of peripherals also makes no mentions of a limitation. I would try instead of asking but do not have a board now.  MOVA to/from MPY32 regs would be benificial if doing 20 bit ALU type optimization since 20 bit addition and subtraction instructions do exist : ADDA and SUBA. 

  • If MPY32 registers is aligned to address that have last 2 zero bits, and data values are 20-bit, it should work. However, there are only 2 types of MOVA instruction possible in this case...

    MOVA Rsrc, z16(Rdst)
    MOVA Rsrc, &abs20

  • Well, I think it would not work. MPY32 operands registers are described for 8/16/24/32 bit operands not 20 bit. But I was thinking that maybe since locations are perfectly aligned writting 20 bits would write the 16bits operand + the 24 bit operand high word half bottom byte in a single instruction :

    MOVA Rsrc, &MPY32L

    But that leaves the 24 bits high word half top byte undefined unless the MOVA clears it which would be great. Even if that worked, the MPY32 controlers operation is based on what address gets written to determine what type of multiplication is performed (signed/unsigned/8/16/24/32 op1 and 2). In the above example the base address is for a 16 bits first operand 1 and the top 4 bits from the 20 bit data would probably get ignored.

    There is one sentence in the user manual that seems to dissuade using 20 bits but does not say it won't work : "All registers have word or byte register access."
    I will assume it does not work.
  • MOVA to memory will write 20-bits. Other bits in destination double word will be cleared.
  • thank you for that,  zrno soli.  Yes, i found the corresponding section in the manual : It says that an address word length .A write from a register to memory will delete bits 15:4 at memory +2 but makes no mention of the same if the source is not a register (any non-register addressing mode as source)  for example with a symbolic source :

    MOVX.A   EDE , &MPY32L

    but it is likely to delete those bits too. Closing that parenthesis back to trying to use MPY32 with 20 bits operands, using a register source. 

    MOVA   Rsc , &MPY32L

    This single instruction would have written 32 bits including 16 bits at &MPY32L,  8 bits = { 0000 xxxx} at &MPY32L+2=MPY32H_B  and cleared 4 bits at &MPY32L+3=MPY32H_H. How will the MPY32 controller behave for operand 1 is uncertain. It might assume operand 1 is 16,24 or 32 bits, the latter two would be fine only as long as it's not 16. But my guess is it will assume 16 bits, if so it would not work.

  • Howard Handsum said:

    thank you for that,  zrno soli.  Yes, i found the corresponding section in the manual : It says that an address word length .A write from a register to memory will delete bits 15:4 at memory +2 but makes no mention of the same if the source is not a register...

    20 bits will be transferred, other bits will be cleared, for any source / destination type.

  • still no resolution to this thread main question.

**Attention** This is a public forum