Shop OBEX P1 Docs P2 Docs Learn Events
Would this be the proper way to solve a problem? Could this work — Parallax Forums

Would this be the proper way to solve a problem? Could this work

GuidoGuido Posts: 195
edited 2006-02-08 14:48 in BASIC Stamp
I have a Stamp Controlling a Pan and Tilt Camera Motor with a feed back circuit using LTC1298. It basically works off a Clock and moves to a different location every 5 minutes...The problem I have is·the camera is located in a rural area, and power failures happen about once a month. When Power comes on again the Tilt·Up Stamp output goes on·will run·until it reaches the Tilt's limit switch..(which means I have to go Up there and reset it).Seems as if the LTC feedback needs time to stablalize, hence the tilt motor is fast. Would this be a proper way to protect it. Where as LTC=Pan and LTC1=Tilt. The Clock Maintains it Memory by means of a super cap. What I am trying to do here is run this in the main loop while reading the LTC, since the only time the Outputs should be on is when it has reached a certain time and needs to move the camera to the next set point...Basically I have no Idea why the stamp on start up is making the Tilt Output High unless I have a wacky signal from the LTC

IF LTC=<2500 XOR LTC=>500 XOR LTC1=<2500 XOR LTC1=>500 THEN STOP

STOP:
·LOW Up
·LOW DWN
·LOW Right
·LOW Left
·RETURN

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-02-08 01:21
    Perhaps you should post your program -- that may let one (or more) of us discover why you're getting the Tilt output high on startup.· The code you posted isn't operation as STOP is a PBASIC keyword.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-02-08 14:48
    I believe on reset all BS2 I/O pins go to an INPUT mode. This is equivalent to high-impedance, or 'floating'. If you haven't pulled that I/O pin high or low through an external pull-up or pull-down transistor (10 Kohms makes a nice value) then on reset that control pin may do lots of odd things.

    I usually defend against this by having the FIRST thing in my BS2 program be an unconditional setting of a 'default' value for every I/O pin I'm using. So on reset I'm guaranteed to know whether my pins are input or output, and if output I have a guaranteed value set for that pin.

    Were I you I'd put a 10 Kohm resistor between the BS2 TILT_UP pin and ground, to guarantee even when the BS2 is OFF, that pin will be LOW.

    Oh, and having googled it, the LTC1298 is an AtoD converter.· I assume you're using it to determine the camera position?· As such, I don't think it has anything to do with the TILT_UP pin going 'crazy' -- it's much more likely the missing pull-down resistor, or the missing initialization code for the BS2.

    Post Edited (allanlane5) : 2/8/2006 2:51:38 PM GMT
Sign In or Register to comment.