This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
resources:tools-software:linux-drivers:iio-pll:ad9523 [04 May 2012 17:14] – created Michael Hennerich | resources:tools-software:linux-drivers:iio-pll:ad9523 [11 Feb 2016 20:58] (current) – [Datasheets] Lars-Peter Clausen | ||
---|---|---|---|
Line 8: | Line 8: | ||
===== Evaluation Boards ===== | ===== Evaluation Boards ===== | ||
- | * [[adi> | + | * [[adi>EVAL-AD9523-1|AD9523-1/ |
- | {{scrape> | ||
- | * [[adi> | ||
- | * {{scrape> | ||
===== Description ===== | ===== Description ===== | ||
Line 24: | Line 21: | ||
===== Status ===== | ===== Status ===== | ||
- | ^ Source | + | ^ Source ^ Mainlined? ^ |
- | | [[git.linux.org> | + | | [[git.linux.org> |
===== Files ===== | ===== Files ===== | ||
^ Function ^ File ^ | ^ Function ^ File ^ | ||
- | | driver | + | | driver |
- | | include | [[git.linux.org> | + | | include | [[git.linux.org> |
- | | Documentation | [[git.linux.org> | + | | Documentation | [[git.linux.org> |
====== Example platform device initialization ====== | ====== Example platform device initialization ====== | ||
Line 40: | Line 37: | ||
<code c> | <code c> | ||
+ | /** | ||
+ | * struct ad9523_channel_spec - Output channel configuration | ||
+ | * | ||
+ | * @channel_num: | ||
+ | * @divider_output_invert_en: | ||
+ | * @sync_ignore_en: | ||
+ | * @low_power_mode_en: | ||
+ | * @use_alt_clock_src: | ||
+ | * @output_dis: | ||
+ | * @driver_mode: | ||
+ | * @divider_phase: | ||
+ | LSB = 1/2 of a period of the divider input clock. | ||
+ | * @channel_divider: | ||
+ | * @extended_name: | ||
+ | */ | ||
+ | |||
struct ad9523_channel_spec { | struct ad9523_channel_spec { | ||
unsigned channel_num; | unsigned channel_num; | ||
Line 54: | Line 67: | ||
}; | }; | ||
- | /* | + | /** |
* struct ad9523_platform_data - platform specific information | * struct ad9523_platform_data - platform specific information | ||
+ | * | ||
+ | * @vcxo_freq: External VCXO frequency in Hz | ||
+ | * @refa_diff_rcv_en: | ||
+ | * @refb_diff_rcv_en: | ||
+ | * @zd_in_diff_en: | ||
+ | * @osc_in_diff_en: | ||
+ | * @refa_cmos_neg_inp_en: | ||
+ | * @refb_cmos_neg_inp_en: | ||
+ | * @zd_in_cmos_neg_inp_en: | ||
+ | * @osc_in_cmos_neg_inp_en: | ||
+ | * @refa_r_div: | ||
+ | * @refb_r_div: | ||
+ | * @pll1_feedback_div: | ||
+ | * @pll1_charge_pump_current_nA: | ||
+ | * @zero_delay_mode_internal_en: | ||
+ | * @osc_in_feedback_en: | ||
+ | | ||
+ | * @pll1_loop_filter_rzero: | ||
+ | * @ref_mode: Reference selection mode. | ||
+ | * @pll2_charge_pump_current_nA: | ||
+ | * @pll2_ndiv_a_cnt: | ||
+ | * @pll2_ndiv_b_cnt: | ||
+ | * @pll2_freq_doubler_en: | ||
+ | * @pll2_r2_div: | ||
+ | * @pll2_vco_diff_m1: | ||
+ | * @pll2_vco_diff_m2: | ||
+ | * @rpole2: PLL2 loop filter Rpole resistor value. | ||
+ | * @rzero: PLL2 loop filter Rzero resistor value. | ||
+ | * @cpole1: PLL2 loop filter Cpole capacitor value. | ||
+ | * @rzero_bypass_en: | ||
+ | * @num_channels: | ||
+ | * @channels: Pointer to channel array. | ||
+ | * @name: Optional alternative iio device name. | ||
*/ | */ | ||
Line 62: | Line 108: | ||
/* Differential/ | /* Differential/ | ||
- | bool refa_diff_rcv_en; | + | bool refa_diff_rcv_en; |
- | bool refb_diff_rcv_en; | + | bool refb_diff_rcv_en; |
- | bool zd_in_diff_en; | + | bool zd_in_diff_en; |
- | bool osc_in_diff_en; | + | bool osc_in_diff_en; |
/* | /* | ||
* Valid if differential input disabled | * Valid if differential input disabled | ||
- | * if not true defaults to pos input | + | * if false defaults to pos input |
*/ | */ | ||
- | bool refa_cmos_neg_inp_en; | + | bool refa_cmos_neg_inp_en; |
- | bool refb_cmos_neg_inp_en; | + | bool refb_cmos_neg_inp_en; |
- | bool zd_in_cmos_neg_inp_en; | + | bool zd_in_cmos_neg_inp_en; |
- | bool osc_in_cmos_neg_inp_en; | + | bool osc_in_cmos_neg_inp_en; |
/* PLL1 Setting */ | /* PLL1 Setting */ | ||
- | unsigned short refa_r_div; | + | unsigned short refa_r_div; |
- | unsigned short refb_r_div; | + | unsigned short refb_r_div; |
- | unsigned short pll1_feedback_div; | + | unsigned short pll1_feedback_div; |
- | unsigned short pll1_charge_pump_current_nA; | + | unsigned short pll1_charge_pump_current_nA; |
- | bool zero_delay_mode_internal_en; | + | bool zero_delay_mode_internal_en; |
- | bool osc_in_feedback_en; | + | bool osc_in_feedback_en; |
- | unsigned char pll1_loop_filter_rzero; | + | enum pll1_rzero_resistor pll1_loop_filter_rzero; |
/* Reference */ | /* Reference */ | ||
- | enum ref_sel_mode ref_mode; | + | enum ref_sel_mode ref_mode; |
/* PLL2 Setting */ | /* PLL2 Setting */ | ||
- | unsigned int pll2_charge_pump_current_nA; | + | unsigned int pll2_charge_pump_current_nA; |
- | unsigned char pll2_ndiv_a_cnt; | + | unsigned char pll2_ndiv_a_cnt; |
- | unsigned char pll2_ndiv_b_cnt; | + | unsigned char pll2_ndiv_b_cnt; |
- | bool pll2_freq_doubler_en; | + | bool pll2_freq_doubler_en; |
- | unsigned char pll2_r2_div; | + | unsigned char pll2_r2_div; |
- | unsigned char pll2_vco_diff_m1; | + | unsigned char pll2_vco_diff_m1; |
- | unsigned char pll2_vco_diff_m2; | + | unsigned char pll2_vco_diff_m2; |
/* Loop Filter PLL2 */ | /* Loop Filter PLL2 */ | ||
- | unsigned char rpole2; | + | enum rpole2_resistor rpole2; |
- | unsigned char rzero; | + | enum rzero_resistor rzero; |
- | unsigned char cpole1; | + | enum cpole1_capacitor cpole1; |
- | bool rzero_bypass_en; | + | bool rzero_bypass_en; |
/* Output Channel Configuration */ | /* Output Channel Configuration */ | ||
- | int num_channels; | + | int num_channels; |
struct ad9523_channel_spec *channels; | struct ad9523_channel_spec *channels; | ||
- | char name[SPI_NAME_SIZE]; | + | char name[SPI_NAME_SIZE]; |
}; | }; | ||
</ | </ | ||
Line 249: | Line 295: | ||
#if defined(CONFIG_AD9523) || defined(CONFIG_AD9523_MODULE) | #if defined(CONFIG_AD9523) || defined(CONFIG_AD9523_MODULE) | ||
{ | { | ||
- | .modalias = " | + | .modalias = " |
.max_speed_hz = 1000000, | .max_speed_hz = 1000000, | ||
.bus_num = 0, | .bus_num = 0, | ||
Line 278: | Line 324: | ||
"make qconfig" | "make qconfig" | ||
- | <note> | + | <WRAP round help> |
The AD9523 Driver depends on **CONFIG_SPI** | The AD9523 Driver depends on **CONFIG_SPI** | ||
- | </note> | + | </WRAP> |
< | < | ||
Linux Kernel Configuration | Linux Kernel Configuration | ||
Device Drivers | Device Drivers | ||
- | [*] Staging drivers | + | < |
- | < | + | |
- | | + | Frequency Synthesizers DDS/ |
- | Frequency Synthesizers DDS/ | + | Clock Generator/ |
- | Clock Generator/ | + | |
- | | + | <*> Analog Devices AD9523 Low Jitter Clock Generator |
- | + | | |
- | <*> Analog Devices AD9523 Low Jitter Clock Generator | + | |
- | + | ||
- | | + | |
</ | </ | ||
Line 305: | Line 347: | ||
{{page> | {{page> | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
root:/> **cd / | root:/> **cd / | ||
Line 314: | Line 356: | ||
root:/> **ls -l** | root:/> **ls -l** | ||
total 0 | total 0 | ||
- | -r--r--r-- | + | drwxr-xr-x |
+ | drwxr-xr-x | ||
+ | -r--r--r-- | ||
-r--r--r-- | -r--r--r-- | ||
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -rw-r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | -r--r--r-- |
- | -r--r--r-- | + | --w------- |
- | --w------- | + | lrwxrwxrwx |
- | lrwxrwxrwx | + | --w------- |
- | --w------- | + | -rw-r--r-- |
- | -rw-r--r-- | + | -r--r--r-- |
- | </ | + | </ |
=== Show device name === | === Show device name === | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
root:/> **cd / | root:/> **cd / | ||
root:/> **cat name** | root:/> **cat name** | ||
ad9523-lpc | ad9523-lpc | ||
- | </ | + | </ |
=== Set ChannelY Output Frequency === | === Set ChannelY Output Frequency === | ||
Line 372: | Line 416: | ||
channel. | channel. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
root:/> **cat out_altvoltage1_DAC_CLK_frequency** | root:/> **cat out_altvoltage1_DAC_CLK_frequency** | ||
Line 379: | Line 423: | ||
root:/> **cat out_altvoltage1_DAC_CLK_frequency** | root:/> **cat out_altvoltage1_DAC_CLK_frequency** | ||
245760000 | 245760000 | ||
- | </ | + | </ |
=== Set ChannelY Output Divider Phase === | === Set ChannelY Output Divider Phase === | ||
Line 391: | Line 435: | ||
channel. | channel. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
root:/> **cat out_altvoltage1_DAC_CLK_phase** | root:/> **cat out_altvoltage1_DAC_CLK_phase** | ||
Line 398: | Line 442: | ||
root:/> **cat out_altvoltage1_DAC_CLK_phase** | root:/> **cat out_altvoltage1_DAC_CLK_phase** | ||
3.1415920 | 3.1415920 | ||
- | </ | + | </ |
=== Disable / Power Down ChannelY === | === Disable / Power Down ChannelY === | ||
Line 407: | Line 451: | ||
any value > 0 enables the channel. | any value > 0 enables the channel. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
root:/> **cat out_altvoltage1_DAC_CLK_raw** | root:/> **cat out_altvoltage1_DAC_CLK_raw** | ||
Line 414: | Line 458: | ||
root:/> **cat out_altvoltage1_DAC_CLK_raw** | root:/> **cat out_altvoltage1_DAC_CLK_raw** | ||
0 | 0 | ||
- | </ | + | </ |
=== Query Device Status === | === Query Device Status === | ||
- | / | + | / |
- | / | + | / |
- | / | + | / |
- | / | + | / |
- | / | + | / |
- | / | + | / |
- | / | + | / |
+ | / | ||
- | Reading returns either 'OK' or 'FAIL'. 'OK' means that the | + | Reading returns either '1' or '0'. '1' means that the |
- | clock in question is present or the pllY is locked. 'FAIL' | + | clock in question is present or the pllY is locked. '0' |
means that the clock is missing or the pllY is unlocked. | means that the clock is missing or the pllY is unlocked. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
- | root:/> **cat status_pll1_lock_detect** | + | root:/> **cat pll1_locked** |
- | OK | + | 1 |
+ | |||
+ | root:/> **grep "" | ||
+ | pll1_locked: | ||
+ | pll1_reference_clk_a_present: | ||
+ | pll1_reference_clk_b_present: | ||
+ | pll1_reference_clk_test_present: | ||
+ | pll2_feedback_clk_present: | ||
+ | pll2_locked: | ||
+ | pll2_reference_clk_present: | ||
+ | vcxo_clk_present: | ||
- | root:/> grep "" | + | </ |
- | status_pll1_lock_detect: | + | |
- | status_pll2_feedback_clock: | + | |
- | status_pll2_lock_detect: | + | |
- | status_pll2_reference_clock: | + | |
- | status_reference_a: | + | |
- | status_reference_b: | + | |
- | status_reference_test: | + | |
- | status_vcxo: | + | |
- | </ | + | |
=== Save Current Device Config to EEPROM === | === Save Current Device Config to EEPROM === | ||
Line 454: | Line 500: | ||
automatically load the saved configuration. | automatically load the saved configuration. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
root:/> **echo 1 > store_eeprom** | root:/> **echo 1 > store_eeprom** | ||
- | </ | + | </ |
=== SYNC Device === | === SYNC Device === | ||
Line 469: | Line 515: | ||
/SYNC pin low. | /SYNC pin low. | ||
- | < | + | <WRAP box bggreen>< |
< | < | ||
root:/> **echo 1 > sync_dividers** | root:/> **echo 1 > sync_dividers** | ||
- | </ | + | </ |
====== More Information ====== | ====== More Information ====== | ||
{{page> | {{page> |