#include <iot26v.h> #include <macros.h> #define uchar unsigned char #define uint unsigned int #define RED_LED_ON PORTA &= ~(1<<PA7) #define RED_LED_OFF PORTA |= (1<<PA7) #pragma interrupt_handler adc_isr:11 void adc_isr(void) { RED_LED_ON; }
void AD_init(void) { ADCSR = 0x00; ADCMUX = 0x20; ACSR = 0x80; ADCSR = 0xAe; //连续转换,64分频,ad中断使能 } void main() { DDRA = 0xE0;/* 定义PORTA口输入且不带上拉,,PA7,PA6,PA5输出*/ PORTA = 0xE0; SREG &= ~(1<<7) ; //关总中断 MCUCR = 0x00; TIMSK = 0x00; GIMSK = 0x00; RED_LED_OFF; AD_init(); ADCSR|=(1<<ADSC); //连续模式,开始AD转换 SREG |= (1<<7) ; while (1) { ; } } 内部4M时钟..ATtiny26芯片 PA0 信号采集 为什么进不了中断程序 (主程序里面测试指示灯控制正常,是不是说熔丝配置正常了)
请帮忙了.都两天了.还是没有弄出来.... |