void timer1_init(void)
{
OCR1A=0Xff11; //0XC2F6;//3D09;//0X7A11;
TIMSK=0X10;
TCCR1B=0X0c; //64分频
}
用的是 T1 定时器
SIGNAL(SIG_OUTPUT_COMPARE1A)
{
cli();
if(Zijian == 1)
node_data++;
if(Zijian == 0)
node_data = readc_data(0xc7);
if(node_data > 100)
node_data = 100;
//adc_Guzdata = read_adc(0xc6);
nop;
sei();
}
数据通过串口传给上位机显示
|