View Single Post
  #5   Spotlight this post!  
Unread 21-01-2006, 13:57
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: Combining ADC, Serial, and Camera_s codes

Quote:
Originally Posted by Kevin Watson
A few things are wrong. The ADC code for the 2006 controller also uses timer 2, but I don't see its ISR. If timer 2 fires off and there isn't any way to clear the interrupt flag, you'll get the red-light-of-death. The attached file should work.
This file mostly worked for us. We had to add in an include for encoder.h and the Port_B and Port_B_Delta variables.

Now, encoders 3 through 6 work fine (indeed, I can run all four of them, each generating 1600 pulses/sec, and it keeps up) in tandem with the gyro and camera. But if try to use encoder 1, I get the red-light-o-death as soon as something triggers it. And if I try to enable encoder 2, it doesn't build:

C:\FIRST 2006\FRC 21 Jan 2006\encoder.c:131:Error [1205] unknown member 'INT3IP' in '__tag_223'
C:\FIRST 2006\FRC 21 Jan 2006\encoder.c:131:Error [1131] type mismatch in assignment

I noticed this thread, but I've confirmed that my p18f8722.h (in c:\mcc18\h) file is the exact one from the installation CD, and there are no others on the system. Are there two versions of this .h floating around?

In any case, I've put the code online (with team-strategy specific stuff removed, but this version shows the problem) at this link. I can probably run with just encoders 3-6, but wanted to run speed control on 1 and 2.

Any ideas?