Architecture And System; Concepts - Libelium Waspmote Technical Manual

Hide thumbs Also See for Waspmote:
Table of Contents

Advertisement

Architecture and system

5. Architecture and system

5.1. Concepts

The Waspmote's architecture is based on the Atmel ATmega1281 microcontroller.
When Waspmote is connected and starts the bootloader, there is a waiting time (62.5 ms) before beginning the
first instruction, this time is used to start loading new compiled programs updates. If a new program is received
from the USB during this time, it will be loaded into the FLASH memory (128 kB) substituting already existing
programs. Otherwise, if a new program is not received, the last program stored in the memory will start running.
The structure of the codes is divided into 2 basic parts: setup and loop. Both parts of the code have sequential
behaviour, executing instructions in the set order.
The setup is the first part of the code, which is only run once when the code is initialized. In this part it is
recommended to include the initialization of the modules which are going to be used, as well as the part of the
code which is only important when Waspmote is started.
The part named loop runs continuously, forming an infinite loop. Because of the behavior of this part of the code,
the use of interruptions is recommended to perform actions with Waspmote.
A common programming technique to save energy would be based on blocking the program (either keeping the
micro awake or asleep in particular cases) until any of the interruptions available in Waspmote show that an event
has occurred. This way, when an interruption is detected the associated function, which was previously stored in
an interruption vector, is executed.
To be able to detect the capture of interruptions during the execution of the code, a series of flags have been created
and will be activated to indicate the event which has generated the interruption (see chapters "Interruptions" and
"Energy system").
Figure: Blocking loop, interruption appears and is dealt with
When Waspmote is reset or switched on, the code starts again from the setup function and then the loop function.
By default, variable values declared in the code and modified in execution will be lost when a reset occurs or there
is no battery. To store values permanently, it is necessary to use the microcontroller's EEPROM (4 kB) non-volatile
memory. EEPROM addresses from 0 to 1023 are used by Waspmote to save important data, so they must not be
over-written. Thus, the available storage addresses go from 1024 to 4095. Another option is to make use of the
SD card.
-64-
v8.2

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Waspmote and is the answer not in the manual?

Subscribe to Our Youtube Channel

Table of Contents