打印
[STM32F4]

使用STM32 控制 锁相环 HMC830的疑问!

[复制链接]
3842|22
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
東南博士|  楼主 | 2018-7-30 15:43 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
使用STM32 控制 锁相环 HMC830的疑问!


请问 哪位做过相关的设计呢?
沙发
東南博士|  楼主 | 2018-7-30 15:44 | 只看该作者
单独给830外部接电源供电,然后高温下,单独给830掉电重启,后初始化配置830,显示锁定;
另一种,高温下,830不断电,单板其余模块断电重启(包含HMC830 SPI端口),软件初始化后,830也锁定;
或者此种情况,高温下,单板所有电源掉电,同时上电重启,软件初始化后,830依然锁定;
这是不是说明了您说的这种情况?
但是为什么,不单独给830供电,抓常温和 高温时,HMC830上电时的所有电压,上升沿和上升时间基本一致呢?

使用特权

评论回复
板凳
東南博士|  楼主 | 2018-7-30 15:44 | 只看该作者
HMC830高温下失锁:
常温上电,正常锁定,加载环境温度达75度,依然锁定,
当在高温下掉电,重启后,HMC830失锁,重复操作多次都失锁。
失锁时,测试参考频率正常(122.88M);
              读/写寄存器SPI时序正常;供电电压正常;上下电测得HMC830处于OPEN MODE模式;
失锁过程中,降温,且降温过程,软件操作对器件一直正确配置寄存器,并读取锁定状态,恢复常温后,依然不能锁定;
恢复常温后,需再次掉电,重启才锁定。

使用特权

评论回复
地板
東南博士|  楼主 | 2018-7-30 15:45 | 只看该作者
//----------------------------------------------------------------------------------------------------------------------------------
#define OPENLOOP    0       //SPI Mode的判断方式 (开环: 1, 闭环: 0)
#define HMCMODE     1       //HMC Mode | OPEN Mode模式选择(HMC Mode: 1, OPEN Mode: 0)

//#define DEBUG                                //调试模式

使用特权

评论回复
5
東南博士|  楼主 | 2018-7-30 15:45 | 只看该作者
//*******************通道信息******************
#define Chanl_U1                        0
#define Chanl_U2                                            1
#define Chanl_U3                                            2
#define Chanl_U4                                            3

使用特权

评论回复
6
東南博士|  楼主 | 2018-7-30 15:45 | 只看该作者
//*********************************************

uint32_t REG0_830  = 0x400A7975;    //X  RD a5-a0 d23-d0   0 1 00_0000 0000 1010 0111 1001 0111 0101
uint32_t REGF0_830 = 0x0F0000C0;    //X /WR a5-a0 d23-d0   0 0 00_1111 0000 0000 0000 0000 1100 0000
uint32_t REGF1_830 = 0x0F0000E0;    //X /WR a5-a0 d23-d0   0 0 00_1111 0000 0000 0000 0000 1110 0000
uint32_t REG12_830 = 0x52000000;    //X  RD a5-a0 d23-d0   0 1 01_0010 0000 0000 0000 0000 0000 0000

使用特权

评论回复
7
東南博士|  楼主 | 2018-7-30 15:47 | 只看该作者
/*******************************************************************************
** 名称: void HMC830LatchSet(uint8_t chanl)
** 描述: 置HMC830 SEN
** 输入: chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 创建: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修定:
** 日期:
*******************************************************************************/
void HMC830LatchSet(uint8_t chanl)
{
        switch(chanl)
        {
        case Chanl_U1:
                SEN_830_PLL0_Set();
                break;
        case Chanl_U2:
                SEN_830_PLL1_Set();
                break;
        case Chanl_U3:
                SEN_830_PLL2_Set();
                break;
        case Chanl_U4:
                SEN_830_PLL3_Set();
                break;
        default:
                break;
        }
}

使用特权

