Hello everyone,
i am writing a code on msp430fr2433 and i am not much familiar with fr2433.
i am having difficulties about using some operands like shift and multiply.
i have an example block of code here:
void write(uint8_t GPIO,uint64_t pin,uint16_t addr,uint8_t * data,uint16_t datasize) { uint32_t myData = (addr * 32); // multiply by 32 does not work. uint32_t myData = (addr * 2); myData = (myData * 16); // i workaround the problem like this }
i pass an 0x1100 as an addr parameter. i assume other parameters are not important for example.
when i multiply with 32 that results 0x2000, it should be 0x22000. i dont know why.
but when i try to multipy with 2 and then 16 that works. result is 0x22000.
i tried to shift operand but that is not working also. as i researched msp430fr2433 has not a multiple shift operand. Seem like it cant shift variables more than 1 bit in one cycle.
Still i dont understand why cant i multiply number with 32.
Thank you in advance