Saving Program on SumoBot
ToddH
Posts: 34
I have a sumobot (BS2) from TAB. I created my first program. Yippy for me [noparse]:)[/noparse] When I have the serial cable plugged into the robot and execute "RUN" it runs the program just fine. Continuing to have the cable plugged in, I can turn the robot off and on again and it will run MY program that I created.
Here is the issue: If I removed cable from the robot, the robot reverts back to the program that comes loaded on the chip (doesn't run my program anymore).
Any thoughts on how I can get my program to stay with the robot after the serial port is disconnected?
Thanks again!
Here is the issue: If I removed cable from the robot, the robot reverts back to the program that comes loaded on the chip (doesn't run my program anymore).
Any thoughts on how I can get my program to stay with the robot after the serial port is disconnected?
Thanks again!
Comments
The Tab Sumobot uses a 16C505 co-processor for the 'native' behaviors. It has a on-board BS2 you program to control the co-processor, which then runs the motors etc. The first thing in your BS2 program should be a command to tell the co-processor not to do anything -- and I believe you must do this after a delay, to let the co-processor 'reset' itself and start 'listening' to the BS2.
Check also http://groups.yahoo.com/group/tabrobotkit in their 'Database' area they have an FAQ which may help you solve your problem.
Okay, I just went there, and no this is not a common problem.· Probably you need to send a 'RobotStop' command the first thing you do in your BS2 program.
Post Edited (allanlane5) : 12/28/2004 3:09:49 PM GMT
pause 200 ' Stop the Robot from Running
RobotData = RobotStop
gosub RobotSend
pause 100 ' Wait for Robot to Get Setup
low LED ' Flash LED Twice
pause 200
high LED
pause 200
low LED
pause 200
high LED
.....
I've tried adjusting the pause before the RobotStop from 50 to 500 and I get the same results. Any ideas?
Thanks in advance!
Make sure you reload the RobotData parameter each time -- I suspect it is destroyed by the RobotSend command.
I don't know why you're having this problem. It almost sounds like a missing pull-up or pull-down on the lines between the BS2 and the co-processor. The co-processor, even when running 'native' behaviors, should still be 'listening' for signals from the BS2.
Umm, it just occurred to me, you DO still have the:
'· Mainline
·· HIGH SC··········· '· Set the I/O Bits As Output
·· HIGH SD··········· '·· and High
·· HIGH LED········ '· Turn off the LED
lines in your code, right?· The SC and SD lines are what is used to the co-processor, and signaling won't work right if these are not set right.
Post Edited (allanlane5) : 12/28/2004 6:47:59 PM GMT
I coded as you described above. Here is what I see (and its consistant):
Power on - runs my program
Power off - Power on - runs "native" program
Power off - Power on - runs "native" program
Then...
Power off - COUNT TO 10 - power on - runs my program (every time!)
As long as I count to 10 after powering off the robot it will run my program every time. If I power down and count to 1 or 2 and turn it back on - it runs native.
Can you explain to this novice.. why?
Rick
Thus, when you do a 'short' power-cycle, the BS2 resets but the PIC does not. Then the PIC runs the 'native' stuff and ignores the BS2.
With the cable plugged in, you have something to 'suck' the voltage from the SumoBot, thus resetting the 16C505 every time.
It's only a theory, though. A 'hard reset' push button would be nice to prove this -- but then it doesn't really sound like you need it, if a 10-second delay is enough.