Greetings,
Currently I am experimenting with a MSP430F2619 to emulated a PI AGC controller in a radio. My problem is that the MSP430F2619 is not fast enough so I moved to Q19 fixed point math. (I am aware that the MSP430F2619 does not have a 32 bit hardware multiplier)
By running through the assembly code in CCS5 I counted approximately 120 cycles for a multiply and sum operation for two long Q19 fixed point math words. The MSP430 is running with a 16 Mhz clock, assuming the processor does every clock cycle some thing the total calculation time is 120/16MhZ = 7.5 usek however by toggling an IO with a LED connected, I measured a total of 37.1 usek which is roughly about 600 cycles which is much more than the counted 120 cycles (I did this measurement in timerA's interrupt routine).
For multiplying two floating point values and summing the total elapsed time is 82usek.
I extracted a small snipped from the code. I am doing something wrong here or is just simply the limit of the MSP430F2619?
// Q format
signed long long Multiply_result_q;
static signed long Error_Voltage_q;
const signed long Ts_q= 194;
static signed long Ie_q;
P4OUT &= ~0x04;// LED OFF
Multiply_result_q = (long)(((long long)(long)Error_Voltage_q * (long long)(long)Ts_q)>>q_divide_pow2__19); // Error_Voltage = (Ref_Voltage - RSSI_Voltage)*Ts;
Ie_q = Ie_q + (long)Multiply_result_q; // Integrate Error
P4OUT ^= 0x04; // LED ON
//Floating point
static float Ie;
static float Error_Voltage;
static const float Ts = 1.0/2300.0;
P4OUT &= ~0x04;// LED OFF
Ie = Ie + Error_Voltage*Ts;
P4OUT ^= 0x04;// LED ON
### Happy new year !:)