View Single Post
  #32   Spotlight this post!  
Unread 12-03-2004, 22:21
Mark McLeod's Avatar
Mark McLeod Mark McLeod is online now
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,868
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: quick question: TIMERS

Quote:
Originally Posted by Astronouth7303
I just relized something. In the initialize routines for the timers, the first 2 lines are address setters (I think). Most of mine are 0x00! Does this make a difference?
No. Those just mean the timer starts at 0.

Believe I found the problem.
TICKS is declared as char (-127 to 127)
You are checking for 255 as an overflow.
TIME will never increment.


I grabbed Kevins interrupt code and added your code to the interrupt handler.
Only difference is I just declared your globals as static just within interrupts.c for my ease of duplicating your results.

TICKS and AUTOCLOCK increment as you wanted.

In Initialize_Timer_1 I changed:
Code:
PIE1bits.TMR1IE = 1;
T1CONbits.TMR1ON = 1;
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle