20 October 2008
On the ECEbot:
- Turn the robot power switch OFF.
- Set the robot DIP switches for Mode 6 (set switches 1:2:3:4 to "off ON ON off").
- Connect the serial cable from the PC to the robot.
On the PC:
You must now close and then re-open the spreadsheet to enable the macros and Active-X features of the file: click OK if you are prompted to accept these features.
- Locate a copy of the command spreadsheet: mode_6_download.xls. Check the EE101 folder on the PC desktop in CB602.
- Open the spreadsheet in Excel. You may get a "macro security" warning. This is OK.
- Go to Tools | Macro | Security... and set the Security Level to Medium. Click OK to close the security window.
- Go to Tools | Add-Ins... and make sure the Analysis ToolPak is selected. Click OK to close the Add-Ins window.
- Now use File | Save As... to make your personal copy of the spreadsheet using a unique name. Save it on the PC in the c:\ee101 folder. You will may get several notice boxes popping up: these are OK.
- Make sure that the spreadsheet is using the proper communications port: check the "settings" sheet (the pane behind the regular spreadsheet) and see that the COM port setting is correct (probably should be COM 1 on most computers).
If you are sharing the PC with other students, make sure each student has a unique spreadsheet to work from.
Now edit the Command and Duration columns (green) to create the sequence you want.
The Command selections are Forward, Backward, Left, Right, Sleep, and HALT. You can select the cell and type in the command, or select the cell and then use the dropdown selection menu.
The Duration settings are in milliseconds (1000 ms = 1 second). Valid durations are from 1 ms through 8191 ms. If you need to execute a command with duration longer than 8191 ms, use the same command on the next step (the total duration is now the sum of the two or more sequential commands).
Up to 128 steps can be programmed.
Once the sequence is ready, save the file, and:
- Holding the robot so the wheels are free to rotate, turn the robot power switch ON.
- The robot display will show the firmware version number (e.g., "3.1"), then the mode number ("6"), and then a 4-digit pattern. As soon as the 4-digit pattern appears, press SW2 on the microcontroller module. The robot will be on with the multi-segment LED display showing "0". The robot is now waiting for the command sequence download.
- Click the Download to Robot button on the spreadsheet. Your encoded command sequence is downloaded into the robot's memory. If you get a run-time error at this point, make sure that your spreadsheet has the macros enabled and the Analysis ToolPak installed (see steps 6-9 above).
- Do NOT turn the robot off (doing so will lose the commands that are now stored in RAM!). Carefully disconnect the serial data cable.
- Press the RESET button on the microcontroller module. The robot should perform its startup sequence for mode 6, the begin executing the commands. The display indicates the current step in the command sequence. The robot will stop and the display will flash if either bumper switch is contacted or a HALT command is encountered.
To change the sequence, re-edit the spreadsheet, connect the serial cable, and repeat steps 10-14.
If you do not seem to get a successful command download, check the robot procedures and make sure the cable is connected properly. Also, make sure that the spreadsheet is using the proper communications port: check the "settings" sheet (the pane behind the regular spreadsheet) and see that the COM port setting is correct (probably should be COM 1 on most computers).