Wrong clock divider from setFrequency(frq) if frq is below the minimal frequency (152 at 80 MHz processor clock). setFrequency passes 0x7FFFF000 to setClockDivider. For the correct setting of regL this should be 0x7FFFF020. 0x7FFFF020 is the value you get when you call setFrequency(152).