评论回复
8
東南博士|  楼主 | 2018-7-30 15:48 | 只看该作者
/*******************************************************************************
** 名称: void HMC830LatchClr(uint8_t chanl)
** 描述: 清HMC830 SEN
** 输入: chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 创建: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修定:
** 日期:
*******************************************************************************/
void HMC830LatchClr(uint8_t chanl)
{
        switch(chanl)
        {
        case Chanl_U1:
                SEN_830_PLL0_Clr();
                break;
        case Chanl_U2:
                SEN_830_PLL1_Clr();
                break;
        case Chanl_U3:
                SEN_830_PLL2_Clr();
                break;
        case Chanl_U4:
                SEN_830_PLL3_Clr();
                break;
        default:
                break;
        }
}

使用特权

评论回复
9
東南博士|  楼主 | 2018-7-30 15:48 | 只看该作者
/*******************************************************************************
** 名称: void clk_830_set(uint8_t chanl)
** 描述: 置HMC830 CLK
** 输入: chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 创建: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修定:
** 日期:
*******************************************************************************/
void clk_830_set(uint8_t chanl)
{
        switch(chanl)
        {
        case Chanl_U1:
                clk_830_PLL_set();
                break;

        case Chanl_U2:
                //clk_830_PLL_set();
                break;

        case Chanl_U3:
                //clk_830_PLL_set();
                break;

        case Chanl_U4:
                //clk_830_PLL_set();
                break;

        default:
                break;
        }
}

使用特权

评论回复
10
東南博士|  楼主 | 2018-7-30 15:49 | 只看该作者
/*******************************************************************************
** 名称: void clk_830_clr(uint8_t chanl)
** 描述: 清HMC830 CLK
** 输入: chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 创建: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修定:
** 日期:
*******************************************************************************/
void clk_830_clr(uint8_t chanl)
{
        switch(chanl)
        {
        case Chanl_U1:
                clk_830_PLL_clr();
                break;

        case Chanl_U2:
                //clk_830_PLL_clr();
                break;

        case Chanl_U3:
                //clk_830_PLL_clr();
                break;

        case Chanl_U4:
                //clk_830_PLL_clr();
                break;

        default:
                break;
        }
}

使用特权

评论回复
11
東南博士|  楼主 | 2018-7-30 15:50 | 只看该作者
/*******************************************************************************
** 名称: void HMC830_hmc_write(uint32_t PLL_REG, uint8_t chanl)
** 描述: 向HMC830发送数据(HMC MODE)
** 输入: PLL_REG: 寄存器值,chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 创建: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修定:
** 日期:
*******************************************************************************/
void HMC830_hmc_write(uint32_t PLL_REG, uint8_t chanl)
{
        uint8_t i;

        wdt_reset();

        HMC830LatchClr(chanl);
        delay_ms(10);
        HMC830LatchSet(chanl);                                //If a rising edge on SEN is detected first HMC Mode is selected.
        delay_ms(10);                                        //SEN to SCLK setup time > 8ns

        for (i = 0; i < 32; i++)                        //b.The slave (synthesizer) reads SDI on the 1st rising edge of SCK after SEN. SDI low indi cates a Write cycle (/WR).
        {
                //d,f.Slave shifts the 6 address bits, the 24 data bits in the next 30 rising edges of SCK (2-31).
                PLL_REG <<= 1;                                //首位数据无效,丢掉;最后一位补零凑齐32个时钟周期
                clk_830_clr(chanl);                        //HMC830时钟
                if ((PLL_REG & 0x80000000) == 0)
                {
                        data_830_clr(chanl);                //HMC830 数据
                }
                else
                {
                        data_830_set(chanl);
                }
                delay_us(5);                                //SDI to SCLK setup time  > 3ns
                clk_830_set(chanl);
                delay_us(5);                                //SCLK to SDI hold time  > 3ns
        }
        clk_830_clr(chanl);                                //HMC830时钟

        delay_ms(10);                                        //SCK to SEN fall > 10ns
        HMC830LatchClr(chanl);
        delay_ms(20);                                        //SEN low duration > 20 ns
}

使用特权

