Specifications

2
AVR064
2529A–AVR–11/02
Application Overview This application note describes how to get started with the ATmega169 microcontroller
(MCU), the first AVR that has a built in LCD controller/driver. This application is a tem-
perature control application, including a Real Time Clock. It will monitor the temperature
through a sensor, and regulate the temperature if a heating/cooling unit is attached.
Figure 1. Application Overview
The LCD starts with scrolling the text: “STK502 example application for ATmega169”. It
is required that the example code is programmed into the ATmega169 and the hardware
is set up according to the section “Hardware Configuration” on page 6.
Select a desired temperature set point. When the temperature goes below this set point
value, the Heater I/O pin will go high, and a LED on STK500 will flash. When the tem-
perature goes above the set point value, the Cooler I/O pin will go high, and another
LED on the STK500 will flash. The duty cycle of the LED flashing will vary with the actual
temperature deviation from the set point (the greater the deviation is, the brighter the
LEDs will shine) The LCD will display time and temperature information. All data that is
presented on the LCD will also be sent through the UART-interface and can be received
by etc a standard terminal.
Pressing a button on the STK500 will toggle the different information on the LCD. This
information is:
CLOCK: RTC running on the ATmega169
DATE: Calculated from the RTC
SET POINT: Selected temperature
TEMPERATURE: Measured temperature
OFFSET: Difference between the measured temperature and the set point
CONTRAST: Shows all the segments available with the default hardware strapping.
Adjusting the CLOCK, DATE, SET POINT, or the CONTRAST can be done by using
three of the SWITCHES on the STK500. Since these switches are used for different
functions, there is a need for a menu system. See Figure 2 for an overview of how the
menus are arranged in this application.
ATmega169
L
C
D
U
A
R
T
ADC
I/O
STK500
SWITCHES
Heating/
Cooling
Unit
STK500
LEDS
NTC
Thermistor
Timer2
32 kHz