0% found this document useful (0 votes)
13 views5 pages

AVR-RISC Evaluation System (1) : Experiment With Atmel's Latest RISC Processors

This document discusses an evaluation system for Atmel's AVR RISC processors. Specifically, it provides details on building a simple circuit using the AT90S1200 processor that allows programming and testing the chip without needing additional hardware. Software utilities for assembly, simulation, and downloading programs to the chip are available free from Atmel's website, making the system a low-cost way to learn about and experiment with these new processors.

Uploaded by

Sanedrac Ac
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views5 pages

AVR-RISC Evaluation System (1) : Experiment With Atmel's Latest RISC Processors

This document discusses an evaluation system for Atmel's AVR RISC processors. Specifically, it provides details on building a simple circuit using the AT90S1200 processor that allows programming and testing the chip without needing additional hardware. Software utilities for assembly, simulation, and downloading programs to the chip are available free from Atmel's website, making the system a low-cost way to learn about and experiment with these new processors.

Uploaded by

Sanedrac Ac
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Atmel’s AT90S1200 AVR-RISC 8-bit RISC processor has been available for some

time now, and is generally recognised as a very fast device. The price, too, is
good at less than £3 even in the hobby market. So, substituting a couple of logic
ICs (and their sockets) by an AVR device may already pay off. The most interesting
aspect of this processor is, however, that it features a serial interface with direct
access to the on-chip memory. The general concept of the AVR processor was
already discussed in our January 1998 magazine. The present article aims at
showing some more practical applications of the 90S1200, using easy to obtain
hardware and software.

Design by Dr. M. Ohsmannn

AVR-RISC evaluation
system (1)
experiment with Atmel’s latest
RISC processors

To give its new AVR processor family a instance, a complete assembler (for downloading. So, if you want to famil-
head start, Atmel has made quite a few DOS as well as Windows) and a simula- iarise yourself with these new processors
software utilities available free of tor. The relevant datasheets and soft- without committing yourself to hard-
charge on their web site. There is, for ware documentation are also free for ware for the time being, our advice is

6 - 10/98 Elektor Electronics EXTRA ——————————————— PC TOPICS


ZIF (zero-insertion force) socket. That’s it!
Because of the simplicity of the circuit,
it may even be built on a piece of ver-
oboard or general-purpose stripboard.
IC2c
A more elegant solution is, however, to
R3
1k
6
1
5 use the PCB shown in Fig u re 2.
R4
5k6
5V
2
1
1
R1
10k
4
1
3
R5
10k
Serial download utility
K1 5V R2
IC2a IC2b To enable programs generated by the

100k
1 8
OE Vdd. C7 S1 PROG/RUN
C5 IC1
1 NC NC 24 Atmel Assembler to be loaded into the
2 NC NC 23
SG531P
100n 12.0000MHz 3 /RESET Vcc 22
100n
IC2d K2
processor, you need special download
JP2 R9
4
GND OUT
5 4 PD0
PD1
(SCK)PB7
(MISO)PB6
21 PB7 PB6 9
1
8
1k 1 software. Because the author was
5 20 PB6
6 XTAL2 (MOSI)PB5 19 PB5
IC2e
6
unable to find a suitable program on
2
XTAL1 PB4

X1
7
8 PD2(INT0) PB3
18 PB4
17 PB3
PB5
JP3 R8
1k
10
1
11
R10
10k
7 the Atmel web site, he came up with his
9 PD3 PB2 16 PB2
3
8
own solution. The resulting program and
10 PD4(TO) (AIN1)PB1 15 PB1 IC2f
C2 12MHz C1
R24 11 PD5 (AIN0)PB0 14 PB0 PB7
JP1 R7
12 13
R11 4 its source code file (written in Pascal) is
1k 1 10k 9
GND PD6 available on a disk with order code
1k

22p 22p 12 13
5
R6 R13 R12
986020-1. This disk, and the software
100k

100k

100k
T
ISP/
RS232
picked from the Atmel web site then
5V
forms a complete package, and you
R14