评论回复
12
東南博士|  楼主 | 2018-7-30 15:50 | 只看该作者
/*******************************************************************************
** 名称: void HMC830_hmc_read(uint32_t REG, uint8_t chanl)
** 描述: 从HMC830读数据(HMC MODE)
** 输入  : PLL_REG: 寄存器值,chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 创建: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修定:
** 日期:
*******************************************************************************/
void HMC830_hmc_read(uint32_t REG, uint8_t chanl)
{
        uint8_t i;
        uint32_t  PLL_REG = REG;

#ifdef DEBUG
        uint8_t *p = (uint8_t *)(&PLL_REG); //调试
#endif

        wdt_reset();

        HMC830LatchClr(chanl);
        delay_ms(10);
        HMC830LatchSet(chanl);                //If a rising edge on SEN is detected first HMC Mode is selected.
        delay_ms(10);                        //SEN to SCLK setup time > 8ns

        for (i = 0; i < 7; i++)                //b. The slave (PLL with Integrated VCO) reads SDI on the 1st rising edge of SCLK after SEN. SDI high initiates the READ cycle (RD)
        {
                //d. Slave registers the address bits on the next six rising edges of SCLK (2-7).
                PLL_REG <<= 1;                                        //首位数据无效,丢掉
                clk_830_clr(chanl);                                //HMC830时钟
                if ((PLL_REG & 0x80000000) == 0)
                {
                        data_830_clr(chanl);                        //HMC830数据
                }
                else
                {
                        data_830_set(chanl);
                }
                delay_us(5);                                        //SDI to SCLK setup time  > 3ns
                clk_830_set(chanl);
                delay_us(5);                                        //SCLK to SDI hold time  > 3ns
        }

        clk_830_clr(chanl);                                        //HMC830时钟
        data_830_clr(chanl);                                        //HMC830数据
        delay_us(5);
        PLL_REG = 0x00000000;                                        //读HMC830数据
        for (i = 0; i < 24; i++)                                //f. Host registers the data bits on the next 24 falling edges of SCK (8-31).
        {
                PLL_REG <<= 1;
                clk_830_set(chanl);
                delay_us(5);                                        //SCLK to SDO delay > 8.2ns+0.2ns/pF
                if (Read_LOCK_830_PLL0())
                {
                        PLL_REG |= 0x00000001;                        //HMC830数据
                }
                else
                {
                        PLL_REG &= ~0x00000001;                        //HMC830数据
                }
                clk_830_clr(chanl);                                //HMC830时钟
                delay_us(5);
        }
        clk_830_set(chanl);
        delay_us(5);
        clk_830_clr(chanl);                                        //HMC830时钟

        delay_ms(10);                                                //Recovery Time > 10ns
        HMC830LatchClr(chanl);                                        //h. Deassertion of SEN completes the cycle
        delay_ms(20);                                                //SEN low duration > 20 ns

        if(REG == REG0_830)
        {
                if(PLL_REG == 0x000A7975)
                {
                        mode = 0xEF; //hmc_mode
                }
        }
        else
        {
                if(PLL_REG & 0x00000002)
                {
                        lock = 0x01;
                }
                else
                {
                        lock = 0x00;
                }
        }

#ifdef DEBUG
        SendStrData(p + 3, 1); //调试
        SendStrData(p + 2, 1); //调试
        SendStrData(p + 1, 1); //调试
        SendStrData(p, 1); //调试
#endif
}

使用特权

评论回复
13
東南博士|  楼主 | 2018-7-30 15:50 | 只看该作者
/*******************************************************************************
** 名称: void HMC830_open_write(uint32_t REG, uint8_t chanl)
** 描述: 向HMC830发送数据(OPEN MODE)
** 输入: PLL_REG: 寄存器值,chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 创建: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修定:
** 日期:
*******************************************************************************/
void HMC830_open_write(uint32_t REG, uint8_t chanl)
{
        uint8_t i;
        uint32_t  PLL_REG = 0x00000000;

        wdt_reset();

        HMC830LatchSet(chanl);
        delay_ms(10);

        PLL_REG = (REG & 0x1F000000) >> 21;  //取5bit地址
        PLL_REG |= (REG & 0x00FFFFFF) << 8;  //取24bit数据

        for (i = 0; i < 32; i++)                                //the slave (PLL with Integrated VCO) shifts in data on SDI on the first 24 rising edges of SCLK
        {
                clk_830_clr(chanl);                                //HMC830时钟
                if ((PLL_REG & 0x80000000) == 0)
                {
                        data_830_clr(chanl);                        //HMC830 数据
                }
                else
                {
                        data_830_set(chanl);
                }
                delay_us(5);                                        //SDI to SCLK setup time  > 3ns
                clk_830_set(chanl);
                delay_us(5);                                        //SCLK to SDI hold time  > 3ns
                PLL_REG <<= 1;
        }

        HMC830LatchClr(chanl);
        delay_ms(10);                                                //SEN low duration > 10ns, SCLK 32 Rising Edge to SEN Rising Edge  > 10ns
        HMC830LatchSet(chanl);                                        //h.Slave registers the SDI data on the rising edge of SEN.
        delay_ms(10);                                                //SEN high duration > 10ns
        HMC830LatchClr(chanl);
        delay_ms(20);                                                //Recovery Time > 20 ns
}

