Converting frequency to time (SOLVED)

Unless you force the calculation to be done in floats, it will be an integer calculation. Try

cycle_time = ((1.0/frequency)*100000);