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

📄 counter.c

📁 飞思卡尔单片机MC9SDG128B的计数器源程序
💻 C
字号:
/** ###################################################################
**     Filename  : Counter.C
**     Project   : Counter
**     Processor : MC9S12DG128BCFU
**     Version   : Driver 01.11
**     Compiler  : Metrowerks HC12 C Compiler
**     Date/Time : 2008-3-4, 上午 08:22
**     Abstract  :
**         Main module.
**         Here is to be placed user's code.
**     Settings  :
**     Contents  :
**         No public methods
**
**     (c) Copyright UNIS, spol. s r.o. 1997-2005
**     UNIS, spol. s r.o.
**     Jundrovska 33
**     624 00 Brno
**     Czech Republic
**     http      : www.processorexpert.com
**     mail      : info@processorexpert.com
** ###################################################################*/
/* MODULE Counter */

/* Including used modules for compiling procedure */
#include "Cpu.h"
#include "Events.h"
#include "TI1.h"
/* Include shared modules, which are used for whole project */
#include "PE_Types.h"
#include "PE_Error.h"
#include "PE_Const.h"
#include "IO_Map.h"

void set_tc(void){
 TCTL4=0XAA;
 PACTL=0x40;
 }
void main(void)
{ // byte a ;
  //byte Valu;
  /*** Processor Expert internal initialization. DON'T REMOVE THIS CODE!!! ***/
  PE_low_level_init();
  /*** End of Processor Expert internal initialization.                    ***/
  
    DDRAB=0XFF;
    set_tc();
 // a=Cap1_Enable();
  
  /* Write your code here */
  
  for(;;){
  
  //a=Cap1_GetCaptureValue(&Valu);
   //PORTB=PACN1;
   //Cap1_Reset();    
  
 //  if(PTM_PTM0==1)
      
   //  a=Cap1_Disable();
  // a=EC81_GetNumEvents(&Valu);
   //EC161_GetNumEvents(&Valu) ;
  // PORTB=PACN3;
  } 
  /*** Processor Expert end of main routine. DON'T MODIFY THIS CODE!!! ***/
  for(;;){}
  /*** Processor Expert end of main routine. DON'T WRITE CODE BELOW!!! ***/
} /*** End of main routine. DO NOT MODIFY THIS TEXT!!! ***/

/* END Counter */
/*
** ###################################################################
**
**     This file was created by UNIS Processor Expert 2.96 [03.76]
**     for the Freescale HCS12 series of microcontrollers.
**
** ###################################################################
*/

⌨️ 快捷键说明

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