Sonsivri

Electronics => Projects => Topic started by: folkeu on March 10, 2021, 03:38:22 15:38



Title: Control an MC145152 (PLL) by a processor
Post by: folkeu on March 10, 2021, 03:38:22 15:38
Hi all,

I'm trying to drive an MC145152 (PLL) by a Pic processor through an MCP23s17.
The MCp23s17 replaces the programming DIPs.
I need help creating the routine in C to decompose a decimal number into a sum of powers of two.
The decimal number can range from 3 to 1023 (Counter N).
I stay in the program, I almost finished, I stumble on it.
Thank you
Fanch


Title: Re: Control an MC145152 (PLL) by a processor
Post by: titi on March 10, 2021, 05:23:26 17:23
Hi folkeu,

no need to decompose your decimal number into a sum of powers of two.

Just use one port with 8 bits as low byte and the 2 high bits on the other port.

Your value 3 to 1023 is on a unsigned integer of 16 bits.
So just send the low byte of the value one port and the first 2 high bits of the high byte to the second port of the MCP23s17.

Best regards.