
AN428
24 Rev. 0.6
CKCON = 0x10; // Timer 1 is sysclk
// Timer 2 is sysclk/12 (see TMR2CN)
Timer1_Init (); // Configure Timer1 for use as SMBus
// clock source
Timer2_Init (); // Configure Timer2 for use with SMBus
// low timeout detect
SMBus_Init (); // Configure and enable SMBus
EIE1 |= 0x01; // Enable SMBus interrupt
EA = 1; // Global interrupt enable****MUST BE LAST****
//----------------------------------------------------------------
// See Si5338 datasheet Figure 9 for more details on this procedure
// delay added to wait for Si5338 to be ready to communicate
// after turning on
counter = 0;
while(counter < SI5338_DELAY) { counter++; }
I2C_ByteWrite(230, 0x10); //OEB_ALL = 1
I2C_ByteWrite(241, 0xE5); //DIS_LOL = 1
//for all the register values in the Reg_Store array
//get each value and mask and apply it to the Si5338
for(counter=0; counter<NUM_REGS_MAX; counter++){
curr = Reg_Store[counter];
if(curr.Reg_Mask != 0x00) {
if(curr.Reg_Mask == 0xFF) {
// do a write transaction only
Kommentare zu diesen Handbüchern