The Godfather talking
This is god damn my place! Capisci?
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 16, 2024, 10:58:27 10:58


Login with username, password and session length


Pages: [1]
Print
Author Topic: Control an MC145152 (PLL) by a processor  (Read 2064 times)
0 Members and 1 Guest are viewing this topic.
folkeu
Active Member
***
Offline Offline

Posts: 214

Thank You
-Given: 123
-Receive: 288


« 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
Logged
titi
Active Member
***
Offline Offline

Posts: 229

Thank You
-Given: 3690
-Receive: 834



« Reply #1 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.
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC