Inialisation
Defines of various things related to the DDS module and EEprom data
Setup Ports, various registers and read EEprom data and apply to respective registers, initialise DDS module and external LED indicator if fitted
Main
Put PIC to sleep (just realised I've left this out of the latest asm version - it should be there)
Enter encoder routine when encoder moves or switch pushed via wake on interrupt
If seperate interrupt timer has timed out - save current data to EEprom (frequency, step size and which LED currently on)
Poll encoder and switch
Adjust a register if switch pushed
Increment/decrement LED's on an external circuit <- this takes around 12.4mS longest and 10.2mS shortest duration
Returns to main when encoder moved
Start timed interrupt routine - used to save data to EEProm if data has changed after a delay of 1-255 seconds (set at compile time)
Adjusts size of frequency inc/dec (corresponds with switch push above)
Calculate DDS tuning word - inc/dec freq depending on which way the encoder moved
Checks tuning word is within limits other wise sets hi/lo limit
Send the DDS tuning word to the DDS module
Puts the PIC to sleep and waits for encoder movement or button push
!!! There is an independent calibration routine that is only entered using a specific button sequence and only at power up that uses the encoder in a continuous polling mode !!!