main._c

来自「单片机中的定时器模块」· _C 代码 · 共 45 行

_C
45
字号
//ICC-AVR application builder : 2007-8-13 15:05:41
// Target : M128
// Crystal: 7.3728Mhz

#include <iom128v.h>
#include <macros.h>
#include "port.h"
#include "timer.h"



/*call this routine to initialize all peripherals */
void main(void)
{ 
  UNS8 i;
 //stop errant interrupts until set up
  CLI(); //disable all interrupts
  
  port_init();
  timer1_init();
  
  MCUCR = 0x00;//IO
 
 /*
 Set_Bit(PORTE,7);
 transmit_byte(0xaa);
 delay(10000);
 Clr_Bit(PORTE,7);
 */
 
 SEI(); //re-enable interrupts
 //all peripherals are now initialized

	 
for(;;)
  {  
  pwm_pulse(2*200);
  }
 
}




⌨️ 快捷键说明

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