Hexapod Test Programs
Test the Programming Function
- Create a simple program to blink the leds. These are connected to pins B0
and B1. Perhaps try a program that blinks the leds alternately or varies the
blinking rate. Try the program first on a breadboard.
- If it works, shut off the main power switch on the Hexapod. Remove the jumper
at the programmer interface (on the control board) and remember where you
put it. This disconnects power again to the board. Insert the programmer on
the board connectors [need photo here]. And program the chip using icprog.
- Remove the programmer. Reconnect the jumper. Ooops, you probably lost it.
I told you to remember where you put it. Spend some time looking for the jumper
and when you find it reconnect the power and switch on the main switch on
the power on the hexapod.
- If the leds blink then you have verified the programming and function of
the board, if not see your instructor, its time to troubleshoot.
Test the Sensors
- Write a program that reads the sensors and write the results to the leds.
- In order to do this you must set trisa to input and trisb to output.
- IMPORTANT You must also insert the line "cmcon = $07", this turns
off a comparitor mode on port a. (without this port a will not act as an input.
- The sensors are located on A0 and A1 so they simply must be read by reading
port a and outputted to portb.
- When the program is completed and debugged you can test the proximity function
of the sensors. Proximity of each of the sensors should turn the leds on and
off.
Centre all Servos
- Write a program to centre all of the servos. They are connected to pins
B3, B4 and B5.
- When this works you have verified the servo connections. You may need to
physically adjust the servo mechanical connections when the servo is centred.
See you instructor if this is required.
Technological Design Home