14
PB4
20k are ready to get started.
C6 1% R15

10k
IC2 K3
IC2 = 74HC14 100n R16 1%
7 1 PB3
20k
2
1% R17
Example programs
10k

3 PB0
R18 1% DAC
K4 5V 4 PB1 PB2
9...15V D1 7805 5 PB2
20k
R19
A good way to learn about micro-
1%
10k

IC3
R25
6 PB3
R20 1%
processor programming is to test fully
1N4001 7 PB4 PB1
functional programs, and then modify
1k

20k
8 PB5 R21
1%
10k

C3 C4 9 PB6
R22 1%
and extend them. In case of newly
10 PB7 PB0
100µ
25V
10µ
10V
D2 20k
1% R23 released processors, the decisive fac-
20k

FC10HB
1%
tor is often whether or not a supply of
5V
980082-11 ready-made ‘modules’ is available.
PB0 PB1 PB2 PB3 PB4
Such modules may relieve you from the
burden of writing, say, your own char-
acter input/output routines, to mention
but one example. The project disk con-
tains a fair number of such modules
(see T a b l e 1 ), which should help to
unburden beginners, allowing them to
concentrate on more essential matters
Figure 1. Circuit diagram of the AVR evaluation system.
in the learning process. Unfortunately,
a full discussion of all modules on the
disk is beyond the scope of this article.
Those of you who are interested in the
to go to www.atmel.com, where you will shown in Figure 1. Actually, the circuit programming details are referred to the
find lots of interesting stuff, including consists of no more than a six-fold (hex) commented source code files on the
Schmitt trigger which translates the sig- disk, and to the file XAVR.DOC which
- an assembler for the Atmel AVR fam- nals at the serial PC-RS232 interface presents an overview of available pro-
ily; into levels that can be processed by grams, complete with concise descrip-
- a simulator for the AVR family; processor’s serial interface, which is nei- tions and application examples. In this
- example programs illustrating: ther RS232 compatible nor asynchro- article, we present just a few of the
simple arithmetic nous. Then there is a switch that many ideas that may be realized using
EEPROM use enables you to change from ‘‘software the AT90S1200. Our aim is to pick out
download’’ to ‘‘run program’, and a those applications in which speed is the
quartz crystal or crystal oscillator mod- decisive factor. After all, a fast beast
Evaluation system ule which generates the processor like the AVR-RISC processor is by no
Atmel also has available a demonstra- clock signal. If you foresee applications means required to switch a lamp on
tion board and the associated control requiring high accuracy (for example, and off every few seconds! You will not
software. Unlike the above mentioned frequency or time measurements), the find such applications in this article. By
software and documentation, this best choice is the oscillator module (fit- contrast, you will learn, for instance,
material is not free of charge. Because ted in a socket). In that case, only the how various clock signals may be
Elektor Electronics magazine constantly oscillator IC1 is mounted, while X1, C1 derived from a 10 MHz source. Such an
aims at addressing the active (i.e., sol- and C2 are simply omitted. With less application is surely too much to ask of
dering) electronics enthusiast, we critical applications, a simple crystal is, an 8051, while the AT90S120 can man-
started to develop our own experi- of course, the more economical age!
menting system for the AVR-RISC option. If you intend to program lots of
processors. The circuit diagram is processors, then it is advisable to use a

PC TOPICS ——————————————— Elektor Electronics Extra 7 - 10/98


C5
H2
H4

C1
C2
T
T

R24

IC1

X1

980082-1
R3
R4

C7
K1
T
B4 B3 B2 B1 B0

