Advertisement
Guest User

E4000 frequency band calculator

a guest
May 26th, 2012
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.17 KB | None | 0 0
  1. #include <stdio.h>
  2.  
  3. #define E4K_FVCO_MIN_KHZ    2600000 /* 2.6 GHz */
  4. #define E4K_FVCO_MAX_KHZ    3900000 /* 3.9 GHz */
  5.  
  6. int main() {
  7.     /* \brief table of R dividers in case 3phase mixing is enabled,
  8.     * the values have to be halved if it's 2phase */
  9.     static const unsigned int vco_r_table_3ph[] = {
  10.            4, 8, 12, 16, 24, 32, 40, 48
  11.     };
  12.    
  13.     unsigned long min_freq, max_freq;
  14.    
  15.     int i;
  16.    
  17.     printf("Calculating 2phase frequencies\n");
  18.     for(i=0; i < 8 /*sizeof(vco_r_table_3ph)*/; i++) {
  19.              min_freq = E4K_FVCO_MIN_KHZ * 1000UL / (vco_r_table_3ph[i]/2);
  20.              max_freq = E4K_FVCO_MAX_KHZ * 1000UL / (vco_r_table_3ph[i]/2);
  21.              printf("Divider %d: min=%ld Hz max=%ld Hz\n", vco_r_table_3ph[i]/2, min_freq, max_freq);
  22.     }
  23.    
  24.     printf("\nCalculating 3phase frequencies\n");
  25.     for(i=0; i < 8 /*sizeof(vco_r_table_3ph)*/; i++) {
  26.              min_freq = E4K_FVCO_MIN_KHZ * 1000UL / vco_r_table_3ph[i];
  27.              max_freq = E4K_FVCO_MAX_KHZ * 1000UL / vco_r_table_3ph[i];
  28.              printf("Divider %d: min=%ld Hz max=%ld Hz\n", vco_r_table_3ph[i], min_freq, max_freq);
  29.     }
  30.    
  31.     system("pause");
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement