Frequency out is similar to PWM, but outputs a 50% duty cycle square wave. Because its fixed at 50% duty, a wider range of frequencies are attainable. Setup is similar to PWM, except the Timer value we specify is another divisor for the clock:
//Set the timer/counter pin offset to 0, which will put the first timer/counter on FIO4.
AddRequest (ID, LJ_ioPUT_CONFIG, LJ_chTIMER_COUNTER_PIN_OFFSET, 4, 0, 0)
// use system clock so works on U3 and UE9:
AddRequest(ID, LJ_ioPUT_CONFIG, LJ_chTIMER_CLOCK_BASE, LJ_tcSYS, 0, 0)
//Set the divisor to 24
AddRequest(ID, LJ_ioPUT_CONFIG, LJ_chTIMER_CLOCK_DIVISOR, 48, 0, 0)
//Enable 1 timer. It will use FIO4.
AddRequest(ID, LJ_ioPUT_CONFIG, LJ_chNUMBER_TIMERS_ENABLED, 1, 0, 0)
//Configure Timer0 as Frequency out.
AddRequest(ID, LJ_ioPUT_TIMER_MODE, 0, LJ_tmFREQOUT, 0, 0)
//Set the second divisor to 10
AddRequest(ID, LJ_ioPUT_TIMER_VALUE, 0, 10, 0, 0)
//Execute the requests.
GoOne(0)