定时器TA中断服务程序产生正弦波 #pragma vector=TIMERA0_VECTOR __interrupt void TA_ISR (void) { if(WaveSelect==5)//Sine {Count_line++; if(Count_lineSin_line) {TACCR1=sin[M]; M+=Delt_M; if(M=1024) M=M-1024; Count_line=0; } } * if(WaveSelect==10)//Triangle { Count_line++; if(Count_line3) { if((Count=1405)(Rise==1))//三角波上升 { Count+=f_out; if(Count1405) { Count=2810-Count; Rise=0; TACCR1=Count; Count_line=0; return; } } * 定时器TA中断服务程序产生三角波 if(Rise==0)//三角波下降 { if(Count=f_out)Count-=f_out; else { Count=f_out-Count;
原创力文档

文档评论(0)