The STK502 board is a top module designed to add ATmega169 support to the STK500
development board from Atmel Corporation.
STK502 includes connectors and hardware allowing full utilization of the new features of
the ATmega169. The Zero Inserti on Force (ZIF) so cket makes it e asy to use of TQFP
packages for prototyping.
This user guide is a general getting started guide as well as a complete technical reference for advanced users.
The STK502 board also includes a demonstration application, and comes with two
application notes, “AVR064: STK502 – A Temperature Monitoring System with LCD
Output” and “AVR065: LCD Driver for the STK502”. These application notes explain
how to use the different mo dules in the device. Included in the kit is a pre- programme d
ATmega169. Insert the device in the ZIF socket and the demonstration application will
start immediately.
Figure 1-1. STK502 Top Module for STK500
STK502 User Guide1-1
Rev. 2528A–AVR–11/02
Introduction
1.1Features Supports the ATmega169 with Built-in LCD Controller.
LCD-on-glass Display for Demonstrating the ATmega169 LCD Contro ller.
Supported by AVR Studio
Zero Insertion Force Socket for TQFP Packages.
High Voltage Parallel Programming.
Serial Programming.
TQFP Footprint for Emulator Adapters.
Port Extension Connectors for Port E, F, and G.
LCD Display Header for Using an External LCD Display.
LCD and Other Peripherals Can be Disconnected from the Device.
JTAG Connector for On-chip Debugging Using JTAG ICE.
On-board 32 kHz Crystal for Easy Real Time Clock Implementations.
Temperature Sensor for the Demo Application.
Quick Reference to all Switches and Jumpers in the Silk-Screen of the PC B.
®
4.
Pre-programmed ATmega169 with Demonstration Application. Includes C-code
Examples for all Major Peripherals on the ATmega169 Device.
– The Way to Get Going with your ATmega169
1-2STK502 User Guide
2528A–AVR–11/02
Section 2
Using the STK502 Top Module
This section describes in detail how the STK502 is used with the STK500.
2.1Connecting the
STK502 to the
STK500 Starter
Kit
2.1.1Placing an
ATmega169 on
STK502
Connect STK502 to the STK500 expansion header 0 and 1. It is important that the top
module is connected in the correct orientation as shown in Figure 2-1. EXPAND0 written
on the STK502 top module should match EXPAND0 written beside the expansion
header on the STK500 board.
Figure 2-1. Connecting STK502 to the STK500 Board
Note:Connecting STK502 with wrong orientation may damage the board.
STK502 contains both a ZIF socket, and a footprint for a TQFP package which allows an
easy way of soldering an emulator adapter directly into the STK502. Care should be
taken so that the device (or adapter) is mounted with th e correct orientati on. Figure 2-2
shows the location of pin1 for the ZIF socket and the TQFP footprint.
STK502 User Guide2-1
Rev. 2528A–AVR–11/02
Using the STK502 Top Module
Figure 2-2. Pin1 on ZIF Socket and TQFP Footprint
Caution: Do not mount an ATmega169 on the STK502 at the same time as an AVR is
mounted on the STK500 board. Neither of the devices will work as intended.
2.2PORT
Connectors
ATmega169 have additional ports to those available on the STK500. The ports are
located on the STK502 board. They have the same pin out and functionality as the ports
on the STK500 board. Port A to Port D are already pr esent on th e STK500 board . They
are not duplicated on the STK502.
2.2.1PORT E/PORT FFigure 2-3 shows the pin out fo r the I/O port headers Port E and Port F.
Figure 2-3. General I/O Ports
1 21 2
PE0
PE2
PE4
PE6
GND
PE1
PE3
PE5
PE7
VTG
PORTE
PF0
PF2
PF4
PF6
GND
PF1
PF3
PF5
PF7
VTG
PORTF
Note:Port E is also present on the STK500, but only PE0 to PE2 (three least signifi-
cant bits) are accessible there. To access all Port E bits the connector on the
STK502 must be used.
2.2.2PORT G/RST
In addition to the normal Port G pins, this connector has the RESET-signal. Se Figure 2-
4.
2-2STK502 User Guide
2528A–AVR–11/02
Using the STK502 Top Module
Figure 2-4. PORTG/RST
1 2
PG0
PG2
PG4
NC
GND
PORTG/RST
PG1
PG3
PG5
RST
VTG
2.2.2.1PG0 - PG5These are general I/O ports connected to ZIF socket and the TQFP footprint.
2.2.2.2RST
On the ATmega169 the RESET-signal and PG5 share the same pin. The “RST” is the
RESET
-signal that comes from the STK500 board. Please note that it is not directly connected to the ZIF socket or the TQFP footprint on the STK502. This because the
RESET
-signal on the STK500 has an pull-up resistor to VCCT which will interfere with
PG5 when used as an ordinary I/O-pin.
If RESET
the PORTG /RST
/PG5-pin on ATmega169 shall be used as a Reset pin, the RST and PG5 on
must be connected with a jumper. See Figure 2-5.
If the pin shall be used as an I/O-pin the jumper must be removed.
Figure 2-5. The RESET
Signal on PORTG/RST
STK502 User Guide2-3
2528A–AVR–11/02
Using the STK502 Top Module
2.3Programming the
ATmega169
2.3.1In-System
Programming
The ATmega169 can be programmed using both SPI and High-voltage Parallel Programming. This section will explain how to connect the programming cables to
successfully use one of these two modes. The AVR Studio STK500 software is used in
the same way as for other AVR parts as described in the STK500 User Guide.
Note:The ATmega169 also support Self Programming, See AVR109 application note
for more information on this topic.
Note:The jumper for the Reset-signal on PORTG/RST
must be mounted before an y
programming can take place. See Section 2.2.2.2
Figure 2-6. In-System Programming
To program the ATmega169 using ISP Programming mode, connect the 6-wire cable
between the ISP6PIN connector on the STK50 0 board and the I SP connector on the
STK502 board as shown in Figure 2-6. The device can be prog rammed using the Serial
Programming mode in the AVR Studio4 STK500 software.
Note:See STK500 User Guide for information on how to use the STK500 front-end
software for ISP Programming.
2-4STK502 User Guide
2528A–AVR–11/02
Using the STK502 Top Module
2.3.2High-voltage
Programming
Figure 2-7. High-voltage (Parallel) Programming
To program the ATmega169 using High-v oltage (Parallel) Programm ing, connect the
PROGCTRL to PORTD and PROGDATA to PORTB on the STK500 as shown in Fig ure
2-7. Make sure that the TOSC-switch is place d in the XTAL position. See Sec tion 2.6,
“TOSC Switch”.
As described in the STK500 User Guide (jumper settings), mount the BSEL2 jumper in
order to High-voltage Program the ATmega device s. This setting also applies to Highvoltage Programming of the ATmega169.
The device can now be programmed using the High-voltage Programming mode in AVR
Studio STK500 software.
Note:See the STK500 User Guide for information on how to use the STK500 front-
end software in High-voltage Programming mode.
Note:For the High-voltage Program ming mode to f unction correctly, t he target volt age
must be higher than 4.5V.
Caution: Make sure to disconnect LCD-disp lay from the se gment pins head er. Otherwise the lifetime of the LCD display may be severely reduced. See Figure 2-10.
STK502 User Guide2-5
2528A–AVR–11/02
Using the STK502 Top Module
D
D
2.4JTAG ConnectorFigure 2-8 s hows how to connect the JTAG ICE probe on the STK502 board.
Figure 2-8. Connecting JTAG ICE to the STK502
The JTAG connector is used for the ATmega 169 built-in J TAG interface. The pin out of
the connector is shown in Figure 2 -9 and is complian t with th e pin out of the JTA G ICE
available from Atmel. Connecting a JTAG ICE to this connector allows On-chip Debugging of the ATmega169.
More information about the JTAG ICE and On-chip Deb ugg ing can be found in the AVR
JTAG ICE User Guide, which is avai lable at the Atmel web site, www.atmel.com.
Figure 2-9. JTAG Connector
TCK
TDO
TMS
VTG
TDI
1 2
GN
VTG
RST
NC
GN
JTAG
2-6STK502 User Guide
2528A–AVR–11/02
Using the STK502 Top Module
2.5LCD DisplaySTK502 includes a LCD display. It features six 14-segments digits, and some additional
segments. All in all the display supports 120 segments. The display is designed for 3V
operating voltage. See the Technical Specifications for more details on the display.
2.5.1Connecting the
STK502 LCD to the
ATmega169
The segment-pins from the ATmega169 are located at PORTA, PORTC, PORTD, and
PORTG. For simplicity in use they are all joined together on the header labeled “Segment pins from ATmega169”. Th e header ne xt to it, la belled “STK 502 LCD pins” ho lds
all the segments-pins for the LCD-display on the STK502.
By using the 34-lead cable that come s with t he STK5 02-kit, the two pin-he aders can b e
connected, allowing the ATmega169 to control the LCD-display. See Figure 2-10.
Figure 2-10. Connecting the ATmega169 to the STK502 LCD
Caution: High-voltage Programming uses PORTB and PORTD. Be sure to disconnect
any LCD-display connected to the ATm ega169 during th e High-voltage Progra mming.
Otherwise the lifetim e of the display may be reduced.
Caution: When using PORTA, PORTC, PORTD, or PORTG as regular I/O ports, the
corresponding LCD-segment pins must be disconnected from the ATmega169.
2.5.2Default Segment
Configuration
ATmega169 supports 100 segments. Th us not all of the 1 20 segme nts on the LCD-di splay can be shown simultaneously. Five of the 30 se gment-pins on the LCD display has
to be left unconnected. The LCD-pins that are not connected are pin #: 3, 24, 30, 31,
and 32. See Technical Specifications for an overview of the excluded segments.
In order to use some of the segments on the LCD display that by default are not
included or in order to use some of the segment pins as ordinary I/O-pins, use a custom
strap between the two 34-pin headers. These to headers are lined up so they will fit in to
a 2.54 mm pitch grid for easy connecting, e.g., a experiment board on top of them.
The pin out for these two head ers (Figure 2-11) ca n be found on the bottom-s ide of th e
STK502-PCB or in Section 6 “Complete Schematics”.
This hardware configuratio n will give a certain bit-mapping between t he bits in the
ATmega169 LCDDRx Register and the segments on the STK502 LCD. See Section 4.1
“STK502 LCD Bit Mappings”
2.5.3Using Both Colons
on the Display
With the header J300 labelled “19 24” one can connect LCD-pin 24 (which is default
unconnected) to LCD-pin 19 by the use of a jumper. See Figure 2-12. The reason for
doing so is that the LCD-pin 24 has the segment “COL1” and LCD-pin 19 has “COL2”. In
applications where a clock, date etc. shall be displayed, it can be useful to control both
colons on the LCD-display. But connecting these LCD-pins will also lead to a connection
between segment (see Technical Specifications) “S5” and “3”, “S8” and “S7”, “8” and
“7”, which will in practice make them useless. See Figure 2-13 showing which segments are available on the LCD-display with the default segment configuration.
2-8STK502 User Guide
2528A–AVR–11/02
Using the STK502 Top Module
Figure 2-12. Jumper to connect COL1 to COL2
Figure 2-13. Default LCD-segment configuration, with and without the jumper shown in
Figure 2-12
Other LCD-displays can be connected to the ATmega169, either through the header
“Segment pins from ATm ega169” where all the se gment pins are gather ed or throug h
the ordinary Port-connectors PORTA, PORTC, PORTD, and PORTG.
Note:Make sure the display is compatible with the electrical characteristics on the
ATmega169.
For more information on how to write software for the LCD-display see application note
“AVR064: STK502 – A Temperature Monitoring System with LCD Output” and application note “AVR065: LCD Driver for the STK502 LCD”.
Note:The LCD-display on the STK502 ca n be ordered se parately fro m ACTE Norway
On the ATmega169 the TOSC1 and TOSC2 lines are shared with XTAL1 and XT AL2.
The TOSC switch selects whether the 32 kHz crystal on the STK502, or the XT1/XT2
signals from STK500 should be connected to these pins on the device.
Figure 2-15 shows a simplified block schematic on how this is implemented.
Figure 2-15. TOSC Block Schematic
32 kHz
AVR
XTAL1/TOSC1
XTAL2/TOSC2
TOSC
Switch
XT1
XT2
To
STK500
2-10STK502 User Guide
2528A–AVR–11/02
2.7SensorFigure 2-16. NTC-thermistor
STK502 includes a two screw-terminal block where a sensor can be connected. The
STK502 kit is shipped with a NTC-thermistor attached to this screw-terminal. A NTCthermistor is characterised by the fact that when the temperature goes down the resistance goes up. Using a voltage divider and reading the voltage over the thermistor
through the ADC-channels on ATmega169, the temperature can be calculated. Application note “AVR064: STK502 – A Temperature Monitoring System with LCD Output”
describes the details of the application.
Using the STK502 Top Module
2.7.1Sensor SwitchesTwo switches on the STK502 are used to connect the sensor to the ADC-c hannels on
the ATmega169 as shown in Figure 2-17.
Figure 2-17. Temperature sensor switch es
STK502 User Guide2-11
2528A–AVR–11/02
Using the STK502 Top Module
2.7.1.1AREF SwitchThe switch named AREF selects the input to the AREF-pin on the ATmega169.
Figure 2-18. AREF Switch
AVR
From
STK500
STK502
STK502
AREF
VREF
Voltage refernc e
for the sensor
AREF
Switch
AREF
Positions:
AREF: In this position the AREF from the STK500 is connected to the AREF pin on
the ATmega169. This is the default position.
VREF: In this position the VREF from the 1.263V voltage reference on the STK502 is
connected to the AREF pin on the ATmega169. Select this position in order to run the
code in Application Note “AVR064: STK502 – A Temp erature Monit oring System with
LCD Output”
2.7.1.2PF[1:0] SwitchThe PF[1:0] switch selects the input to the PF1 and PF0 pins (ADC channel 1/0) on the
ATmega169.
Figure 2-19. PF[1:0] Switch
AVR
Sensor
pin 1
Sensor
pin 2
PORTF0
PORTF1
PF[1:0]
Switch
PF0 (ADC0)
PF1 (ADC1)
Positions:
PIN: In this position the PF0 and PF1 are from the PORTF on the STK502 are
connected to the PF0 and PF1 on the ATmega169. Default position.
Sensor: In this position the pin 1 from the screw-terminal on the STK502 are
connected to PF0 on the ATmega169, and the pin 2 from the screw-terminal are
connected to PF1 on the ATmega169. Select this position in order to run the code in
Application Note “AVR064: STK502 – A Te mperature Monitoring System with LCD
output”
In the sensor position both PF0 and PF1 are conne cted t o the s enor p ins, re gardles s of
using single ended or differential ADC-me asurements in the appl ication. This means
that it's not possible to use PF1 as an ordinary I/O-port even though only PF0 (single
ended) is used with the ADC.
2-12STK502 User Guide
2528A–AVR–11/02
Troubleshooting Guide
Table 3-1. Troubleshooting Guide
ProblemReasonSolution
The LCD is not connected.Attach the 34-pins cable between
the to 34-pins headers on the
STK502.
Nothing is displayed on
the LCD.
The LCD is not enabled in
the AVR device.
Check the LCD initialisation
Section 3
(1)
.
Some segments on the
LCD seems to be stuck
at high/low.
Can’t control
PORTF[1:0]
Serial Programming
does not work
The update frequency is
not correct.
The PORTA/C/D and/or G
are connected to
something else than the
LCD display.
PF[1:0] is not connected to
the ATmega169.
ISP cable not connected.Connect the ISP ca ble according to
STK500 target voltage
error.
The RSTDISBL Fuse is
programmed.
Verify that the clock presc aling
correspond with the clock source
Check that nothing is connected to
these PORTS on the STK500 and
STK502.
Set the PF[1:0] switch in the PIN-
position.
Figure 2-6.
Please refer to the ATmega169
datasheet for the Serial
Programming Voltage limits. Adjust
the target voltage on the STK500
board accordingly.
Use Parallel Programming to
unprogram the RSTDISBL Fuse.
(1)
.
STK502 User Guide3-1
Rev. 2528A–AVR–11/02
Troubleshooting Guide
Table 3-1. Troubleshooting Guide
ProblemReasonSolution
Parallel Programming
does not work.
Cables not connected
properly.
STK500 target voltage
error.
Please refer to Figure 2-7 for
correct Parallel Programming setup.
Please refer to the ATmega169 data
sheet for the Parallel Programming
Voltage limits. Adjust the target
voltage on the STK500 board
accordingly.
No programming works.
The TOSC switch is not
correctly set.
The RESET
-signal is not
connected to the
Set the TOSC switch in the XTAL-
position.
Connect PG5 and RST with a
jumper. See Section 2.2.2.2 RST
.
ATmega169.
Note:1. See the application note “AVR065: LCD Driver for the STK502 LCD” on how to con-
trol the LCD-display or the the ap plication note “AVR064 : STK502 – A Temperatur e
Monitoring System with LC D Output”.
The LCD Data Registers (LCDDRx) in the ATmega169 are organized in groups according to the use of Backplane Control Lines (also know n as Common Line s). The LCD on
the STK502 uses all four Common Lines and all 25 segments, in total 4 x 25 = 100 segments. As can be seen in the LCD data sheet (Figure 4-1) describing the internal
connection of pins, Common Lines and segments, the alphanumeric digits are referred
to with a number according to where they are located on the LCD. Listed below is a
description of the STK502 bit mappings according to this.
The bit mappings for the alphanumeric digit number two are listed below.
Table 4-1. Bit Mappings for LCD Alphanumeric Digit Number Two
For Technical support, plea se conta ct avr@at mel.co m. When re questin g technic al support, please include the following information:
Which target AVR device is used (complete part number).
Target voltage and speed.
Clock source and fuse setting of the AVR.
Programming method (ISP or High-voltage).
Hardware revisions of the AVR tools, found on the PCB.
Version number of AVR Studio. This can be found in the AVR Studio help menu.
PC operating system and version/bu ild .
PC processor type and speed.
A detailed description of the problem.
STK502 User Guide5-1
Rev. 2528A–AVR–11/02
Technical Support
5-2STK502 User Guide
2528A–AVR–11/02
Section 6
Complete Schematics
On the following pages the complete schematics and assembly drawing of the STK502
revision B are shown.
Atmel Corporation makes no warranty for the use of its products, other than those expressly contained in the Company’s standard warranty
which is detailed in Atmel’s Terms and Conditions located on the Company’s web site. The Company assumes no responsibility for any errors
which may appear in this document, reserves the right to change devices or specifications detailed herein at any time without notice, and does
not make any commitment to update the information contained herein. No licenses to patents or other intellectual property of Atmel are granted
by the Company in connection with the sale of Atmel products, expressly or by implication. Atmel’s products are not authorized for use as critical
components in life support devices or systems.
ATMEL®, AVR®, and AVR Studio® are the registered trademarks of Atmel Corporation.
®
Microsoft
Other terms and product names may be the trademarks of others.
, Windows®, and Windows NT® are the registered trademarks of Microsoft Corporation.
Printed on recycled paper.
2528A–AVR–11/02
/0M
Loading...
+ hidden pages
You need points to download manuals.
1 point = 1 manual.
You can buy points or you can get point for every manual you upload.