keil软件_WDWORD _RDWORD函数说明

官方地址  https://www.keil.com/support/man/docs/uv4cl/uv4cl__wdword.htm

百度文库示例  https://wenku.baidu.com/view/5e5b7f255901020207409ca5.html

https://blog.csdn.net/renweibin888/article/details/38778669

unsigned long _RDWORD ( unsigned long address); /* address to read */

 作用描述 :
_RDWORD调试器函数从
指定地址读取一个无符号长整数值。




_WDWORD( unsigned
long address , /* 要写入的地址 */
unsigned long value);/* 要写入的值 */

 作用描述 :
_WDWORD调试器函数将一个无符号长整数值写入指定地址。

 

 

_WDWORD(   ,   )是keil软件中自带的一个指令,他的用法是,把某个地址处写如相应的值,相当于把某个地址的寄存器初始化。

 

 

我们任举一例,_WDWORD(0x53000000, 0x00000000);  这个是从所有2410的工程中用到的sdram.ini中copy的一句话,我们查看2410的手册发现,0x53000000这个地址就是看门狗的控制寄存器,写入0x00000000就是关闭看门狗。想必现在大家都懂了吧。下面是sdram.ini这个文件的_word()指令简单注释。希望对大家有帮助。

 

/******************************************************************************/
/* SDRAM.INI: External RAM (SDRAM) Initialization File                      */
/******************************************************************************/
// <<< Use Configuration Wizard in Context Menu >>>                           //
/******************************************************************************/
/* This file is part of the uVision/ARM development tools.                    */
/* Copyright (c) 2005-2006 Keil Software. All rights reserved.                */
/* This software may only be used under the terms of a valid, current,        */
/* end user licence from KEIL for a compatible version of KEIL software       */
/* development tools. Nothing else gives you the right to use this software.  */
/******************************************************************************/


FUNC void Setup (void) {

  _WDWORD(0x53000000, 0x00000000);  //关闭看门狗   

  _WDWORD(0x4A000008, 0xFFFFFFFF);   // 关闭相应中断  
  _WDWORD(0x4A00001C, 0x000007FF);         // 关闭相应中断
      
  _WDWORD(0x4C000014, 0x00000003);
  _WDWORD(0x4C000004, 0x0005c042);          // 时钟分频
  
  _WDWORD(0x56000070, 0x00280000);           //
  _WDWORD(0x56000078, 0x00000000);
  
  _WDWORD(0x48000000, 0x22111110);            //SARAM 初始化
  _WDWORD(0x48000004, 0x00000700);  
  _WDWORD(0x48000008, 0x00000700);
  _WDWORD(0x4800000C, 0x00000700);
  _WDWORD(0x48000010, 0x00000700);
  _WDWORD(0x48000014, 0x00000700);
  _WDWORD(0x48000018, 0x00000700);
  _WDWORD(0x4800001c, 0x00018005);
  _WDWORD(0x48000020, 0x00000700);
  _WDWORD(0x48000024, 0x008e0459);
  _WDWORD(0x48000028, 0x000000B2);
  _WDWORD(0x4800002c, 0x00000030);
  _WDWORD(0x48000030, 0x00000030);
  
  _WDWORD(0x56000014, 0x00000001);
  
  _WDWORD(0x56000020, 0xAAAA55AA);          //lcd管脚初始化
  _WDWORD(0x56000028, 0x0000FFFF);
  _WDWORD(0x56000024, 0x00000000);

}

Setup();                                                // Setup for Init

LOAD SDRAM\StepMotor_Test.axf INCREMENTAL            // Download
                                                                                 
PC = 0x30000000;                                                                // <o> Program Entry Point

g, main                                                                                         // Run to main function

 

posted @ 2022-06-15 16:07  流水江湖  阅读(586)  评论(0编辑  收藏  举报