Getting
Started
Read
the programming and usage instructions above. Beyond these the Atmel Mega8
spec is probably the most important document to study: http://www.atmel.com/dyn/resources/prod_documents/doc2486.pdf
You'll
need to install MegaLoad to interface with MegaBitty's installed bootloader (see
the MegaBitty Programming and Usage Instructions.). You will need to build your
own or
purchase an external RS232 level translator such as the Acroname
BrainStem which is also available from ROBOTmaker store.
Programming
You'll
also need to get setup with a compiler of some sort. The C-compiler CodeVision
(from HP InfoTech S.R.L) can be highly recommend, as it is easy to get started
with, has a nice skeleton-code generator that really helps in setting up the
Mega8's peripherals. It has also a FREE trial version that is not
time-limited (but it is code-size limited.) Please refer to the MegaBitty
forum, for many examples of programming code
Example
PWM motor drive program (Courtesy of Bittybot)
After
installing the MegaLoad bootloader (see the MegaBitty Programming and Usage
Instructions above) you can test the H-bridge operation by attaching two DC
motors and loading the simple program attached below. Ensure the rating of the
motor is appropriate for the MegaBitty though!
This
program ramps the motors up and down,
in forward and reverse and disables the motors during every other up-down cycle.
All other pins (besides the green & blue LED driving pins) are configured as
inputs, so you can run this program on robots without risking damage to other
connected devices. You should be able to just download the .hex file, but the C
code (CodeVision) is attached for for reference.
When running this program, each motors should
ramp up and down when it’s corresponding LED is lit (green corresponds to
motor A; blue to motor B) and each motor should remain stopped when it’s
corresponding LED is off.
motTEST.c
motTEST.hex
- This
simple program is actually used to test the functionality of the MegaBitty
before shipment, as a Quality Assurance procedure..
Sumo
Examples:
microsumo.zip
- Source code (in c) and
Makefile for a simple micro-sumo bot using the MegaBitty.
microsumo2.zip
- Source code (in c) and Makefile for a slightly more advanced micro-sumo
bot using the MegaBitty
sampleSumo.c
Heavily commented sample sumo code for the MegaBitty. Written in C for the CodeVision compiler.
There
are many other example programs to download from the Yahoo
user group
(Download files at own risk. Virus check all files
downloaded from this site. ROBOTmaker takes no
responsibility for these files.)
Interfacing the Infrared Control Freak to
MegaBitty Controller
The
IRCF delivers asynchronous serial data with an 'RS-232' format, except
voltages are at 0-5 volts! Although the voltage is outside the
RS-232 standard, it is suitable for interfacing to most robot
controllers. Depending on the configuration of your robot controller's
serial connection, the signal may need to be inverted. For true
RS232 interface a MAX232 may be required.
A
software UART has been development by BittyBot
to enable the IRCF to interface to the MegaBitty. This SW UART
offers an added advantage as it has the
advantage of freeing up the Hardware UART for communications with a
computer for programming. Some example code on using them. Look for
ircf_cv.zip in the MegaBitty Sample Code section in the MegaBitty Yahoo
group files section:
http://tech.groups.yahoo.com/group/MegaBitty/files/MegaBitty%20sample%20
code/