I'm considering migrating from the MSP430F2410 to the MSP432p401R.
I'm trying to compare the floating point performance between the two processors. I'm using IAR for both processors.
On the MSP432 I'm running this loop:
float ans;
float op;
while(1)
{
// Toggle P1.0 output
GPIO_toggleOutputOnPin(
GPIO_PORT_P1,
GPIO_PIN0
);
ans = 0;
//each loop should be 1000 cycles
while(ans < 3141.0)
{
//p2.7 is pulled low
if(GPIO_getInputPinValue(GPIO_PORT_P2,GPIO_PIN7) == 0x80)
{
op = 0;
}
else
op = 1.0;
ans = ans + 3.141 * op;
}
}
On the MSP430 I'm running the same algorithm:
while(1)
{
// Toggle P1.0 output
P1OUT ^= BIT0;
ans = 0;
//each loop should be 1000 cycles
while(ans < 3141.0)
{
//P6.6 is pulled low
if(P6IN & BIT6 == BIT6)
{
op = 0;
}
else
op = 1.0;
ans = ans + 3.141* op;
}
}
I'm probing the LED output on both boards with an oscilloscope. The high cycle time for MSP430 is 27.2ms and the high cycle time for MSP432 is 9.5ms. So MSP432 is running ~3x faster. This is suspiciously similiar to the ratio of their clocks (48MHZ vs 16Mhz)
The MSP432 should be much faster because of the FPU, right? Perhaps I don't have the FPU enabled correctly?
Is there an example of how to boost the performance? How can I know for sure that I'm using the floating point hardware?
Thanks!