sajay
Newbie level 4
Hi Member,
I trying to control IC PLL frequency synthesizer prescaler TSA5511 to my PIC16F628A, I used SDA and SCL pin to make it communication, seems the TSA 5511 configuration doesn't work fine.
Here are my codes, can you please help me, what are wrong with the code :
I am very appreciate for your help.
Thank you.
Sj
I trying to control IC PLL frequency synthesizer prescaler TSA5511 to my PIC16F628A, I used SDA and SCL pin to make it communication, seems the TSA 5511 configuration doesn't work fine.
Here are my codes, can you please help me, what are wrong with the code :
C:
void SetFreq(double dFrequentie)
{
int iPrescaler;
unsigned char ubCpByte = 0x00;
unsigned char ubPortByte = 0x00;
if(dFrequentie > F_STOP || dFrequentie < F_START)
{
return; //ongeldige frequentie
}
iPrescaler = ((dFrequentie / INPUT_DIVIDE) / REF);
i2c_start();
i2c_write(TSA5511_WRITE_ADDRESS);
i2c_write((unsigned char)iPrescaler);//MSB
i2c_write((unsigned char)(iPrescaler<<8)); //LSB
i2c_write(ubCpByte);
i2c_write(ubPortByte);
i2c_stop();
}
void main() {
}
I am very appreciate for your help.
Thank you.
Sj