Converting frequency to time (SOLVED)

A computer will provide the expected result when technically valid data are supplied. In your sketch the 1/frequencey, where frequency varies from 400 - 1024, is not a valid input as 1/frequency will always be evaluted to 0. Therefore, the solution is:

int cycle_time = (1/frequency)*100000UL;
or
float cycle_time = (1.0/frequency)*100000UL;
Serial.println((int)cycle_time);