|
This example will show you how 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 may help guide you through the process: 1. 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., test1b.asm ). Edit and save the file - remember to name it "test1b.asm". *** In this lab you are provided with the assembly program... 2. 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 "test1b.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:
Once it's loaded, you'll get a warning message about improper bits being set... Answer as shown below:
Finally, program the robot as shown below:
Your robot should now: 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. |