标题: Freescale 68HC12单片机ADC程序 [打印本页]

作者: 天可以很蓝    时间: 2017-4-27 18:25
标题: Freescale 68HC12单片机ADC程序
很重要的Freescale 68HC12单片机adc程序


  1. #include <hidef.h>      /* common defines and macros */
  2. #include "derivative.h"      /* derivative-specific definitions */
  3. #include "ADC.h"


  4. void main(void) {
  5.   /* put your own code here */
  6.   byte AD_Value;
  7.   DDRA = 0xFF;
  8.   PORTA = 0xFF;
  9.   
  10.   AD_Init();


  11.         EnableInterrupts;


  12.   for(;;) {
  13.     //if(ATD0STAT0 && 0x80 != 0)
  14.     //{
  15.         //AD_Value = ATD0DR0L;
  16.        // PORTA = AD_Value;
  17.     //}
  18.    
  19.     _FEED_COP(); /* feeds the dog */
  20.   } /* loop forever */
  21.   /* please make sure that you never leave main */
  22. }
复制代码


下载:
ADC.rar (195.98 KB, 下载次数: 7)









欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1