Electronic Components Datasheet Search |
|
AN334 Datasheet(PDF) 10 Page - Silicon Laboratories |
|
AN334 Datasheet(HTML) 10 Page - Silicon Laboratories |
10 / 44 page AN334 10 Rev. 0.4 //----------------------------------------------------------------------------- void SMBus_Init (void); void Timer1_Init (void); void Timer2_Init (void); void Int0_Init (void); void Port_Init (void); INTERRUPT_PROTO(SMBus_ISR, INTERRUPT_SMBUS0); INTERRUPT_PROTO(ButtonPushed_ISR, INTERRUPT_INT0); INTERRUPT_PROTO(Timer2_ISR, INTERRUPT_TIMER2); void RunFreqProg (void); U8 SetBits (U8 original, U8 reset_mask, U8 new_val); void ReadStartUpConfiguration (void); void UpdateStatusOutput (void); void I2C_ByteWrite (U8 addr, U8 dat); U8 I2C_ByteRead (U8 addr); //----------------------------------------------------------------------------- // MAIN Routine //----------------------------------------------------------------------------- // // Main routine performs all configuration tasks, then loops forever waiting // for the 'next' button on the board to be pressed. When pressed, the Si570 // will then output the next frequency. // void main (void){ U8 i; // Temporary counter variable used in // for loops PCA0MD &= ~0x40; // WDTE = 0 (disable watchdog timer) OSCICN |= 0x03; // Configure internal oscillator for // its maximum frequency (24.5 Mhz) // If slave is holding SDA low because of an improper SMBus reset or error while(!SDA) { // Provide clock pulses to allow the slave to advance out // of its current state. This will allow it to release SDA. XBR1 = 0x40; // Enable Crossbar SCL = 0; // Drive the clock low for(i = 0; i < 255; i++); // Hold the clock low SCL = 1; // Release the clock while(!SCL); // Wait for open-drain // clock output to rise for(i = 0; i < 10; i++); // Hold the clock high XBR1 = 0x00; // Disable Crossbar } Port_Init (); // Initialize Crossbar and GPIO 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 Int0_Init (); // Configure INT0 EIE1 |= 0x01; // Enable SMBus interrupt |
Similar Part No. - AN334 |
|
Similar Description - AN334 |
|
|
Link URL |
Privacy Policy |
ALLDATASHEET.NET |
Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
Family Site : ic2ic.com |
icmetro.com |