Datasheet
4.1 The next few steps
From here on, it’s all a matter of:
• Chosing a microcontroller for the implementation.
• Chosing a compiler/IDE and other programming tools for the implementation.
• Programming the microcontroller.
• Wiring the microcontroller to the console.
4.2 Selecting a microcontroller
There is a huge variety of microcontrollers available, many of which can be used to
reply to the commands from the Davis console. Of the more interesting ones are the PIC
family from Microchip and the AVR series from Atmel. While the everlasting AVR vs.
PIC discussion is better left to others, it´s worth noting that:
• Davis makes use of the AVR family of RISC MCUs — the ATmega128L is the
”brain” of the VP2 consoles as well as other Davis consoles.
• There are plenty of reasonably-priced programming devices and compilers avail-
able for the AVR family, including Arduino-based programmers.
The fact that an STK500 programmer [6] was already within reach and that knowl-
edge of the AVR platform was already established made it attractive to opt for the AVR
family of MCUs.
Picking the actual MCU requires studies of the units available. While there are
MCUs which come with dedicated SPI pins, such as the ATmega8, these units carry the
drawbacks of a less attractive form factor, they draw more power and have a higher
unit cost than what is really necessary.
MCU
name
Farnell.no
part #
Newark.com
part #
Product
ID
Flash
memory
Unit price
(USD)
ATmega8 9171380 68T3197 ATMEGA8-16PU 8 kB 3.66
ATtiny25 N/A 68T3598 ATTINY25-20PU 2 kB 1.06
ATtiny45 1288352 68T3729 ATTINY45-20PU 4 kB 0.95
ATtiny85 1455162 68T3808 ATTINY85-20PU 8 kB 1.29
Table 3: A selection of relevant AVR microcontrollers. Quoted prices as of July, 2013.
The ATtiny45 [8] is reasonably priced and has plenty of memory for the task at
hand. It comes with an Atmel-specific Universal Serial Interface (USI), which has to be
configured for SPI operation. Atmel application note AVR319 [4] refers.
Both the 10 MHz (denoted ”-10PU” in the product ID) and the 20 MHz (”-20PU”)
versions of the ATtiny25/45/85 have been tested in this project.
http://meteo.annoyingdesigns.com 17