Do you have a question? Post it now! No Registration Necessary
- Posted on
- Configuration Timer Microchip
May 9, 2016, 3:10 pm
rate this thread
j'ai une question concernant la configuration d'un timer sur un PIC24F.
/* The following code example will enable Timer1 interrupts, load the
Period register and start Timer1.
When a Timer1 period match interrupt occurs, the interrupt service
routine must clear the Timer1 interrupt status flag in software.
T1CON = 0x00; //Stops the Timer1 and reset control reg.
TMR1 = 0x00; //Clear contents of the timer register
PR1 = 0xFFFF; //Load the Period register with the value 0xFFFF
IPC0bits.T1IP = 0x01; //Setup Timer1 interrupt for desired priority level
// (This example assigns level 1 priority)
IFS0bits.T1IF = 0; //Clear the Timer1 interrupt status flag
IEC0bits.T1IE = 1; //Enable Timer1 interrupts
T1CONbits.TON = 1; //Start Timer1 with prescaler settings at 1:1 and
//clock source set to the internal instruction cycle
Je vous remercie par avance !
- » Free trial account for Android tv Box ,why there is someboby think its a scam
- — The site's Newest Thread. Posted in » Electronics Design
- » I thought that it was only the HiFi world that was into this sort of juju
- — The site's Last Updated Thread. Posted in » Electronics Down Under