Just got frequency control code to work. Is based on the work of Joonas Pihlajamaa in this article which in tern is based Jesper Hansen's work. However I have made some changes to the control loop to use a 24bit step while still using SRAM. This provides much more accuracy at low frequencies, the 16bit implementation spikes up to around +-18% error vs 24bit which reduces this to a peak of +-0.013%*
* See this spreedsheet for the modelling I used to come up with the error values.
Set to 123456Hz ;)
Latest code has been pushed toGitHub. Onto UI...