1-280089
ROTKELE )C(
980082-1
(C) ELEKTOR

S1

RUN
JP1

JP2
JP3
K3

R7
R8

PROG
R23 R2

C4
R22 R1

D2
R21
R20

IC2
R19

R25
R18

IC3
R17

C6
R16
R15
R14

R10
R11
R12
R13
R6
R5
R9

C3
DAC
T

D1
K4

H3
H1

Figure 2. Single-sided printed circuit board (available ready-made). K2

One instruction every 66ns: AT90S1200: a quick input/output ports (Port B and Port D) of
applications overview which each pin is individually address-
Tne AT90S1200 may be operated at a Mainly because of its RISC architecture, able as an input or an output. Program
clock frequency of up to 16 MHz. the structure of the AT90S1200 proces- execution runs under the control of the
Because most instructions are executed sor remains wonderfully simple. F i g- central clock frequency which may be
within a single clock pulse, it is possible u r e 3 provides and overview. The sec- any value between 0 and 16 MHz. In
to execute instructions at a rate of tion we are particularly interested in is addition, there is an interrupt control
16 million per second. So, if you want a an array of 30 8-bit registers that may system and a small 8-bit timer/counter.
certain routine to be executed one mil- be used to perform calculations and The complete description of the
lion times in one second, the relevant store results. Then there are two AT90S1200 covers about 50 pages,
program section may have a length of
10 to 16 instructions. Using this number
of instructions quite a lot can be done.
Of course, at the hardware level only,
who can imagine a Windows program
with a length of just a few tens of bytes? Table A
A really fast processor may often be
used when economising on the num- ; semicolon used as comment delimiter
ber of digital ICs while the speed is not
.def sum=20 ; use .def to assign symbolic names to registers
so high as to necessitate the use of mov r2,r3 ;copy contents of register R3 to R2
expensive programmable logic. The ldi r17,r123 ;load register r17 with 123
great thing about such a microcon- add r20,r21 ; register r20 becomes sum r20+r21
troller is that you have access to an adc r20,r21 ; register r20 becomes sum r20+r21+carry
army of registers, and to an accumu- sbi PORTB,2 ; set port B line 2
lator capable of doing sums! Those of clr r27 ; clear r20 to 0
brne loop ; jump to loop when not zero
you who have ever attempted to make sbrs r20,2 ; skip if bit in register set
programmable logic do simple calcu- ; skip next instruction when bit 2 of r20 is set
lations will appreciate this facility.

8 - 10/98 Elektor Electronics EXTRA ——————————————— PC TOPICS


and interested readers are strongly
advised to obtain it from the Internet or
the local Atmel distributor. For now, a
few programming examples to get
used to the AVR controller:

Simple digital word


generator
Because the AT90S1200 is capable of
working at any clock frequency
between 0 Hz (static operation) and
16 MHz, it is perfect for use as a gener-
ator for complex signal patterns, all
based on just one central clock fre-
quency. Normally, such a generator is
built using counter modules and
decoders, and the resulting circuit can
become quite complex because a lot
of additional components may be
needed to keep the effect of glitches
under control. At frequencies below
16 MHz is it, however, perfectly possible
to employ a RISC processor. For exam-
ple, the pulse pattern shown in F i g-
u r e 4 is created with the aid of the pro-

COMPONENTS LIST

Resistors:
R1,R5,R10,R11 =10kΩ
R2,R6,R12,R13 =100kΩ
R3,R7,R8,R9,R24,R25 =1kΩ
R4 = 5kΩ6
R14,R16,R18,R20,R22,R23 =20kΩ 1% Figure 3. Atmel AT90S1200 processor architecture.
R15,R17,R19,R21 = 10kΩ 1%

Capacitors:
C1,C2 = 22pF ceramic (see text) 17 18 19 20 21
C3 = 100µF 25V radial
C4 = 10 µF 10V radial 1 2 3 4 5 6 7 8 9 10
C5,C6,C7 = 100nF ceramic

Semiconductors:
D1 = 1N4001 B0
D2 = LED red high efficiency
IC1 = SG531P12.0000MHz EPSON
(Eurodis), see text
IC2 = 74HC14
IC3 = 7805
B1
Miscellaneous:
X1 = 12MHz see text
K1 = 24-way Aries 0.3-0.6inch (Farnell)
JP1,JP2,JP3 = 2-way jumper
S1 = slide switch, 1x changeover, PCB
mount
B2
K2 = 9-way SUB-D socket
K3 = 10-way boxheader (optional)
K4 = mains adapter socket, PCB mount 980082-13
PCB: order code 980082-1, see Readers
Services page.
Disk: order code 986020-1, see Readers Figure 4. Because of its speed, the Atmel controller is capable of generating complex
Services page. digital patterns at frequencies well over 10 MHz.

PC TOPICS ——————————————— Elektor Electronics Extra 9 - 10/98


PC programs 6 clock cycles, and then wait exactly
428376233 cycles for the game to
SER90 program download utility for evaluation board. Pascal source code
commence again. All you need for this
file included on disk.
function is a counter capable of keep-
V24C OM V24 serial communication program. Pascal source code file included ing track of the necessary number of
on disk. clock cycles. Four registers in the
processor, spanning a total width of
AVRASM.EXE AVR assembler (DOS version). Included by courtesy of Atmel UK. 32 bits, and a couple of addition
instructions are sufficient for this pur-
pose. No soldering is required when the
number of cycles has to be changed
AT90S1200 example programs for whatever reason. All you have to do
File Function
is change a few constants in the pro-
gram, and that’s it. This kind of flexibil-
XSEROUT1 output characters via RS232, 9600 bits/s ity is simply not available in traditional
wired logic, and very expensive in pro-
XHEXOUT1 output registers via RS232, hex format grammable logic (in particular, devel-
opment tools).
XHEXOUT2 output all 32 registers (dump) via RS232 The collection of example programs
XDECOUT1 output 24-bit values (0-16777215), decimal format, via RS232
found on the project diskette includes
a simple pattern generator that reads
XSERIN Input characters via RS232, 9600 bits/s its pattern information from the serial
interface (via XPATGEN2.EXE and XPAT-
XFMES1 frequency measurement up to 5 MHz, 1s gate, RS232 output, decimal, GEN2.PAT).
at 9600 bits/s (980082-1)

XTMES1 time measurement, 1 ms to 8 s, 0.5 ms resolution, RS232 output, 9600


bits/s
Next month’s second and final instal-
ment will continue with programming
XNCO1 numerically controlled oscillator, output 77.5 kHz using 12 MHz crystal examples including frequency dividers,
numerically controlled oscillators
XNCO2 numerically controlled sawtooth generator, programmable via RS232 (NCOs), time measurement and fre-
quency measurement.
XFRQDIV1 divide by N scaler, N programmable via RS232

XPATGEN1 simple 8-channel pattern generator

XPATGEN2 simple 8-channel pattern generator, patterns adjustable via RS232

XDIV625 divide by 625 scaler, non-overlapping pulses

Table 1. Contents of the project disk


Figure 5
(order code 986020-1).
; XPATGEN1.ASM
; simple pattern generator
gram listed in Figure 5
(XPATGEN1.ASM). The program is short .include “1200def.inc”
and its operation boils down to loading
registers r17 through r22 with the ldi r16,$0FF ; set output B to totem-pole
out DDRB,r16
desired signal combinations. Next, a
loop is used to output the values on ldi r17,0b0001 ; set patterns into registers
Port B at maximum speed. This program ldi r18,0b0010
may be modified in many ways. For ldi r19,0b0100
instance, by including delay loops you ldi r20,0b0110
ldi r21,0b0010
can create signals with very long peri- ldi r22,0b0000
ods, which are timed at crystal accu-
racy, or synchronous with the clock sig- LOOP: out PORTB,r17 ; output each register to PORT
nal. You should not find it too difficult to out PORTB,r18
out PORTB,r19
modify the program so that the signal
out PORTB,r20
shape does not change during the first out PORTB,r21
out PORTB,r22
nop ; two extra cycles
nop
Figure 5. This little program generates the rjmp LOOP ; this also takes 2 cycles
pulse sequence shown in Figure 4.

PC TOPICS ——————————————— Elektor Electronics Extra 11 - 10/98

You might also like