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

📄 main._c

📁 单片机中的ADC模块
💻 _C
字号:
//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 "adc.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();
  led_init(); //7段数码管显示
  

  MCUCR = 0x00;//IO
 
  adc_init();
 
 /*
 Set_Bit(PORTE,7);
 transmit_byte(0xaa);
 delay(10000);
 Clr_Bit(PORTE,7);
 */
 
 SEI(); //re-enable interrupts
 //all peripherals are now initialized

	 
for(;;)
  {  
   system_protect();
   display(adc0_value,0); //普通模式,显示countdata的值,countdata将在timer3定时一秒溢出时改变
 //display(adc1_value,1);  //补零模式,显示countdata的值,countdata将在timer3定时一秒溢出时改变
  }
 
}




⌨️ 快捷键说明

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