Using NUCLEO F756ZG - Checking speed of calculations
Hello all,
Just started working with STM - Nucleo is my first trial at this
I am operating at 216MHz
I noticed this while loop is taking almost 80uSec to complete with the simple trial floating point calculations
& output a square wave that I can see on scope
At 216MHz , this is about 17400 clock cycles
I was wondering why the chip would take this much time to perform this simple calculation
Any comments/suggestions would be very welcome
Thanx for your help in advance
double c=0;//global
double a=0;//global
double pi=3.1415;//global
....
while (1)
{
//HAL_GPIO_TogglePin(LD1_GPIO_Port, LD1_Pin);this is really slow!!!
GPIOC->ODR = 0x00000100;//see this on scope
c= (a/pi + sqrt(pi))*(a/pi + sqrt(pi));//simple calculation
GPIOC->ODR = 0x01000000;//see this on scope
c=(a/pi + sqrt(pi))*(a/pi + sqrt(pi));//simple calculation
if(c==0)
GPIOB->ODR = 0x00000001;
/* USER CODE END WHILE */
/* USER CODE BEGIN 3 */
}
......
Thanx
Jay