使用特权

评论回复
14
東南博士|  楼主 | 2018-7-30 15:51 | 只看该作者
/*******************************************************************************
** 名称: void HMC830_open_read(uint32_t REG, uint8_t chanl)
** 描述: 从HMC830读数据(OPEN MODE)
** 输入: PLL_REG: 寄存器值,chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 创建: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修定:
** 日期:
*******************************************************************************/
void HMC830_open_read(uint32_t REG, uint8_t chanl)
{
        uint8_t i;
        uint32_t  PLL_REG = 0x00000000;

#ifdef DEBUG
        uint8_t *p = (uint8_t *)(&PLL_REG); //调试
#endif

        wdt_reset();

        PLL_REG = (REG & 0x1F000000) >> 16; //取5bit地址
        HMC830LatchSet(chanl);
        delay_ms(10);

        // 1.first SPI cycle to write the desired address to Reg0h[7:3]**********************************************************************

        for (i = 0; i < 32; i++)                                        //b.the slave (PLL with Integrated VCO) shifts in data on SDI on the first 24 rising edges of SCLK
        {
                clk_830_clr(chanl);                                        //HMC830时钟
                if ((PLL_REG & 0x80000000) == 0)
                {
                        data_830_clr(chanl);                                //HMC830 数据
                }
                else
                {
                        data_830_set(chanl);
                }
                delay_us(5);                                                //SDI to SCLK setup time  > 3ns
                clk_830_set(chanl);
                delay_us(5);                                                //SCLK to SDI hold time  > 3ns
                PLL_REG <<= 1;
        }

        HMC830LatchClr(chanl);
        delay_ms(10);                                                        //SCLK 32 Rising Edge to SEN Rising Edge  > 10ns
        HMC830LatchSet(chanl);                                                //h.Slave registers the SDI data on the rising edge of SEN.
        delay_ms(10);                                                        //SEN high duration > 10ns
        HMC830LatchClr(chanl);                                                //i.Master clears SEN to complete the the address transfer of the two part READ cycle
        delay_ms(10);                                                        //Recovery Time > 10 ns

        // 2.next SPI cycle the desired data will be available on LD_SDO.*******************************************************************************

        HMC830LatchSet(chanl);                        //b. If a rising edge on SCLK is detected first Open mode is selected.
        delay_ms(10);                                //SEN high duration > 10ns
        clk_830_clr(chanl);                        //HMC830时钟
        data_830_clr(chanl);                        //HMC830数据
        delay_us(5);
        PLL_REG = 0x00000000;                        //读HMC830数据
        for (i = 0; i < 24; i++)                //m.Slave places the desired read data(ie. data from the address specified in  Reg 00h [7:3] of the first cycle) on LD_SDO
        {
                PLL_REG <<= 1;
                clk_830_set(chanl);
                delay_us(5);                        //SCLK Rising Edge to SDO time > 8.2ns+0.211ns/pF
                if (Read_LOCK_830_PLL0())
                {
                        PLL_REG |= 0x00000001;        //HMC830数据
                }
                else
                {
                        PLL_REG &= ~0x00000001;        //HMC830数据
                }
                clk_830_clr(chanl);                //HMC830时钟
                delay_us(5);
        }

        for (i = 0; i < 8; i++)                        //d.Slave shifts the register bits on the next 5 rising edges of SCLK (25-29)
        {
                //f.Slave shifts the chip address bits on the next 3 rising edges of SCLK (30-32)
                clk_830_clr(chanl);                //HMC830时钟
                data_830_clr(chanl);                //HMC830 数据
                delay_us(5);                        //SDI to SCLK setup time  > 3ns
                clk_830_set(chanl);
                delay_us(5);                        //SCLK to SDI hold time  > 3ns
        }

        HMC830LatchClr(chanl);
        delay_ms(10);                                //SCLK 32 Rising Edge to SEN Rising Edge  > 10ns
        HMC830LatchSet(chanl);                        //b. If a rising edge on SCLK is detected first Open mode is selected.
        delay_ms(10);                                //SEN high duration > 10ns

        if(REG == REG0_830)
        {
                if(PLL_REG == 0x000A7975)
                {
                        mode = 0xFE; //open_mode
                }
        }
        else
        {
                if(PLL_REG & 0x00000002)
                {
                        lock = 0x01;
                }
                else
                {
                        lock = 0x00;
                }
        }

#ifdef DEBUG
        SendStrData(p + 3, 1); //调试
        SendStrData(p + 2, 1); //调试
        SendStrData(p + 1, 1); //调试
        SendStrData(p, 1); //调试
#endif
}

