Help!!! Please
mikemacdonald031682
Posts: 6
We are having some trouble with retaining the memory we put into our stamp on the board of education stamp (bs2).· We can load the program onto it, but as soon as we disconnect the serial cable, the program stops and will not retain the program in memory.· Anone know why and how to fix this??? Thanks very much.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
'{$STAMP BS2}
'{$PBASIC 2.5}
' {$PORT COM3}
'declare output pins
push_BUTTON······· PIN 0
UpRtMotor········· PIN 2
UpLtMotor········· PIN 3
LowRtMotor········ PIN 4
LowLtMotor········ PIN 5
UpSplitMotor1····· PIN 6
UpSplitMotor2····· PIN 7
DownSplitMotor1··· PIN 8
DownSplitMotor2··· PIN 9
PositionDealCardMotor·· PIN 10
DealMotor········· PIN 11
'RtServos·········· PIN 11
'LtServos·········· PIN 12
'WirelessSensor···· PIN 13
'declare variables needed
loop_count········ VAR Byte
OPEN········ CON 1· 'define an alias for the constant 1
CLOSED······ CON 0· 'define an alias for the constant 0
'numPlayersIn······ VAR Byte
'=========================================
Main:
GOSUB WaitPush 'call subroutine to wait for the pushbutton
GOSUB Shuffle
END
'==========================================
'Shuffle the cards - Test
'==========================================
WaitPush:
······· DO WHILE ( push_BUTTON = OPEN)
··········· 'empty loop just waits for pushbutton press
······· LOOP
······· RETURN
Shuffle:
HIGH UpRtMotor
HIGH UpLtMotor
HIGH LowRtMotor
HIGH LowLtMotor
HIGH UpSplitMotor1
HIGH UpSplitMotor2
HIGH DownSplitMotor1
HIGH DownSplitMotor2
HIGH PositionDealCardMotor
HIGH DealMotor
······· 'Split cards in half
············ LOW UpSplitMotor1
············ PAUSE 5000
············ HIGH UpSplitMotor1
············ LOW UpSplitMotor2
············ PAUSE 5000
············ HIGH UpSplitMotor2
······· 'Shuffle cards first time
······· FOR loop_count = 1 TO 3 STEP 1
··········· LOW UpRtMotor
··········· PAUSE 5000
··········· HIGH UpRtMotor
··········· LOW UpLtMotor
··········· PAUSE 5000
··········· HIGH UpLtMotor
······· NEXT
······· 'Split cards again
··········· LOW DownSplitMotor1
··········· PAUSE 5000
··········· HIGH DownSplitMotor1
··········· LOW DownSplitMotor2
··········· PAUSE 5000
··········· HIGH DownSplitMotor2
······· 'Shuffle cards again
······· FOR loop_count = 1 TO 3 STEP 1
··········· LOW· LowRtMotor
··········· PAUSE 5000
··········· HIGH LowRtMotor
··········· LOW LowLtMotor
··········· PAUSE 5000
··········· HIGH LowLtMotor
········ NEXT
···
'Put cards into dealing position
······· LOW PositionDealCardMotor
······· PAUSE 5000
······· HIGH PositionDealCardMotor
··· 'Deal Cards
······· LOW DealMotor
······· PAUSE 5000
······· HIGH DealMotor
··· RETURN
·········
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
What power supply are you trying to drive your motors with? What driver chips?
"Floating" means there is nothing connected to a pin that is set for input. Thus the input 'floats', since it is not connected either to ground or to Vdd. It is also likely that the program HAS been successfully loaded into the chip, it's just hard for you to determine this once you've disconnected the serial cable.
You might want to put in the start of your program a statement:
DEBUG [noparse][[/noparse]"The BS2 is Reset", CR]
This way, every time your chip resets, you'll get a message that it did.