Go to Post We do not pursue awards, we pursue greatness and the awards follow. - Sunshine [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-02-2008, 20:15
antiNeo antiNeo is offline
Registered User
FRC #1569
 
Join Date: Jan 2008
Location: Pocatell, Idaho
Posts: 17
antiNeo has a spectacular aura aboutantiNeo has a spectacular aura about
ADC not initializing

I'm using the latest 2008 ifi_frc_sensor code from kevin.org. I'm trying to get ADC initialized so that I can use the gyroscope, but when I try to call Initialize_ADC() inside of the Initialization() function and upload the code to the robot, the robot's Program State light continues blinking as though it's still downloading the code but it has already completed. I tried to do a bit of debugging with the Initialize_ADC() function and I discovered that when I comment out the line that says "T4CONbits.TMR4ON = 1;", line 222, the robot doesn't get stuck blinking the amber Program State light, but obviously I don't get good gyro values.

Thanks in advance for any help,
Jonathan
  #2   Spotlight this post!  
Unread 08-02-2008, 20:41
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: ADC not initializing

Quote:
Originally Posted by antiNeo View Post
I'm using the latest 2008 ifi_frc_sensor code from kevin.org. I'm trying to get ADC initialized so that I can use the gyroscope, but when I try to call Initialize_ADC() inside of the Initialization() function and upload the code to the robot, the robot's Program State light continues blinking as though it's still downloading the code but it has already completed. I tried to do a bit of debugging with the Initialize_ADC() function and I discovered that when I comment out the line that says "T4CONbits.TMR4ON = 1;", line 222, the robot doesn't get stuck blinking the amber Program State light, but obviously I don't get good gyro values.

Thanks in advance for any help,
Jonathan
Did you follow the steps in the readme.txt file?

Quote:
By default the analog to digital and gyro software is disabled.
Perform these steps to get your gyro working:
1) Enable the Initialize_ADC() and Initialize_Gyro() functions in
teleop.c/Initialization().
2) Enable the timer 4 interrupt service routine in ifi_frc.h
3) Make sure timer 4 is disabled at the top of timers.h.
4) Depending on the operating modes you will be using the gyro,
place calls to the Process_Gyro_Data() function in the disabled.c/
Disabled_Spin(), autonomous.c/Autonomous_Spin() and/or teleop.c/
Teleop_Spin() functions.
5) Add gyro bias calibration code that will execute before you
use your gyro. Example calibration code has been placed in
disabled.c/Disabled() that can be used for the competition (this
requires that you use a mode dongle to emulate the field
controller, which will put you in disabled mode for a period of
time before transitioning to autonomous mode). For testing
purposes you can also use the example code in teleop.c/Teleop()
to make sure your gyro is working.
6) Follow the instructions in adc_readme.txt, adc.h, gyro_readme.txt,
and gyro.h for information related to installation and calibration
of your gyro.
7) If building for the 2004 or 2005 PIC18F8520 based robot controller,
you will need to use the adc_8520.c source file instead of adc.c.
The header file adc.h will work with either version.
8) If building for the 2004 or 2005 PIC18F8520 based robot controller,
you will need to enable the ADC interrupt service routine in
ifi_frc.h
-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 08-02-2008, 21:40
antiNeo antiNeo is offline
Registered User
FRC #1569
 
Join Date: Jan 2008
Location: Pocatell, Idaho
Posts: 17
antiNeo has a spectacular aura aboutantiNeo has a spectacular aura about
Re: ADC not initializing

Thank you. I apologize for not reading the read me more carefully. I forgot step 2. This gyro is really neat.
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ADC #pragma cprogrammer Programming 1 26-10-2006 20:42
Problems Initializing Serial Driver... neilsonster Programming 0 13-02-2005 23:27
Initializing autonomous mode Mr. Lim Programming 7 02-02-2004 07:26
Header Not Found (adc.h) NotQuiteFree Programming 2 23-01-2004 16:26
Change to Initializing Inputs and Outputs Jferrante Programming 4 07-01-2003 11:36


All times are GMT -5. The time now is 19:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi