Joep wrote:
{Quote hidden}>
> I want to make a program for the PIC16f84 to control a PLL. It has some user
> input keys, and needs to clock out the stream serial (no probs).
>
> Does anybody knows how to convert (in the code) the user input in MHz/KHz to
> the serial bits needed by the PLL.
>
> See it as follow:
>
> bit 1 = 512 MHz (it stays on 0)
> bit 2 = 256 MHz (it stays on 1)
> bit 3 = 128 MHz (it stays on 1)
> bit 4 = 64 MHz ( depends on user input)
> bit 5 = 32 MHz ( "" )
> bit 6 = 16 MHz ( "" )
> bit 7 = 8 MHz ( etc )
> bit 8 = 4 MHz
> bit 9 = 2 MHz
> bit 10 =1 MHz
> bit 11 = 64*12,5KHz
> bit 12 = 32*12,5KHz etc...
>
I think you are asking how to convert a user input in
decimal to binary that the PLL circuit uses?
Decimal (BCD) to Binary conversion is well covered in
PICLIST archives, Microchip app notes
(http://www.microchip.com) etc. Look and learn.
_____________________________
Lance Allen
Technical Officer
Uni of Auckland
Psych Dept
New Zealand
http://www.psych.auckland.ac.nz
_____________________________