November 22, 2024, 02:11:31 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Unable to connect to Prop-1 Controller

Started by LoonAZ, October 29, 2007, 02:57:08 PM

Previous topic - Next topic

LoonAZ

My Prop-1 controller has a real weird problem. I was able to load the CindyBob Monster-In-A-Box program into the controller. All was fine and things ran as they should. I left the prop running at a halloween party. At some point later on, the prop stopped working properly and the Prop-1 program started running eractically. Upon analysis, it appears the programing became corrupt and mutated into something different than what was originally downloaded. I thought I would be able to just refresh the code to fix the problem, but I now cannot connect to the Prop-1 via the IO port. I am now unable to discover the Prop-1 through the identifier in the BS-Editor.

Any thoughts on how to recover the Prop-1?

JonnyMac

In 13 years of using the BASIC Stamp controller, including hundreds of personal and professional projects with it, I have never had a program "mutate" into something else.  I'm not saying that yours didn't, but I'm quite certain that there is serious extenuating circumstances that caused this weird event.  My concern is that something electrical has caused the controller reset circuitry to fail; that *could* allow for the program to become corrupted.

Make sure you disconnect everything from the Prop-1 before attempting to reprogram.  And check your wiring.  I know, I know, everybody is perfect with their wiring (me too).  That said, I've been doing this a long time and every time I track down a problem that has no basis in code it exists outside, usually with something I overlooked.
Jon McPhalen
EFX-TEK Hollywood Office

LoonAZ

I have completely removed the Prop-1 from the project box it was mounted in, so it essentially free standing at this point. I am still unable to identify it in the BS-Editor. I have borrowed a friends Prop-1 controller and connected it to my PC just fine, so I know there is no issue with the serial connection.

This is what I mean when I say the program mutated...

When the program ran normally it would follow this sequence...
1. It would wait for PIR input and then read Pot 1 for intial timer delay value. It would then exectue initial timer delay period.
2. It would turn on fog relay and trigger chipcorder playback.
3. It would turn on wiper motor relay and simultaneously randomly energize lights relay.
4. It would turn off all three relays after a short period of time.
5. It would cycle steps 2-4 one more time.
6. It would read Pot 2 for reset timer delay.
7. After reset timer delay finished it would return to step 1 and wait for PIR input.

Now what it does is...
1. Starts executing the program without any PIR trigger.
2. During the first loop of the program it executes steps 2-4 (listed in the block above) properly (fog relay, motor relay, chipcorder trigger, and randomized lights relay).
3. Where in step 5 above the program should repeat steps 2-4 (listed in the block above), instead it only energizes the flashing lights relay (no fog, no chipcorder, no motor relay).
4. At the end of the flashing lights it energizes the motor relay briefly (a fraction of a second).
5. It then pauses for a few seconds (regardless of the Pot setting) and then runs steps 3-5 (listed in this block), and continues to do this endlessly.

If I try to identify the Prop-1 while it is running in this endless loop, it will stop executing the program while the scanning is being executed. And when the scanning fails the endless loop continues. So it appears that some form of serial communication seems to be ocurring.

livinlowe

Can you post a copy of the program you are using? It might help clear up whats causing the wierdness.
Shawn
Scaring someone with a prop you built -- priceless!

LoonAZ

This is the program code. It was lifted off the CindyBob.com Monster-In-A-Box website.



' =========================================================================
'
'   File....... MIB2005.bs1
'   Purpose.... Monster In A Box Prop Control
'   Author..... Robert Hole
'   Web...      www.halloween.cindybob.com
'   Started.... 20 Aug 2005
'   Updated.... 25 Feb 2006
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'


' -----[ I/O Definitions ]-------------------------------------------------
SYMBOL  Trigger = PIN7
SYMBOL  Test    = PIN6
SYMBOL  FOG     = PIN2
SYMBOL  Motor   = PIN0
SYMBOL  Lights  = PIN1
SYMBOL  SND     = PIN3
SYMBOL  IPause  = PIN4
SYMBOL  TOut    = PIN5

' -----[ Constants ]-------------------------------------------------------

SYMBOL Repeat       = 2      'Number of times the pattern will repeat
SYMBOL MaxFogTime   = 1000

' -----[ Variables ]-------------------------------------------------------
SYMBOL  DoFog           = B3
SYMBOL  Triggered       = B1
SYMBOL  Reps            = B2
SYMBOL  LightLoop       = B0
SYMBOL  wTime           = W2
SYMBOL  rTime           = W4
SYMBOL  pTime           = W5
SYMBOL  FogOnTime       = W3

