I need to multiply variables (outputs from the sensors) with some constants. I am aware that msp430g2553 lacks a hardware multiplier? does it have a problem while raising interrupts?
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.
I need to multiply variables (outputs from the sensors) with some constants. I am aware that msp430g2553 lacks a hardware multiplier? does it have a problem while raising interrupts?
Vasuki Shankar said:I need to multiply variables (outputs from the sensors) with some constants. I am aware that msp430g2553 lacks a hardware multiplier?
Uhm.. I think old Zuse electromechanics computer where able to do multiplication without specialized hardware multiplier.. why modern electronic one cannot do?
http://www.german-way.com/notable-people/featured-bios/konrad-zuse/
Vasuki Shankar said:does it have a problem while raising interrupts?
Why?
Leo Bosch said:The MSP430G2553 doesn’t have problems when and Interrupt has been served, this applies only to devices with a Hardware Multiplier, the MSP430Gxxx doesn’t have this.
Hi Leo I think probably what mean interrupt question but this has to be answered from Vasuki than you, did you mean problem of protecting resource so to save Multiplier state before use on interrupt then restore before leave? Compiler provide protection about this and handling of MAC unit is done on choice.
My usage of MAC was generally only on interrupt and DMA to parallel filtering task of multiply accumulate, this feaure is MSP unique and I moved some DSP code to MSP. This was in the past, age is progressing and time go away too fast for me. All new generation are too fast food Arduino like poisoned to learn about how to do special math with less power.
Vasuki Shankar said:as it doesnt have a MAC unit, can it store the large intermediate result mean while?
I am not able to understand what this mean....
Anyway MAC unit is not part of ALU but it is a peripheral so it is treated as shareable resurce and must be protected from concurrent access by programs. When one program is using this resource load some value to MAC registers and if get interrupted by some process this new process can load new values voiding preceding operation and giving erroneous result to background main program flow...
This is why MSC resourec has to be protected with some primitive like semaphore or status completely saved and restored when used on interrupt.
Vasuki Shankar said:I need to multiply variables (outputs from the sensors) with some constants. I am aware that msp430g2553 lacks a hardware multiplier? ...
Correct. Thus multiply must be carried out in software. If you use c, there are lots of library functions to do integer as well as floating point multiplications
,Vasuki Shankar said:.. does it have a problem while raising interrupts?
There is no problem for MSP430G2553. But the library functions may have problems if you use them both inside and outside of your ISR. Also, you may run out of memory or time.
To multiply a variable with a constant in software can be carried out with Horner's method efficiently. But your c-compiler may not apply that.
**Attention** This is a public forum