void init_timer0()
{
counter0 = 0;//counter for virtual timer
timer0_flag = 0;//flag for virtual timer
T0CON = 0x00;//timer0 16bit mode, internal
clock, Prescaller 1:2
RCONbits.IPEN = 1;//enable interrupt priority
INTCON2bits.TMR0IP = 0;//low interrupt priority
INTCONbits.GIE = 1;//enable global interrupt
INTCONbits.GIEL =1;//enable low priority interrupt
INTCONbits.TMR0IE = 1;//enable timer0 interrupt
INTCONbits.TMR0IF = 1;//force timer0 interrupt
}
các bác cho em hỏi mấy cái tô màu đỏ lấy ở đâu ra vậy em lập trình bằng mpalp c18
{
counter0 = 0;//counter for virtual timer
timer0_flag = 0;//flag for virtual timer
T0CON = 0x00;//timer0 16bit mode, internal
clock, Prescaller 1:2
RCONbits.IPEN = 1;//enable interrupt priority
INTCON2bits.TMR0IP = 0;//low interrupt priority
INTCONbits.GIE = 1;//enable global interrupt
INTCONbits.GIEL =1;//enable low priority interrupt
INTCONbits.TMR0IE = 1;//enable timer0 interrupt
INTCONbits.TMR0IF = 1;//force timer0 interrupt
}
các bác cho em hỏi mấy cái tô màu đỏ lấy ở đâu ra vậy em lập trình bằng mpalp c18
Comment