Is there any way to make the user processor put itself into program mode when a switch is pressed?
I ask this because I’m investigating a wireless serial interface to program the robot without walking over to it and plugging in, but I’m not sure how to remotely put the RC into program mode.
The older RCs used to automatically enter program mode when you tried to download… both good and horrible.
You can take a pwm cable, and cut the red and yellow (or white) wire. Reconnect one end of the red wire to one end of the yellow wire. Leave the other pair disconnected. Then stick the end with the connected yellow wire into a digital I/O, and the end with the connected red wire into the program header.
Diagram:
DIO PH
B -------------- B
R -- -- Y
Y -------------- R
In software, set the pin to high (1) in the initialization - don’t forget to make it an output. When you want to enter program mode, set the pin to low.
you can connect a digital output to the center pin (i think) on the program/reset headers right above the TTL headers. When you pull this pin to low it will enter program mode, we had our program poll the serial port for the character ‘p’ and pull the output low to trigger program mode from our laptop
We’ve done it on the TechnoKats robots for the past two years. All it takes is a single wire from one of the digital outputs to the “PROG” pin on the remote programming header. This year it’s “the blue wire” on the RC, with a single female servo pin crimped on each end and covered with heat shrink.
Make sure to configure the digital pin as an output and set it to a high level immediately upon starting the program. The User_Initialization() routine is the perfect place for this. Then have the program set it low in order to “press” the virtual program button.
Our software has a menu system based loosely on Kevin Watson’s camera and tracking menus. One of the top-level commands is the letter “p” to put the robot controller in program mode. We just activate the Terminal window from the IFI loader and go from there.
A cable from a digital output to the program header is what I was thinking too, but that sounds like an inefficient way to do it. I was hoping to find an assembly command to go into program mode. If one does not exist, however, I guess I’ll have to use the cable.
We also use a cable from a digital port to the programming pin. I’m not sure if what tdlrali said is correct. At least connecting the grounds together is unneeded, and won’t do anything. I’m pretty sure I remember taking the white signal pin from the digital port to the middle pin of the Reset/Prog pins. I think the left most one is Reset, the middle on is Program, and the far right is ground. You just need the signal to connect to the the middle pin of those three to the signal of the digital port.
Our team simply has a switch attached by a very long wire to the programming/reset pins. We just plug this in whenever code is working on the robot. For practicality, we have the switch encased in PVC pipe so that the end of the switch is sticking out. The entire assembly (switch, pipe, and wire) resembles a detonator for explosives. This has spawned countless jokes about code “blowing up the robot again”