TMS320C5509的WDT的例程源码

TMS320C5509的WDT的例程源码

/*
* Copyright 2003 by Texas Instruments Incorporated.
* All rights reserved. Property of Texas Instruments Incorporated.
* Restricted rights to use, duplicate or disclose this code are
* granted through contract.
*
*/
/* "@(#) DSP/BIOS 4.90.150 04-08-03 (barracuda-m02)" */
/******************************************************************************/
*      Copyright (C) 2000 Texas Instruments Incorporated.
*              All Rights Reserved
*------------------------------------------------------------------------------
* MODULE NAME... WDTIM
* FILENAME...... wdt.c
* DATE CREATED.. Tu 11/03/2000
* PROJECT....... Chip Support Library
* COMPONENT.....
* PREREQUISITS..
*------------------------------------------------------------------------------
* HISTORY:
*  11/03/2000 (IM) Created
*
*------------------------------------------------------------------------------
* DESCRIPTION:
*  
* This is an example of the usage of WDTIM functions for 5509.
/*----------------------------------------------------------------------*/
#include <csl.h>
#include <csl_wdtim.h>
#include <stdio.h>

int i, pscVal;
WDTIM_Config getConfig;
WDTIM_Config myConfig = {
   0x1000,     /* WDPRD */
   0x0000,     /* WDTCR */
   0x1000      /* WDTCR2 */
};


main()
{

  CSL_init();

#if (_WDTIM_SUPPORT)


  WDTIM_config(&myConfig);
  
  WDTIM_FSET(WDTCR, WDOUT, 1);      /* Connect to NMI */
  WDTIM_FSET(WDTCR, TDDR, 0xF);     /* Value to load PSC field */  
  WDTIM_FSET(WDTCR2, PREMD, 0);     /* Set direct mode */


    WDTIM_service();   /* enable watchdog */
     
  //for (i = 0; i < 100; i++)
    for (;;)
  {           
   
    WDTIM_getConfig(&getConfig);
    pscVal = WDTIM_FGET(WDTCR,PSC);

     printf("pscVal: %x, wdtcr: %x/n",
        pscVal, getConfig.wdtcr);  

   
    /* write periodically to WDTIMER - when this line is commented out,
      the watchdog times out, WDFLAG set to 1, indicating
      that a Watchdog time-out occurred.*/
    WDTIM_service();     
  
  }      //end for loop
#endif
}



/******************************************************************************/
* End of wdt.c
/******************************************************************************/

 

TMS320C5509的WDT的例程源码

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值