|
Programming our robot. (due: Thursday 2/10)
This lab is an in-class exercise - report to the computer lab, as normal. Your task is to: 1) Install the MCHPFSUSB_Setup_v1.3 USB software. "Here is a local copy (3Meg). 2) Disconnect your motor cable and then connect up your usb cable to a PC. 3) Connect your robot, by way of the USB cable, to your computer. If it doesn't detect the robot's USB device, make sure your robots power is turned on (blinking light) hold-down the [pgm] button and press the [reset] button. 4) When the "Found new hardware" message comes up. Browse to the needed driver at: C:\MCHPFSUSB\Pc\MCHPUSB Driver\Release - it should now recognize your device. We are going to use this, later, to program our processor. For now, it is loaded and tested, ready for use... Your second task is to assemble a program, transmit it to your robot's board and test the forward motion of your robot. Here is the program to be loaded
"test1b.asm"
assembly program.
The following will help guide you through the process: 1. Use a text editor to view these routines, "notepad++" (works best) or use the regular "notepad" program ( it works "O.K"). "Here" is the port assignment table, it will become more important as we continue to develop our robot. 2. Use a text editor (notepad++, etc.) to create your assembly program source file. This file should have an extension of "asm" for assembly and contain the assembly program (i.e., test2b.asm ). Edit and save the file - remember to name it "test2b.asm". *** In this lab you are provided with the assembly program... 3. Use the MPASM assmbler to assemble the program, the assembler will create, a "hex" file as it's output. "Here is a local copy of MPASM (2.6Meg)." This file will be called "test1b.hex". The masm assembler reads in your assembly program "test2b.asm" and then assembles it into the hex file "test1b.hex". Take a look at the screen shot of the MASP assembler, ready to assemble:
After you have the program assembled into a hex file, you need to get the file onto your board. For this we will need the "PDFSUSB" program. Navigate to C://MCHPFSUSB/Pc/Pdfsusb\PDFSUSB.exe, right-click your mouse as you drag it onto the desk-top, create a short-cut, to make it easier to use it in the future. Connect your robot, by way of the USB cable, to your computer. If it doesn't detect the robot's USB device, make sure your robot's power is turned on (blinking light) hold-down the [pgm] button and press the [reset] button. Now double-click on the icon and load your hex file as shown below:
Finally, program the robot as shown below:
Have the instructor sign off on your robot's proper function. It should: move forward, pause for 5 seconds and then move forward again, this will repeat. If your motors are wired differently change the assembly program to correct the problem. We will cover these steps in class. Proper Robot function:_____________________________________________ |