' -----[ Initialization ]--------------------------------------------------
LOW 0       'Motor Off
LOW 1       'Lights Off
LOW 2       'Fog Off
LOW 3       'Sound Off
pTime=7864
DoFog=0     'No Fog if left at 0

' -----[ Program Code ]----------------------------------------------------
Start:
  LOW 0       'Motor Off
  LOW 1       'Lights Off
  LOW 2       'Fog Off
  LOW 3       'Sound Off
  DEBUG CLS,"Ready",CR


Main:
'  DEBUG "Ready",CR
  Triggered=0
  IF PIN7=0 AND PIN6=0 THEN Main
  Triggered=PIN7
  IF Triggered=1 THEN DoWait
  IF Triggered=0 THEN DoTesting

Run:
  FOR Reps = 1 TO Repeat
    HIGH 0      'Motor On
    HIGH 1      'Lights On
    HIGH 3      'Sound On
    DEBUG "Motor and sound on: Rep",#Reps,CR

    DoFog=1     'Set Fog to run
    GOSUB LightIt

    LOW 0       'Motor Off
    LOW 1       'Lights Off
    LOW 3       'Sound Off
    DEBUG "Motor and sound off.",CR,CR
    RANDOM rTime
    pTime = rTime // 3 +1 * 1000
    PAUSE pTime
  NEXT

  IF Triggered=0 THEN Start
  wTime=0
  POT 5, 47, wTime          ' read timeout pot level
  PAUSE 200
  wTime=wTime /4            ' 0 to 60 secs
  wTime=wTime-1

  FOR reps=wtime TO 0 STEP -1
    DEBUG CLS,"Lock out for ",#reps,"seconds"
    PAUSE 1000
  NEXT

  GOTO Start

' -----[ Subroutines ]-----------------------------------------------------
LightIt:
  IF DoFog=1 THEN DoFogOn
Continue:
  DEBUG "Lights Flashing",CR
  FOR LightLoop=1 TO 10
    HIGH 1      'Lights On
    'DEBUG "   Light on: ",#LightLoop,CR
    RANDOM rTime
    pTime = rTime // 6 +1 * 100
    FogOnTime=FogOnTime+pTime
    'DEBUG #FogOnTime
    IF FogOnTime>=MaxFogTime AND PIN2=1 THEN DoFogOff
Continue2:
    'DEBUG "   Lights On ",#pTime,CR
    PAUSE pTime
    LOW 1       'Lights Off
    'DEBUG "   Lights off",CR
    RANDOM rTime
    pTime = rTime // 5 +1 * 100
    'DEBUG "   Lights Off ",#pTime,CR
    PAUSE pTime
  NEXT
  DEBUG "Lights Done", CR
  RETURN

DoFogOn:
  FogOnTime=0
  HIGH 2      'Fog on
  DEBUG "Fog is on",CR
  GOTO Continue

DoFogOff:
  LOW 2      'Fog off
  DEBUG "Fog is off", CR
  GOTO Continue2

DoWait:
  wTime=0
  POT 4, 47, wTime          ' read intial pause pot level
  PAUSE 200
  wTime=wTime /8                 ' 0 to 30 secs
  FOR reps=wTime TO 0 STEP-1
    DEBUG CLS,"Triggered - Pause for ", #reps,"seconds",CR
    PAUSE 1000
  NEXT
  DEBUG CLS
  GOTO Run

DoTesting:
  DEBUG CLS,"  >>>> Testing <<<<",CR,CR
  GOTO Run

JonnyMac

October 29, 2007, 06:31:10 PM #5 Last Edit: October 29, 2007, 06:35:50 PM by JonnyMac
Sometimes weird things happen, especially when we connect a lot of electrical devices.  As I'm not able to see your setup and all the connections first-hand I can't offer anything helpful vis-a-vis your connections, wiring, and possible load problems.

Before you throw in the towel and send it back to us I would try reprogramming the controller.  This may take several attempts.  Part of the reason is that the program is using a lot of DEBUG statements (that should be commented out after testing) and this really impedes the IDE's ability to connect to the BS1 (it can't listen while it's sending messages, you have to catch it in between); it may take several tries.  If you can't get it to connect you'll have to return it to use for repair.
Jon McPhalen
EFX-TEK Hollywood Office

LoonAZ

Thanks for the suggestion. Do you have any recommendations for improving the odds of identification discovery (ex. pressing reset button during scanning, initiate identification in powered down state and then turn on, etc.)? And if I still can't get it visible, do I just follow the return procedures on your website?

Thanks again for your time and responses.

JonnyMac

You could try pressing the reset button (briefly) on the Prop-1 and then immediately press the program download button on the IDE.  If when you press the reset button the power light dims that indicates a problem with the reset circuitry.
Jon McPhalen
EFX-TEK Hollywood Office