Shop OBEX P1 Docs P2 Docs Learn Events
CMUCam crashes robot — Parallax Forums

CMUCam crashes robot

jbermudesjbermudes Posts: 3
edited 2008-03-12 14:11 in Robotics
We've recently acquired a CMU Cam, and tonight we encountered a funny error. We downloaded the 8 function demo off the CD, and now we're having a weird error. If we run that program, the robot freezes, and from that point on, if we try to download a new program, the computer cannot find the BASIC Stamp anymore. Has this happened to anyone else?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-01 04:50
    About the only thing that can cause what you describe is some kind of power shortage or damage to the Stamp from an incorrectly connected CMUcam. The download process always forces the Stamp to reset and will overwrite any program previously downloaded to the Stamp, but the Stamp has to have power and be connected to a serial port on the PC.

    Typically this is some kind of power problem.
  • jbermudesjbermudes Posts: 3
    edited 2008-03-01 05:08
    Actually, we've discovered a little bit more on this issue:

    If we download a program that uses the camera, the robot will freeze during startup. In the Main Subroutine of the 8 Function Demo, it freezes after the Debug "#1" here:

    ==================
    Main:

    FOR N = 2 TO 5 ' Flash all LED's during pause
    DEBUG "#1", CR
    SHIFTOUT 5,11,MSBFIRST,[noparse][[/noparse]255]
    PAUSE 400
    DEBUG "#2", CR
    SHIFTOUT 5,11,MSBFIRST,[noparse][[/noparse]0]
    PAUSE 400
    NEXT
    ==============

    Once it has frozen, the CMU cam will not be found by the computer again until we turn off the robot and remove the camera, at which point we can download a new program, and everything is fine again as long as we're not trying to run a program using the camera.

    So apparently, there's something in the CMU Cam's built in initialization that is causing the whole robot to lock up, because having a camera plugged in causes the robot to not work at all, but removing it, causes it to work again.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-01 05:14
    Your discovery really hasn't changed anything. Neither the DEBUG statement nor the SHIFTOUT statement will cause the Stamp to hang. Both are executed normally whether a PC is attached (for the DEBUG) or the CMUcam is attached to pins 5 and 11 (for the SHIFTOUT). If there's a problem with the CMUcam that results in a short circuit or if the CMUcam draws more current than your power supply can handle, that could cause the robot to freeze during the CMUcam's initialization.
  • jbermudesjbermudes Posts: 3
    edited 2008-03-01 07:06
    A valuable lesson has been learned tonight. Don't replace old batteries with batteries that are also old. I figured if battery power was the problem, the bot would reset like usual and we'd hear that beep, I didn't know it could hang. Sorry for all the trouble. smile.gif
  • StampNut2StampNut2 Posts: 224
    edited 2008-03-02 17:31
    Batteries are one of the biggest problems in robots if not kept up to scratch, I know, I have fallen into the same problem and I guess that many others do also. Now I have a computer controlled charger and my batteries are always in top notch condition when I go to use them, Eliminating the obvious first is the easiest way to solve a lot of problems. A multi meter and power test points are the next step to finding problems.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Never give up when things go wrong, Just work them out.

    robosapienv2-4mem8.page.tl/
  • HumanoidoHumanoido Posts: 5,770
    edited 2008-03-12 12:41
    Are there any computer controlled chargers that you can recommend?

    humanoido
  • Mike GreenMike Green Posts: 23,101
    edited 2008-03-12 14:11
    I use the MH-C777PLUS-II by Maha Energy Corp. It will charge NiMH and Lithium batteries from single cells to over 16V.
Sign In or Register to comment.