资源简介
ADI公司DDS芯片AD9959的驱动,基于stm32
代码片段和文件信息
#include “stm32f10x.h“
#include “stm32f10x_spi.h“
#include “stm32f10x_gpio.h“
#include “AD9959.h“
#include “delay.h“
void AD9959_RCC_Init(void);
void AD9959_GPIO_Init(void);
void AD9959_500M_Init(void);
//ch1 配置
Chrip_Config Ch1_ChripConfig={
1 //开
0 //连续
1000000 //1M
5000000 //5M
1 //1ms
10 //10ms
10.00 //10.0v
0.0 //0度
};
//ch2 配置
Chrip_Config Ch2_ChripConfig={
0 //关
0 //连续
1000000 //1M
5000000 //5M
1 //1ms
10 //10ms
10.00 //10.0v
0.0 //0度
};
//ch2 配置
Chrip_Config Ch3_ChripConfig={
0 //关
0 //连续
1000000 //1M
5000000 //5M
1 //1ms
10 //10ms
10.00 //10.0v
0.0 //0度
};
//ch4 配置
Chrip_Config Ch4_ChripConfig={
0 //关
0 //连续
1000000 //1M
5000000 //5M
1 //1ms
10 //10ms
10.00 //10.0v
0.0 //0度
};
//寄存器地址
/********************************************************************************************************************/
#define CSR 0x00 //CSR 通道选择寄存器,包括通道选择,串行 3 线 通信模式,数据传输首先高低位设置
//default Value = 0xF0 详细请参见AD9958 datasheet Table 27
//Bit7: CH1 enableBit6: CH0 enable
/*********single-bit 2-wire mode***********/
u8 CSR_DATA0[1] = {0x10}; // 开 CH0
u8 CSR_DATA1[1] = {0x20}; // 开 CH1
u8 CSR_DATA2[1] = {0x40}; // 开 CH2
u8 CSR_DATA3[1] = {0x80}; // 开 CH3
/******************************************/
/*********single-bit 3-wire mode***********/
//u8 CSR_DATA0[1] = {0x12}; // 开 CH0
//u8 CSR_DATA1[1] = {0x22}; // 开 CH1
//u8 CSR_DATA2[1] = {0x42}; // 开 CH2
//u8 CSR_DATA3[1] = {0x82}; // 开 CH3
/******************************************/
#define FR1 0x01 //Function Register 1 功能寄存器1
u8 FR1data[3] = {0xD30x000x00};//default Value = 0x000000; 20倍频; Charge pump control = 75uA
//FR1<23> -- VCO gain control =0时 system clock below 160 MHz;
// =1时 the high range (system clock above 255 MHz
#define FR2 0x02 //Function Register 2 功能寄存器2
u8 FR2data[2] = {0x000x00}; //default Value = 0x0000
#define CFR 0x03 //Channel Function Register 通道功能寄存器
//u8 CFRdata[3] = {0x000x230x37};//default Value = 0x000300
//u8 CFRdata[3] = {0x800x430x00}; //Linear Sweep enablefrequency modulation DAC Full Scale no_dwell disable
//u8 CFRdata[3] = {0x800xC30x00}; //Linear Sweep enablefrequency modulation DAC Full Scale no_dwell enable
#define CFTW0 0x04 //Channel Frequency Tuning Word 0 通道频率控制字0
//25MHZ 无源晶振20倍频
//u8 ChannelFrequencyTuningWord0data[4] = {0x000x0d0x1B0x71}; //OUT 100KHZ
//u8 ChannelFrequencyTuningWord0data[4] = {0x000x830x120x6F}; //OUT 1MHZ
//u8 ChannelFrequencyTuningWord0data[4] = {0x050x1E0xB80x52}; //OUT 10MHZ
//u8 ChannelFrequencyTuningWord0da
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-02-19 18:43 AD9959\
文件 19672 2015-12-01 15:05 AD9959\AD9959.c
文件 4501 2015-12-01 15:04 AD9959\AD9959.h
- 上一篇:GPS卫星定位中载波相位测量的观测方程
- 下一篇:密码学试题B及答案
评论
共有 条评论