Shop OBEX P1 Docs P2 Docs Learn Events
Conflict with GPS receiver and PSC? — Parallax Forums

Conflict with GPS receiver and PSC?

skatjskatj Posts: 88
edited 2008-02-13 01:28 in BASIC Stamp
I'm working on a project that involves both the parallax servo controller and the parallax GPS receiver. I just finished drafting the code and have begun testing it, but I keep running into a problem.

It seems that whenever I have the GPS receiver and the servo controller plugged in at the same time, the servo controller does not work.

What's weird is that, like all my other problems, this began to happen all of a sudden for no apparent reason. I've used both of them at the same time many times before this.

When I have the servo controller and the GPS receiver plugged in, I can power up the stamp and the PSC will automatically center all servos but I can easily move them with my hand, and apparently it is not sending any signals since the green LED does not blink (The red LED is lit). I also am unable to download programs when this is happening, since the Basic Stamp Editor is unable to detect the Stamp (it works fine if the power switch is set to 1, i.e. no power to servos/gps, and when the GPS receiver is not plugged in).


When I have just the servo controller plugged in, everything works as normal.

I'm using two programs to try and debug this problem, the following code is what I use to run the servos, and I've attached the program I'm trying to get to work in the post. In both programs, the PSC behaves as described above.

' {$STAMP BS2}
' {$PBASIC 2.5}

Sdat CON 12
baud CON 396

ServoPos1 VAR Word
ServoPos2 VAR Word
ServoPos3 VAR Word
CameraPos VAR Word
counter VAR Nib

DO
PAUSE 3000

ServoPos1 = 1250
SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", 5, 1,  servoPos1.LOWBYTE, servoPos1.HIGHBYTE, CR]

ServoPos2 = 500
SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", 13, 1,  servoPos2.LOWBYTE, servoPos2.HIGHBYTE, CR]

CameraPos = 300
SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", 12, 1,  CameraPos.LOWBYTE, CameraPos.HIGHBYTE, CR]

PAUSE 500

ServoPos3 = 350
SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", 2, 1,  servoPos3.LOWBYTE, servoPos3.HIGHBYTE, CR]
GOSUB Shutter_Button
PAUSE 2500
ServoPos3 = 1050
SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", 2, 1,  servoPos3.LOWBYTE, servoPos3.HIGHBYTE, CR]
GOSUB Shutter_Button



Shutter_Button:
   CameraPos = 1250
   SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", 12, 1,  CameraPos.LOWBYTE, CameraPos.HIGHBYTE, CR]
   PAUSE 1000
    CameraPos = 300
   SEROUT Sdat, Baud+$8000,[noparse][[/noparse]"!SC", 12, 1,  CameraPos.LOWBYTE, CameraPos.HIGHBYTE, CR]
RETURN

LOOP

END



Any ideas as to what's wrong?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-10 06:13
    Maybe it's a power problem? It sounds like as soon as you start connecting high drain items, the PSC and Stamp stop working properly.
  • skatjskatj Posts: 88
    edited 2008-02-10 06:16
    The servos are running off a separate power source, but the GPS receiver runs off the servo port power, so I think you may be on to something. I haven't replaced this 9V battery in a while, I'll buy a new one tomorrow morning and see if that doesn't fix it.

    Thanks Mike.

    edit: btw, if this turns out to be the cause of the problem, do you still advise I run the same setup, as long as I change out batteries every so often, or is this harmful to the Stamp somehow?
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-10 15:33
    It's not harmful to the Stamp. It's just an expensive way to power a device. 9V batteries just don't have much capacity. You'd be much better off with a 4 cell AA alkaline battery pack or a 5 cell AA NiMH rechargable battery pack. The rechargables now come in capacities around 2500 mAh. The Stamp regulator and the GPS regulator are very happy with a 6V supply voltage.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-02-11 16:15
    As a note, a 9V battery won’t run the GPS for very long. It draws a lot of current and a 9V battery cannot supply very much to begin with. I can see a 9V battery being drained within an hour or two running the GPS.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • skatjskatj Posts: 88
    edited 2008-02-12 04:33
    Thanks Chris

    How can I wire a battery back to the Stamp's power terminals?

    Would I solder something like this http://www.radioshack.com/product/index.jsp?productId=2062219&cp=2032058.2032230.2032264&parentPage=family to the battery back wires and snap it on the Stamp?

    I also noticed some people who had a battery pack with a cable that plugged right into the Stamp, but I am not sure what they are called/where to get them.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-02-12 15:48
    If you have a battery pack that terminates to wires then yes, you could use that 9V battery snap and connect it via the battery terminals on the BOE. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-12 15:57
    When you use the RadioShack 9V battery snap and leads, make sure it's wired correctly. I believe the red/black color coding is correct for using the leads to connect to a battery, but it's backwards for taking the place of a battery.
  • skatjskatj Posts: 88
    edited 2008-02-12 17:26
    I soldered black to black, and red to red, should I reverse it?
  • Tom CTom C Posts: 461
    edited 2008-02-13 01:28
    skatj,

    Mike Green is correct about the leads being reversed when the battery snap is taking the place of the battery.

    If you wire it red to red and black to black, you will smoke the BOE.

    Just a thought.

    Regards,

    TCIII


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    If you are going to send·a Robot·to save the world, you·better make sure it likes it the way it is!
Sign In or Register to comment.