找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 2987|回复: 0
收起左侧

Freescale 68HC12单片机ADC程序

[复制链接]
ID:194290 发表于 2017-4-27 18:25 | 显示全部楼层 |阅读模式
很重要的Freescale 68HC12单片机adc程序
0.png

  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)




回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表