⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 target.h

📁 PWM Generation Using HCS12 Timer Channels
💻 H
字号:
/******************************************************************************
*                                             COPYRIGHT (c) MOTOROLA 2000   
* FILE NAME: target.h     REVISION 1.1                                        
*                                                                           
* PURPOSE: header file for EVB program  							 
*                                                                           
*******************************************************************************
*******************************************************************************  
**  THIS CODE IS ONLY INTENDED AS AN EXAMPLE FOR THE METROWERKS COMPILER AND **  
**      THE STAR12 EVB AND HAS ONLY BEEN GIVEN A MIMIMUM LEVEL OF TEST.      **  
**  IT IS PROVIDED 'AS SEEN' WITH NO GUARANTEES AND NO PROMISE OF SUPPORT.   **  
*******************************************************************************  
*******************************************************************************
*                                                                           
*                                                                           
* DESCRIPTION:  definitions for target specifics such as clock speed        
*                                                                           
* NOTE: Modify this file depending on the crystal frequency of the target   
*                                                                           
* AUTHOR: Martyn Gallop        LOCATION: EKB      LAST EDIT DATE: 30.07.01  
*                                                                           
* UPDATE HISTORY                                                            
* REV      	AUTHOR      DATE       	DESCRIPTION OF CHANGE                    
* ---      	------      ---------   ---------------------                    
* 1.0      	M.Gallop    03/06/01	                                         
* 1.1		M.Gallop    30/07/01    - Added KHz version of XTAL_FREQ
*									- Reformated file info section
* 1.2		M.Gallop	09/10/01	- added equations from xtal.h           
*                                                                           
******************************************************************************/

/*===========================================================================*/
/* Motorola reserves the right to make changes without further notice to any */
/* product herein to improve reliability, function, or design. Motorola does */
/* not assume any  liability arising  out  of the  application or use of any */
/* product,  circuit, or software described herein;  neither  does it convey */
/* any license under its patent rights  nor the  rights of others.  Motorola */
/* products are not designed, intended,  or authorized for use as components */
/* in  systems  intended  for  surgical  implant  into  the  body, or  other */
/* applications intended to support life, or  for any  other application  in */
/* which the failure of the Motorola product  could create a situation where */
/* personal injury or death may occur. Should Buyer purchase or use Motorola */
/* products for any such intended  or unauthorized  application, Buyer shall */
/* indemnify and  hold  Motorola  and its officers, employees, subsidiaries, */
/* affiliates,  and distributors harmless against all claims costs, damages, */
/* and expenses, and reasonable  attorney  fees arising  out of, directly or */
/* indirectly,  any claim of personal injury  or death  associated with such */
/* unintended or unauthorized use, even if such claim alleges that  Motorola */
/* was negligent regarding the  design  or manufacture of the part. Motorola */
/* and the Motorola logo* are registered trademarks of Motorola Ltd.         */
/*****************************************************************************/


#define XTAL_FREQ		16.0 	/* MHz */
#define XTAL_FREQ_KHZ	16000.0	/* KHz */

#define XTAL_BUS_FREQ_KHZ     XTAL_FREQ_KHZ / 2.0

#define XTAL_CPU_PERIOD_US   1000.0 / XTAL_BUS_FREQ  /* in microseconds */

#define XTAL_TIMER_PRESCALER_BITS    0  /* value 0-7; prescaler = 2^^n */

#define XTAL_MS_COUNT	(tU16)(XTAL_BUS_FREQ_KHZ / (1 << XTAL_TIMER_PRESCALER_BITS))

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -