The blog of a dedicated radio amateur and electronics enthusiast

"Having fun on the air and in the workshop - communicating and creating"

24 December 2010

Stepping up and stepping down

A few hours ago I took my frequency synthesiser project a significant step nearer to completion. I had a 'eureka' moment; not actually in the bath but instead while waiting to go Christmas shopping with my daughter.
A long time ago I had programmed the PIC microcontroller to show the frequency on the liquid crystal display. The number crunching sequences needed are binary to binary coded decimal ( bcd ) conversion, bcd to ascii, and finally, supression of any leading zeros to prepare the number for display.
For weeks I had been baffled why I couldn't achieve this repetitively in order to step the displayed frequency up or down in response to clockwise or counter-clockwise turning of the rotary encoder; the only difference being to include multiple byte addition and subtraction. This I have now managed to do. It's a great result for me and so good to see on the display. Now I can enjoy Christmas and not be distracted by searching for a solution any more.
This was one of the last two crucial issues to be resolved; the other being to increment / decrement the tuning word by the same step size for sending to the synthesiser chip, which should be straightforward. So I ought to be able to complete the prototype frequency synthesiser this month - famous last words !

No comments: