HSC2011/Software/Firmware: Unterschied zwischen den Versionen
K (hat „HSC2011/Firmware“ nach „HSC2011/Software/Firmware“ verschoben) |
Chrysn (Diskussion | Beiträge) (added section on eeprom, moved todos to roadmap) |
||
(2 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt) | |||
Zeile 1: | Zeile 1: | ||
+ | <small>< [[HSC2011]]</small> | ||
+ | |||
+ | |||
The firmware is the part of the software flashed to the ATMega328 on the EduBuzzers. It capable of both serving as a buzzer and being a base station. | The firmware is the part of the software flashed to the ATMega328 on the EduBuzzers. It capable of both serving as a buzzer and being a base station. | ||
− | It is written in C (technically, C++, although hardly any C++ is used). It uses the [http://www.nongnu.org/avr-libc/ avr-libc], [http://jeelabs.net/projects/cafe/repository/show/RF12 JeeLabs' RF12 library] and [http://www.pjrc.com/teensy/td_libs_OneWire.html Paul Stoffregen's OneWire library]. A fourth "external" dependency is [http://www.clifford.at/embedvm/ EmbedVM], which is documented as [[HSC2011/ | + | It is written in C (technically, C++, although hardly any C++ is used). It uses the [http://www.nongnu.org/avr-libc/ avr-libc], [http://jeelabs.net/projects/cafe/repository/show/RF12 JeeLabs' RF12 library] and [http://www.pjrc.com/teensy/td_libs_OneWire.html Paul Stoffregen's OneWire library]. A fourth "external" dependency is [http://www.clifford.at/embedvm/ EmbedVM], which is documented as [[HSC2011/Software/EmbedVM|our virtual machine]] as it was developed for this project. |
− | == Compiling == | + | == Compiling and flashing == |
'''Note''': You can skip this step, and instead use the file <tt>firmware/firmware.hex</tt> from the [[HSC2011/Download instructions|project repository]]. | '''Note''': You can skip this step, and instead use the file <tt>firmware/firmware.hex</tt> from the [[HSC2011/Download instructions|project repository]]. | ||
Zeile 26: | Zeile 29: | ||
(if you flash on an arduino uno, replace "duemilanove328" with "uno"; you might need to adapt the device name as well). The installation routine will be different if you use another way of flashing than flashing an ATMega sitting inside an Arduino; consult your flasher's operating instructions in that case. | (if you flash on an arduino uno, replace "duemilanove328" with "uno"; you might need to adapt the device name as well). The installation routine will be different if you use another way of flashing than flashing an ATMega sitting inside an Arduino; consult your flasher's operating instructions in that case. | ||
− | + | When using ATMegas that don't originate from Arduinos, we nevertheless recommend [http://arduino.cc/en/Tutorial/ArduinoISP|to flash the Arduino firmware] there, including their fuse settings. | |
− | + | == Communication settings == | |
− | |||
− | + | The MAC address of the device and its configured base station are stored in the first 2x8 byte of the EEPROM memory. They can be configured from [[HSC2011/Software/Ygor|from Ygor]] or using the [[HSC2011/Communication/Serial protocol|M01-M05 commands]] on the serial console. | |
− | |||
− | + | [[Kategorie:HSC2011]] | |
− | + | [[Kategorie:English]] | |
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Aktuelle Version vom 4. Mai 2011, 01:26 Uhr
< HSC2011
The firmware is the part of the software flashed to the ATMega328 on the EduBuzzers. It capable of both serving as a buzzer and being a base station.
It is written in C (technically, C++, although hardly any C++ is used). It uses the avr-libc, JeeLabs' RF12 library and Paul Stoffregen's OneWire library. A fourth "external" dependency is EmbedVM, which is documented as our virtual machine as it was developed for this project.
Compiling and flashing
Note: You can skip this step, and instead use the file firmware/firmware.hex from the project repository.
In order to compile the firmware, you'll need
- the AVR libc tool chain (avr-gcc, avr/eeprom.h etc.),
- the Arduino libraries (WProgram.h),
- EmbedVM (/usr/local/share/embedvm/embedvm.[hc]), and
- arduino-cc (a build script).
You don't need to explicitly install the other libraries, as they are chcked into our repository.
Once you installed the required programs, build the firmware from
$ ./build.sh
and install it using
$ arduino-cc -P /dev/ttyUSB0 -B duemilanove328 firmware.cc hardware.cc RF12.cpp OneWire.cpp embedvm.c firmware_vm.cc firmware_evt.cc firmware_ser.cc firmware_net.cc
(if you flash on an arduino uno, replace "duemilanove328" with "uno"; you might need to adapt the device name as well). The installation routine will be different if you use another way of flashing than flashing an ATMega sitting inside an Arduino; consult your flasher's operating instructions in that case.
When using ATMegas that don't originate from Arduinos, we nevertheless recommend flash the Arduino firmware there, including their fuse settings.
Communication settings
The MAC address of the device and its configured base station are stored in the first 2x8 byte of the EEPROM memory. They can be configured from from Ygor or using the M01-M05 commands on the serial console.