HSC2011/Software/Firmware: Unterschied zwischen den Versionen

aus Metalab Wiki, dem offenen Zentrum für meta-disziplinäre Magier und technisch-kreative Enthusiasten.
Zur Navigation springenZur Suche springen
K (+kat)
K (fixed link to vm)
Zeile 4: Zeile 4:
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/Virtual machine|our virtual machine]] as it was developed for this project.
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 ==

Version vom 2. Mai 2011, 19:06 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

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

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.

TODO documentation

  • eeprom (mac addresses)
  • fuse settings

TODO

Open issues are, in descending priority:

  • separate timeout arrays for login and event
  • redirect messages for controlling the base station itself
  • fine-tuning timing for re-sends and responses (may only need validation)
  • melody api
  • reading battery status using new firmware
  • reading RSSI state
  • multicasts
  • removing arduino specific stuff to reduce resource usage (not a priority unless resources become a real problem)