查看: 3530|回复: 3

[其他] 关于hz128锁相环设置问题

[复制链接]

该用户从未签到

2

主题

14

帖子

0

新手上路

Rank: 1

积分
15
最后登录
1970-1-1
发表于 2011-4-12 16:48:01 | 显示全部楼层 |阅读模式
各位大侠:
我在使用mc9shz128 的锁相环 功能,将外部8mhz晶振倍频到50mhz,对相关寄存器做如下设置:
 
void CPU_init(void)
{
    asm("nop");                   //nop instruction
 
    INITRM=0x39;                  //Internal RAM Position Register  ram location 0x2800-0x3fff
                                  //RAM15=0,RAM14=0,RAM13=1,RAM12=1,RAM11=1,??=0,??=0,RAMHAL=1
    INITEE=0x01;                  //Internal EEPROM Position Register EEON=1 ;ENABLE E2PROM
                                  //EE15=0,EE14=0,EE13=0,EE12=0,??=0,??=0,??=0,EEON=1
                                 
    MISC=0x0D;                    //Miscellaneous System Control Register
                                  //??=0,??=0,??=0,??=0,EXSTR1=1,EXSTR0=1,ROMHM=0,ROMON=1
    CRGINT=0X00;                              
                                 
    EBICTL=0x00;                  //External Bus Interface Control Register
                                  //??=0,??=0,??=0,??=0,??=0,??=0,??=0,ESTR=0
                                 
    PEAR=0x10;                    //Port E Assignment Register  NORMAL siggle chip mode
   
   
                                  //NOACCE=0,??=0,PIPOE=0,NECLK=1,LSTRE=0,RDWE=0,??=0,??=0
    CLKSEL=0x00;                  //CRG Clock Select Register
   
   
                                  //PLLSEL=0,PSTP=0,SYSWAI=0,ROAWAI=0,PLLWAI=0,CWAI=0,RTIWAI=0,COPWAI=0
   // PLLCTL=0x00;                //CRG PLL Control Register
                                  //PLLON=0
    PLLCTL_CME=0; 
    PLLCTL_SCME=0;                          
                                 
    SYNR=0x18;                    //CRG Synthesizer Register
                                  //??=0,??=0,SYN5=0,SYN4=1,SYN3=1,SYN2=0,SYN1=0,SYN0=0
    REFDV=0x07;                   //CRG Reference Divider Register
                                  //??=0,??=0,??=0,??=0,REFDV3=0,REFDV2=1,REFDV1=1,REFDV0=1
    PLLCTL_PLLON=1 ;
    PLLCTL_AUTO=1 ;                         
    asm("nop")
    asm("nop")
                                                
    while(CRGFLG_LOCK==0){asm("nop");} //时钟是否稳定  
  
    CLKSEL=0x80;                  //CRG Clock Select Register
                                  //PLLSEL=1
                                 
    INTCR_IRQEN=0;                              
                                                             
}
仿真 结果 CRGFLG_LOCK一直都没置1,是不是哪个寄存器设置有问题,烦请指点,不胜感激。
 
我知道答案 目前已有2人回答
回复

