GTS strange behavior

Hi, im working on the GTS code for our teams robot and ive hit a roadblock of sorts. I have tried using the 2007 default code for the GTS and put printf statements in the encoder initialization function, yet nothing is ever printed. the interrupt handler is also never executed. there is no “Phase B” code and the encoder is wired into the Digital Input 1 input. The Initialize code for the encoders is in the User_Initialization function:

printf("Initializing Encoders…
");
Initialize_Encoders();

printf(“Encoders init done!”);

both printf statements are executed, however the InitializeEncoders function is not executed:

//first few lines

void Initialize_Encoders(void)
{

printf("initializing encoder 1  

");
//rest of init code here…

whats going on? Thanks

–iwdu15
–Team 811

Maybe it’s just me. I do not know of any “2007 default code for the GTS”. Please provide a link to the code you are trying to use.

oops sry, typo, i meant the 2006 code at: http://www.kevin.org/frc/ …sry about that

I assume that you are using Kevin’s FRC_encoder.zip files.

I also assume that you know what a statement like

#ifdef ENABLE_ENCODER_1”

does and that you placed your printf outside the compiler directives.

Am I on the right track?

Mike

Does the source code file with the encoder initialization function #include <stdio.h>? If not, the printf won’t actually produce any output.

A few pointers:

Kevin’s code uses the C Library printf with his buffered, interrupt driven serial port routines. The default code has it’s own printf and serial port initialization. You need to use one or the other but not both.

Kevin’s encoder code is for a quadrature encoder. The gear tooth sensor is not a quadrature encoder, so there is no Phase B signal. This means that you cannot determine the direction of rotation from the gear tooth sensor.

hi, thanks for the replies…i already took out the PhaseB stuff and i did include stdio.h…so thats not the issue. il try checking the printf statements and use the way included in the GTS code and get back to you…thanks for the help so far

–iwdu15
–team 811