Thread: Using Timers
View Single Post
  #8   Spotlight this post!  
Unread 30-01-2006, 07:09
tribotec_ca88's Avatar
tribotec_ca88 tribotec_ca88 is offline
FIRST-a-holic
AKA: Camila Fitzgibbon
FRC #1382 (Tribotec Team)
Team Role: Student
 
Join Date: Jan 2004
Rookie Year: 2004
Location: São José dos Campos, Brazil
Posts: 194
tribotec_ca88 is just really nicetribotec_ca88 is just really nicetribotec_ca88 is just really nicetribotec_ca88 is just really nicetribotec_ca88 is just really nice
Send a message via ICQ to tribotec_ca88 Send a message via MSN to tribotec_ca88 Send a message via Yahoo to tribotec_ca88
Re: Using Timers

I've included timers.h in all c files i'm using timers in...and this is what i ended up writing to initialize Timer1:

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

T1CONbits.TMR1CS = 0; // Internal clock
TMR1H = 0x85; // Timer1's most significant byte
TMRIL = 0xED; // Timer1's least significant byte
T1CONbits.TMR1ON = 1; // Timer1 set as on
IPR1bits.TMR1IP = 0; // Sets interrupt as low priority
PIR1bits.TMR1IF = 0; // Overflow flag
PIE1bits.TMR1IE = 1; // Timer1 interrupt
INTCONbits.GIEL = 1; // Low priority interrupts OK


but for some reason i still get a few errors related to the TMR1H and TMR1L variables stating:

C:\NossoCodigo\Code_26Jan\user_routines.c:168:Erro r [1105] symbol 'TMRIL' has not been defined
C:\NossoCodigo\Code_26Jan\user_routines.c:168:Erro r [1101] lvalue required

I understand they haven't been defined but where exactly would I define them (and as what?!) ?

thanks, any help at all would be greatly appreciated!!
__________________
1382 Tribotec Team - Brazil
-----------------------------------------------
2005 NJ Regional GM Industrial Design Award
2005 NJ Regional Website Excellence Award
2004 NJ Regional Semifinalists
-----------------------------------------------