View Single Post
  #11   Spotlight this post!  
Unread 18-11-2003, 16:20
WizardOfAz's Avatar
WizardOfAz WizardOfAz is offline
Lead Mentor
AKA: Bill Bennett
FRC #1011 (CRUSH)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Tucson, AZ
Posts: 101
WizardOfAz will become famous soon enough
Send a message via AIM to WizardOfAz
using the 18F8520 timers

I suppose it's possible that the way I set the timer up caused the problem even though the timer may not have been in use. Perhaps it started generating interrupts for which there was no code to handle. Or something.

Here's what I tried. It was just an experiment to try to learn how to use the timers.

unsigned int t1, t2;
OpenTimer1(TIMER_INT_OFF&T1_16BIT_RW&T1_SOURCE_INT &T1_PS_1_8);

while (1) /* this is the main loop in main.c */
{
t1 = ReadTimer1();
if(t1&0xf000 != t2) {
t2 = t1&0xf000;
printf("timer1: %u\n", t1);
}
.....
}

This ran OK in the simulator, and ran OK in the EDU-RC when I first loaded it, but after that, I could no longer put the EDU-RC in program download mode. See earlier post.

Anybody tried and succeeded in using the timers and want to give advice?