使用特权

评论回复
15
東南博士|  楼主 | 2018-7-30 15:51 | 只看该作者
/*******************************************************************************
** 名称: void Mode_set(uint8_t chanl)
** 描述: HMC830SPI模式设置hmc_mode or open_mode
** 输入: chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 创建: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修定:
** 日期:
*******************************************************************************/
void Mode_set(uint8_t chanl)
{
#if HMCMODE > 0
        power_830_down();
        HMC830LatchClr(chanl);
        clk_830_clr(chanl);
        power_830_up();
        delay_ms(5);
        HMC830LatchSet(chanl); //a. If a rising edge on SEN is detected first HMC Mode is selected.
        delay_ms(5);
        clk_830_set(chanl);
#else
        power_830_down();
        clk_830_clr(chanl);
        HMC830LatchClr(chanl);
        power_830_up();
        delay_ms(5);
        clk_830_set(chanl); //b. If a rising edge on SCLK is detected first Open mode is selected.
        delay_ms(5);
        HMC830LatchSet(chanl);
#endif
}

使用特权

评论回复
16
東南博士|  楼主 | 2018-7-30 15:51 | 只看该作者
/*******************************************************************************
** 名称: void Mode_detection_close_loop(uint8_t chanl)
** 描述: SPI Mode的闭环判断,回读ChipID,正确的模式读数正确,以此确定SPI Mode通讯方式;带回读时,请读取12h寄存器的值来得到锁定指示
** 输入: chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 创建: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修定:
** 日期:
*******************************************************************************/
void Mode_detection_close_loop(uint8_t chanl)
{
        wdt_reset();

        Mode_set(chanl); //SPI模式设置
#if HMCMODE > 0
        HMC830_hmc_read(REG0_830, chanl);
        if(!mode)
        {
                HMC830_open_read(REG0_830, chanl);
        }
#else
        HMC830_open_read(REG0_830, chanl);
        if(!mode)
        {
                HMC830_hmc_read(REG0_830, chanl);
        }
#endif
}

使用特权

