Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   2006 CMUcam2 Code (http://www.chiefdelphi.com/forums/showthread.php?t=41254)

Cuog 14-01-2006 13:43

Re: 2006 CMUcam2 Code
 
k thanks time to search,
Cuog

Makubesu 14-01-2006 19:06

Re: 2006 CMUcam2 Code
 
My team is having some problems using the camera code. When we used the code that came with the controller, we were able to get the LEDs to light up for y movement on the joystick, as well as the trigger and thumb button. When we loaded on the camera code, though, none of those did anything. We loaded on the default code provided at IFI's website, and that fixed things, but we can't use the camera with just that code. Any idea what we're doing wrong? The user_routines.c files look the same, so I don't understand why the joystick wouldn't work.

Cuog 14-01-2006 20:36

Re: 2006 CMUcam2 Code
 
in the method: Proccess_Data_From_Master_uP(), make a call to Default_Routine, then in Default_Routine comment out the pwm assignment for pwm01 and 02 and you're good to go, i spent all day trying to fix this and hit my head against the wall when i got it.

Makubesu 14-01-2006 21:07

Re: 2006 CMUcam2 Code
 
Quote:

Originally Posted by Cuog
in the method: Proccess_Data_From_Master_uP(), make a call to Default_Routine, then in Default_Routine comment out the pwm assignment for pwm01 and 02 and you're good to go, i spent all day trying to fix this and hit my head against the wall when i got it.

Oh, I see, the call to Default_Routine is actually commented out in the camera code. Why do I need to comment out the assignments for pwm01 and 02 in default routine though?

X-Istence 16-01-2006 00:03

Re: 2006 CMUcam2 Code
 
Quote:

Originally Posted by Makubesu
Oh, I see, the call to Default_Routine is actually commented out in the camera code. Why do I need to comment out the assignments for pwm01 and 02 in default routine though?

Because those are standard used for the servo's, and last I checked it was not desirable for the servo's to be changed in position by the robot controller.

iBheat 16-01-2006 00:08

Re: 2006 CMUcam2 Code
 
Quote:

Originally Posted by X-Istence
Because those are standard used for the servo's, and last I checked it was not desirable for the servo's to be changed in position by the robot controller.

If by that you mean the PWM outputs for camera servos (pan and tilt) cannot be changed then you are incorrect if you look in tracking.h you see
Code:

// By default, PWM output one is used for the pan servo.
// Change it to another value if you'd like to use PWM
// output one for another purpose.
#define PAN_SERVO pwm01

// By default, PWM output two is used for the tilt servo.
// Change it to another value if you'd like to use PWM
// output two for another purpose.
#define TILT_SERVO pwm02

That defines which PWM output is used!

Windward 21-01-2006 16:07

Re: 2006 CMUcam2 Code
 
I don't know if this has been answered in one of the above posts or somewhere, but does the camera code (the one for MPLab) interfere with other code that we programmers add in? I can't get any of my personal code, including printfs, to work even though all the camera code works perfectly fine, including printfs. Is there something I'm supposed to edit before I can edit the default code and have it work?

Alan Anderson 21-01-2006 18:02

Re: 2006 CMUcam2 Code
 
The call to Default_Routine() is commented out in the camera code. If that's where you're putting your own programming, you now know why it doesn't seem to be doing anything. :)

Uncomment it and your code should run.

aaeamdar 22-01-2006 17:01

Re: 2006 CMUcam2 Code
 
Quote:

Originally Posted by MPLAB IDE 7.2 Linker
Clean: Deleting intermediary and output files.
Clean: Deleted file "G:\Default Code\main.o".
Clean: Deleted file "G:\Default Code\user_routines.o".
Clean: Deleted file "G:\Default Code\user_routines_fast.o".
Clean: Deleted file "G:\Default Code\user_SerialDrv.o".
Clean: Deleted file "G:\Default Code\ifi_startup.o".
Clean: Deleted file "G:\Default Code\ifi_utilities.o".
Clean: Deleted file "G:\Default Code\camera.o".
Clean: Deleted file "G:\Default Code\serial_ports.o".
Clean: Deleted file "G:\Default Code\tracking.o".
Clean: Done.
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8722 "main.c" -fo="main.o" /i"C:\mcc18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8722 "user_routines.c" -fo="user_routines.o" /i"C:\mcc18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
G:\Default Code\user_routines.c:252:Warning [2058] call of function without prototype
G:\Default Code\user_routines.c:260:Warning [2058] call of function without prototype
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8722 "user_routines_fast.c" -fo="user_routines_fast.o" /i"C:\mcc18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8722 "user_SerialDrv.c" -fo="user_SerialDrv.o" /i"C:\mcc18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8722 "ifi_startup.c" -fo="ifi_startup.o" /i"C:\mcc18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8722 "ifi_utilities.c" -fo="ifi_utilities.o" /i"C:\mcc18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8722 "camera.c" -fo="camera.o" /i"C:\mcc18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8722 "serial_ports.c" -fo="serial_ports.o" /i"C:\mcc18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
Executing: "c:\mcc18\bin\mcc18.exe" -p=18F8722 "tracking.c" -fo="tracking.o" /i"C:\mcc18\h" -D_FRC_BOARD -Ou- -Ot- -Ob- -Op- -Or- -Od- -Opa- -nw=2066
Executing: "C:\Program Files\Microchip\MPASM Suite\MPLink.exe" /l"C:\mcc18\lib" "18f8722.lkr" "G:\Default Code\main.o" "G:\Default Code\user_routines.o" "G:\Default Code\user_routines_fast.o" "G:\Default Code\user_SerialDrv.o" "G:\Default Code\ifi_startup.o" "G:\Default Code\ifi_utilities.o" "G:\Default Code\camera.o" "G:\Default Code\serial_ports.o" "G:\Default Code\tracking.o" "G:\Default Code\FRC_library.lib" /o"FrcCode.cof"
MPLINK 3.94, Linker
Copyright (c) 2005 Microchip Technology Inc.
Error - section '.udata_user_routines.o' can not fit the section. Section '.udata_user_routines.o' length=0x00000103
Errors : 1

This code gives us the above error. Some insight: hex 103 is just above 256. Are we exceeding some miserly value of MPLAB?

Thanks, I hope I'm not repeating someone.

Kevin Watson 22-01-2006 17:34

Re: 2006 CMUcam2 Code
 
Quote:

Originally Posted by aaeamdar
This code gives us the above error. Some insight: hex 103 is just above 256. Are we exceeding some miserly value of MPLAB?

Thanks, I hope I'm not repeating someone.

Try removing user_SerialDrv.c/.h from your project.

-Kevin

aaeamdar 22-01-2006 17:45

Re: 2006 CMUcam2 Code
 
Quote:

Originally Posted by Kevin Watson
Try removing user_SerialDrv.c/.h from your project.

-Kevin

This worked to fix the error, and I was about to throw a Jubilee Feast when it gave me a different error, about Breaker_Tripped:

Code:

MPLINK 3.94, Linker
Copyright (c) 2005 Microchip Technology Inc.
Error - could not find definition of symbol 'Breaker_Tripped' in file 'G:\Default Code\user_routines.o'.
Errors    : 1

That's fine, I fixed that (essentially commented it out), and then, BOOM I got the same error again:

Code:

MPLINK 3.94, Linker
Copyright (c) 2005 Microchip Technology Inc.
Error - section '.udata_user_routines.o' can not fit the section. Section '.udata_user_routines.o' length=0x00000103
Errors    : 1

=(

I HATE MP BLOB

Kevin Watson 22-01-2006 17:48

Re: 2006 CMUcam2 Code
 
Quote:

Originally Posted by aaeamdar
This worked to fix the error, and I was about to throw a Jubilee Feast when it gave me a different error, about Breaker_Tripped:

Code:

MPLINK 3.94, Linker
Copyright (c) 2005 Microchip Technology Inc.
Error - could not find definition of symbol 'Breaker_Tripped' in file 'G:\Default Code\user_routines.o'.
Errors : 1

That's fine, I fixed that (essentially commented it out), and then, BOOM I got the same error again:

Code:

MPLINK 3.94, Linker
Copyright (c) 2005 Microchip Technology Inc.
Error - section '.udata_user_routines.o' can not fit the section. Section '.udata_user_routines.o' length=0x00000103
Errors : 1

=(

I HATE MP BLOB

Post the .map file.

-Kevin

aaeamdar 22-01-2006 17:54

Re: 2006 CMUcam2 Code
 
Quote:

Originally Posted by Kevin Watson
Post the .map file.

-Kevin


What is the .map file and where can I find it?

Thanks,
Paul

Kevin Watson 22-01-2006 18:35

Re: 2006 CMUcam2 Code
 
Quote:

Originally Posted by aaeamdar
What is the .map file and where can I find it?

Thanks,
Paul

It should be in your build directory. If not, go to Project -> Build Options... -> Project -> MPLINK Linker tab -> Check "Generate map file" check box and then build all. The <project name>.map should now be in the build directory.

-Kevin

aaeamdar 22-01-2006 18:42

Re: 2006 CMUcam2 Code
 
Code:

MPLINK 3.94, Linker
Linker Error Map File - Created Sun Jan 22 18:39:54 2006

*Warning* - This is only a partial map file due to a link time error.
  Only sections which were allocated prior to the error are shown below.

CODEPAGES:
    Memory      Start        End              Section    Address Size(Bytes)
 ---------  ---------  ---------            ---------  ---------  ---------
  vectors    0x0000    0x07ff                                         

      page    0x0800    0xffff          _entry_scn    0x0800    0x0006
                                  InterruptVectorHigh    0x0808    0x0006
                                  InterruptVectorLow    0x0818    0x0006
                                              .cinit    0x081e    0x004a
                                .code_user_routines.o    0x0868    0x1270
                                    .code_vfprintf.o    0x1ad8    0x0c22
                                          .code_pow.o    0x26fa    0x0b2e
                                  .code_ifi_library.o    0x3228    0x0722
                                                PROG    0x394a    0x06a2
                                      .code_camera.o    0x3fec    0x0634
                                          .code_exp.o    0x4620    0x05c2
                                          .code_log.o    0x4be2    0x04f6
                                    .code_tracking.o    0x50d8    0x0408
                                            UTIL_LIB    0x54e0    0x0396
                                        .code_fchop.o    0x5876    0x028e
                                .code_ifi_utilities.o    0x5b04    0x01de
                                .code_serial_ports.o    0x5ce2    0x0188
                                .code_user_routines_fast.o    0x5e6a    0x015a
                                        .code_ldexp.o    0x5fc4    0x0134
                                        .code_frexp.o    0x60f8    0x0120
                                    .code_UnpkMath.o    0x6218    0x011c
                                    .code_PackMath.o    0x6334    0x011a

    idlocs    0x0000    0x0007                                         

    config    0x0000    0x000d                                         

    devid    0xfffe    0xffff                                         

    eedata    0x0000    0x03ff                                         


SHAREBANKS:

DATABANKS:
    Memory      Start        End              Section    Address Size(Bytes)
 ---------  ---------  ---------            ---------  ---------  ---------
      gpr0    0x0060    0x00ff            COPY_VAR    0x0080    0x0080

      gpr1    0x0100    0x01ff                                         

      gpr2    0x0200    0x02ff                                         

      gpr3    0x0300    0x03ff                                         

      gpr4    0x0400    0x04ff                                         

      gpr5    0x0500    0x05ff                                         

      gpr6    0x0600    0x06ff                                         

      gpr7    0x0700    0x07ff                                         

      gpr8    0x0800    0x08ff                                         

      gpr9    0x0900    0x09ff                                         

    gpr10    0x0a00    0x0aff                                         

    gpr11    0x0b00    0x0bff                                         

    gpr12    0x0c00    0x0cff                                         

    gpr13    0x0d00    0x0dff                                         

    gpr14    0x0e00    0x0eff              .stack    0x0e00    0x0100

    gpr15    0x0f00    0x0f5f                                         


ACCESSBANKS:
    Memory      Start        End              Section    Address Size(Bytes)
 ---------  ---------  ---------            ---------  ---------  ---------
 accessram    0x0000    0x005f                                         

 accesssfr    0x0f60    0x0fff        SFR_UNBANKED0    0x0f62    0x009e

Here it is.

Thanks


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

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