View Single Post
  #1   Spotlight this post!  
Unread 02-02-2006, 10:50
et1337's Avatar
et1337 et1337 is offline
et1337
AKA: Evan Todd
FRC #1317 (Digital Fusion)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Columbus OH
Posts: 42
et1337 is a glorious beacon of lightet1337 is a glorious beacon of lightet1337 is a glorious beacon of lightet1337 is a glorious beacon of lightet1337 is a glorious beacon of light
Quick Timer Question

So we set up a timer to trigger an interrupt every time it overflows. However, I could not get OpenTimer1(), ReadTimer1(), etc. to work, so we had to manually set up the timer.

My question is, how do I get the timer to overflow faster? Right now it overflows 3 or 4 times per loop.

Timer setup code:

T1CONbits.T1CKPS0 = 1; // 1:8 Prescale (clock=1.25MHz/each tick=800ns)
T1CONbits.T1CKPS1 = 1;

T1CONbits.TMR1CS = 0; // = 0 Timer uses internal clock
TMR1H = 0x85; // Sets most significant byte
TMR1L = 0xED; // Sets least significant byte
T1CONbits.TMR1ON = 1; // Turns on Timer1
IPR1bits.TMR1IP = 0; // Sets Timer1 as low priority
PIE1bits.TMR1IE = 1; // Enables Timer1 overflow interrupt
INTCONbits.GIEL = 1; // Enables low priority interruptions
__________________
There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order.
et1337