使用道具 举报

  • TA的每日心情
    难过
    2021-12-15 16:01
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]初来乍到

    305

    主题

    4701

    帖子

    0

    中级会员

    Rank: 3Rank: 3

    积分
    377
    最后登录
    2023-8-16
    发表于 2011-4-12 22:48:53 | 显示全部楼层

    RE:关于hz128锁相环设置问题

    你仿真的时候,看一下命令窗口提示的是什么,你可以给我看一下吗?
    该会员没有填写今日想说内容.

    该用户从未签到

    2

    主题

    14

    帖子

    0

    新手上路

    Rank: 1

    积分
    15
    最后登录
    1970-1-1
     楼主| 发表于 2011-4-13 11:11:41 | 显示全部楼层

    这是我仿真中command的提示

    版主你好这是我仿真时:command 的提示:
    executing C_layout.hwl
    !OPEN source 0 0 60 39
    NO CONNECTION
    !Source < attributes MARKS off
    !OPEN assembly 60 0 40 31
    !Assembly < attributes ADR on,CODE off,ABSADR on,SYMB off,TOPPC 0xF88C
    !OPEN procedure 0 39 60 17
    !Procedure < attributes VALUES on,TYPES off
    !OPEN register 60 31 40 25
    !Register < attributes FORMAT AUTO,COMPLEMENT None
    !OPEN memory 60 56 40 22
    !Memory < attributes FORMAT hex,COMPLEMENT None,WORD 1,ASC on,ADR on,ADDRESS 0x80
    !OPEN data 0 56 60 22
    !Data:1 < attributes SCOPE global,COMPLEMENT None,FORMAT Symb,MODE automatic,UPDATERATE 10,NAMEWIDTH 16
    !OPEN data 0 78 60 22
    !Data:2 < attributes SCOPE local,COMPLEMENT None,FORMAT Symb,MODE automatic,UPDATERATE 10,NAMEWIDTH 16
    !OPEN command 60 78 40 22
    !Command < attributes CACHESIZE 1000
    !bckcolor 50331647
    !font 'Courier New' 9 BLACK
    !AUTOSIZE on
    !ACTIVATE Data:2 Command Procedure Data:1 Source Register Assembly Memory
    done C_layout.hwl
    Loading Target ...
    SETCOMM DRIVER NOPROTOCOL NOPERIODICAL ""
    SETCOMM COMPORT NONE
    P&E driver version: 68HC12 Interface Libraries Version 2.66.00.00 (http://www.pemicro.com)
    P&E cable firmware version: 5.75
    IO registers loaded for MC9S12HZ128 from C:\Program Files\Freescale\CodeWarrior for HCS12 V4.7\prog\REG\MCU02C3.REG
    executing .\cmd\P&E_Multilink_CyclonePro_startup.cmd
    !// At startup the commands written below will be executed
    Target Ready
    !
    done .\cmd\P&E_Multilink_CyclonePro_startup.cmd
    Startup command file correctly executed.
    executing .\cmd\P&E_Multilink_CyclonePro_preload.cmd
    !// Before load the commands written below will be executed
    Target Ready
    done .\cmd\P&E_Multilink_CyclonePro_preload.cmd
    Preload command file correctly executed.
    FP: FLASH parameters loaded for MC9S12HZ128_V12(NVMIF2 rev 2,3,3,3,2) from C:\Program Files\Freescale\CodeWarrior for HCS12 V4.7\prog\FPP\mcu02C3.fpp
    executing .\cmd\P&E_Multilink_CyclonePro_reset.cmd
    !// After reset the commands written below will be executed
    done .\cmd\P&E_Multilink_CyclonePro_reset.cmd
    Reset command file correctly executed.
    FP: FLASH parameters loaded for MC9S12HZ128_V12(NVMIF2 rev 2,3,3,3,2) from C:\Program Files\Freescale\CodeWarrior for HCS12 V4.7\prog\FPP\mcu02C3.fpp
          MCU clock speed: 1400000 Hz
    Block Module Name      Address Range   Status
       0  EEPROM             400 -   7FF   Blank - Unselected
       1  FLASH_4000        4000 -  7FFF   Blank - Unselected
       2  FLASH_C000        C000 -  FFFF   Programmed - Unselected
       3  ALL_PPAGES      388000 -3FBFFF   Programmed - Unselected
       4  FLAT8000_P38      8000 -  BFFF   Programmed - Unselected
    FP: The UNPROTECT command is not available for the EEPROM flash module => Skipped.
    FP: The UNPROTECT command is not available for the FLASH_4000 flash module => Skipped.
    FP: The UNPROTECT command is not available for the FLASH_C000 flash module => Skipped.
    FP: The UNPROTECT command is not available for the ALL_PPAGES flash module => Skipped.
    FP: The UNPROTECT command is not available for the FLAT8000_P38 flash module => Skipped.
    executing .\cmd\P&E_Multilink_CyclonePro_vppon.cmd
    !// Before programming the flash, the commands written below will be executed
    done .\cmd\P&E_Multilink_CyclonePro_vppon.cmd
    Vppon command file correctly executed.
    executing .\cmd\P&E_Multilink_CyclonePro_vppoff.cmd
    !// After programming the flash, the commands written below will be executed
    done .\cmd\P&E_Multilink_CyclonePro_vppoff.cmd
    Vppoff command file correctly executed.
    FP: Arm FLASH for loading.
    executing .\cmd\P&E_Multilink_CyclonePro_vppon.cmd
    !// Before programming the flash, the commands written below will be executed
    done .\cmd\P&E_Multilink_CyclonePro_vppon.cmd
    Vppon command file correctly executed.
    executing .\cmd\P&E_Multilink_CyclonePro_vppoff.cmd
    !// After programming the flash, the commands written below will be executed
    done .\cmd\P&E_Multilink_CyclonePro_vppoff.cmd
    Vppoff command file correctly executed.
    FP: FLASH disarmed.
    executing .\cmd\P&E_Multilink_CyclonePro_reset.cmd
    !// After reset the commands written below will be executed
    done .\cmd\P&E_Multilink_CyclonePro_reset.cmd
    Reset command file correctly executed.
    executing .\cmd\P&E_Multilink_CyclonePro_postload.cmd
    !// After load the commands written below will be executed
    RESET
    done .\cmd\P&E_Multilink_CyclonePro_postload.cmd
    Postload command file correctly executed.
    main 0x388000 T
    STARTED
    RUNNING
    Breakpoint
    STARTED
    RUNNING
    STOPPING
    HALTED
    STARTED
    RUNNING
    STOPPING
    HALTED
    STARTED
    RUNNING
    STOPPING
    HALTED
    in>
     
    程序文件视图.GIF
    数据窗口视图.GIF
  • TA的每日心情
    难过
    2021-12-15 16:01
  • 签到天数: 1 天

    连续签到: 1 天

    [LV.1]初来乍到

    305

    主题

    4701

    帖子

    0

    中级会员

    Rank: 3Rank: 3

    积分
    377
    最后登录
    2023-8-16
    发表于 2011-4-13 16:21:48 | 显示全部楼层

    RE:关于hz128锁相环设置问题

    如果不能走下去说明你的配置有问题。把下面2句放在CLKSEL=0x00; 前面试试。
    SYNR=0x18;
    REFDV=0x07;
    该会员没有填写今日想说内容.
    您需要登录后才可以回帖 注册/登录

    本版积分规则

    关闭

    站长推荐上一条 /3 下一条

    Archiver|手机版|小黑屋|恩智浦技术社区

    GMT+8, 2025-7-24 00:47 , Processed in 0.096547 second(s), 27 queries , MemCache On.

    Powered by Discuz! X3.4

    Copyright © 2001-2024, Tencent Cloud.

    快速回复 返回顶部 返回列表