评论回复
17
東南博士|  楼主 | 2018-7-30 15:52 | 只看该作者
/*******************************************************************************
** 名称: void Mode_detection_open_loop(uint8_t chanl)
** 描述: SPI Mode的开环判断, 没有回读,没有上电控制的情况下,对SPI读写系统来说属于开环,需要软件工程师做开环控制避免掉电后在上电的SPI Mode的不确定性
** 输入: chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 作者: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修改人:
** 日 期:
**------------------------------------------------------------------------------
*******************************************************************************/
void Mode_detection_open_loop(uint8_t chanl)
{
        uint8_t ok_flag = 0x00;

        wdt_reset();

#if HMCMODE > 0
        HMC830_hmc_write(REGF0_830, chanl);
        if(Read_LOCK_830_PLL0()) //If (LD_SDO=0,  “ok1_flag”)
        {
                ok_flag &= 0xF0;
        }
        else
        {
                ok_flag |= 0x0F;
        }
        HMC830_hmc_write(REGF1_830, chanl);
        if(Read_LOCK_830_PLL0()) //If (LD_SDO=1,  “ok2_flag”)
        {
                ok_flag |= 0xE0;
        }
        else
        {
                ok_flag &= 0x0F;
        }
        if(ok_flag == 0xEF) //If (Ok1 & ok2 detected)
        {
                mode = 0xEF; //hmc_mode
        }
        else
        {
                HMC830_open_write(REGF0_830, chanl);
                if(Read_LOCK_830_PLL0()) //If (LD_SDO=0,  “ok1_flag”)
                {
                        ok_flag &= 0x0F;
                }
                else
                {
                        ok_flag |= 0xF0;
                }
                HMC830_open_write(REGF1_830, chanl);
                if(Read_LOCK_830_PLL0()) //If (LD_SDO=1,  “ok2_flag”)
                {
                        ok_flag |= 0x0E;
                }
                else
                {
                        ok_flag &= 0xF0;
                }
                if(ok_flag == 0xFE) //If (Ok1 & ok2 detected)
                {
                        mode = 0xFE; //open_mode
                }
        }
#else
        HMC830_open_write(REGF0_830, chanl);
        if(Read_LOCK_830_PLL0()) //If (LD_SDO=0,  “ok1_flag”)
        {
                ok_flag &= 0x0F;
        }
        else
        {
                ok_flag |= 0xF0;
        }
        HMC830_open_write(REGF1_830, chanl);
        if(Read_LOCK_830_PLL0()) //If (LD_SDO=1,  “ok2_flag”)
        {
                ok_flag |= 0x0E;
        }
        else
        {
                ok_flag &= 0xF0;
        }
        if(ok_flag == 0xFE) //If (Ok1 & ok2 detected)
        {
                mode = 0xFE; //open_mode
        }
        else
        {
                HMC830_hmc_write(REGF0_830, chanl);
                if(Read_LOCK_830_PLL0()) //If (LD_SDO=0,  “ok1_flag”)
                {
                        ok_flag &= 0xF0;
                }
                else
                {
                        ok_flag |= 0x0F;
                }
                HMC830_hmc_write(REGF1_830, chanl);
                if(Read_LOCK_830_PLL0()) //If (LD_SDO=1,  “ok2_flag”)
                {
                        ok_flag |= 0xE0;
                }
                else
                {
                        ok_flag &= 0x0F;
                }
                if(ok_flag == 0xEF) //If (Ok1 & ok2 detected)
                {
                        mode = 0xEF; //hmc_mode
                }
        }
#endif
}

使用特权

评论回复
18
東南博士|  楼主 | 2018-7-30 15:53 | 只看该作者
/*******************************************************************************
** 名称: void Mode_set(uint8_t chanl)
** 描述: HMC830频综频率设置
** 输入: chanl: 通道信息Chanl_U1,Chanl_U2,Chanl_U3,Chanl_U4
** 输出: 无
** 创建: klingy
** 日期: 2012.12.19
**------------------------------------------------------------------------------
** 修定:
** 日期:
*******************************************************************************/
void HMC830FreSet(uint8_t chanl)
{
        uint8_t i;
        uint8_t len = sizeof(init_dat) / 4;

        wdt_reset();

        if(mode == 0xEF)
        {
                for (i = 0; i < len; i++)
                {
                        HMC830_hmc_write(init_dat[i], chanl); //REG
                        delay_ms(10);
                }
        }
        else
        {
                for (i = 0; i < len; i++)
                {
                        HMC830_open_write(init_dat[i], chanl); //REG
                        delay_ms(10);
                }
        }
}

使用特权

评论回复
19
東南博士|  楼主 | 2018-7-30 15:53 | 只看该作者
寄存器配置有问题,可以试一下下面的寄存器。

REVISION Commented HMC830 Fractional Mode Register File
REG 0 20   
REG 1 2     
REG 2 1   
REG 5 1628  
REG 5 60A0   
REG 5 E090
REG 5 2818
REG 5 0     
REG 6 30F4A  
REG 7 14D     .
REG 8 C1BEFF
REG 9 5CBFFF
REG A 2046  
REG B 7C061
REG F 81   
REG 3 1F      
REG 4 555555

使用特权

评论回复
20
zhangxiaoxiao87| | 2019-4-18 18:06 | 只看该作者
谢谢楼主

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

367

主题

6048

帖子

34

粉丝