M16_AN_Compare程序及仿真.zip
        
        
           
           
                  时间:11-02 14:22
                  查看:1078次
                  下载:162次
           
           
                      
           
		          
                   简介:
本资料为AVR系列单片机竞赛设计实例程序22例PROTEUS仿真资料-M16_AN_Compare程序及仿真。
#include <iom16v.h>
#define uchar unsigned char
#define uint unsigned int
void main(void)
{
 uchar i;
 DDRB=0xf0;
 PORTB=0x00;
 ACSR=0x00;
 while(1)
 {
 if((ACSR&0x20)==0x20)
 PORTB=PORTB|0xf0;
 else
 PORTB=PORTB&0x0f;
 }
}