Вы находитесь на странице: 1из 35

AVR

"tiny"
ATtiny13, 15L, 2313,
25, 26, 28L, 45, 85
Atmega48, 8, 88, 8515,
"mega"
8535, 16, 162, 165,
168, 32, 325, 3250, 64,
645, 6450, 128
"LCD"
Atmega169, 329, 3290,
649, 6490

1-8 , 64-512
, DIP8-TQFP32
4-128 , 256-4096
, DIP28-TQFP64
16-64 , 1024-4096
, TQFP64-TQFP100

.1

SCK
Serial ClocK
MOSI
Master Out Slave In
MISO
Master In Slave Out
GND
GrouND
RES
RESet
VCC
Voltage Common Collector

2000 . 0,5
0,35 . tiny
mega. ,
, , ,
, .

.
2004 . , -,
LCD AVR. 2004 .
classic EOL
(End-Of-Life), .. 2005 . .
(.1), !
AVR
: tiny - 8 , classic - 40-44
, mega - 64 . , . DIP-,
, : 8, 20, 28, 40 .
. AVR-
FLASH- . , ATtiny15L (1
), ATtiny26 (2 ), AT90S4414 (4 ), ATmega8515 (8 ), ATmega162
(16 ), ATmega32 (32 ), ATmega 6450 (64 ), ATmega128 (128 ).
AVR
AVR- ISP (In-System Programming). ,

.
, .. ISP, (.1).
, ,
. , AT89C2051, .
6 (.2): , . SPI (Serial Programming Interface).
, : MISO , O (output). MOSI
( ).
, , , -

(). , .
, - . , MCS-51 ( 3-12/2004),
. - , , .
, 10
MCS-51. AVR
Atmel.
AVR? : , , . AVR
. , , 8- AT89C2051 Atmel.
AVR,
- . , 2030 . , .
, , , , , .
. MCS-51 AVR, , .
AVR
Atmel 1984 .
(, ). 90- MCS-51. Intel,
Philips, Temic, OKI, Siemens, Atmel ,
. -
- .
MCS-51 . , () , PIC-
Microchip Technologies, H8/300 Hitachi Dallas Semiconductor.
1996 ., 8- AVR.
AVR . 1995 . Atmel . . Atmel IAR Systems.
- Alf Bogen / Vergard Wollan / Risc architecture.
AVR: RISC-, FLASH- , , ,
. , , , . - - AVR- .
AVR
AVR 4 : classic, tiny, mega,
LCD. 1997 . Atmel
classic- AT90Sxxxx. 1999 . : classic (AT90S), tiny (ATtiny), mega
(ATmega). .

, ,
.

.. , .

AVR. 1





."0"
2,75,5
12005

35

36

MISO, MOSI SCK (.3).


MCS-51. AVR, SPI , DIP-40 .
1, XS1 (.1) 10-, -10 IDC-10F. , . .4
. Altera
ByteBlaster. STK200 (STK300)
Atmel AVR910 [1].
: AVR-
10- ISP, , .
- ByteBlaster ,
. . , (.2,, ). STK200 - . AVR910 (, IDC6 !). , 10- : ,
.

.
AVR910. ,
,
.

, [1].
AT90S1200, - , .
, , ,
. .
, ,
.
:
, ;
, (COM LPT);
.
, AVR, . , AVreal (http://www.ln.com.ua/~real/avreal), IC-Prog
(http://www.ic-prog.com), PonyProg (http://www.lancos.com), Willem
Eprom (http://www.willem.org). AVR-. ,
. -, , , :
?.
PonyProg ( Claudio Lanconelli,
). -, PonyProg -
. -,
9, 11/2004, mk9.zip, http://www.rapublish.sea.com.ua.
. LPT- , COM-, . .
COM- 58 , LPT - 1,52 . , LPT
. ,
AVR USB ( 50-100 .),
.
. , -
. - . ,
, - .

PonyProg http://www.lancos.com/siprogsch.html LPT- COM 12005

DIP-8
DIP-20
DIP-28
DIP-40 (1)
DIP-40 (2)

SPI
VCC
8
20
7
40
10

GND
4
10
8
20
11

RES
1
1
1
9
9

SCK
7
19
19
8
8

MOSI
5
17
17
6
6

IDC-10
1
2
3
4
5
6
7
8
9
10

Byte
Blaster
SCK
GND
MISO
VCC
RES
NC
NC
NC
MOSI
GND

.2

.3

.4

STK
200
MOSI
VCC
NC
GND
RES
GND
SCK
GND
MISO
GND

AVR
910
MISO
VCC
SCK
MOSI
RES
GND
NC
NC
NC
NC

MISO
6
18
18
7
7

.6

.5

. , . ,
.
.4 LPT-,
. : 5 1, R5, 19 DD1. .0 .1 PonyProg.
.0 4 XP1, HL1.
DD1, , , - . R1-R5, R8-R10 , .
R6 .1
DD1 LPT-.
SPI .
DD1 (VCC=5 ) . 1 .
10, 20 DD1.

. Kanda Systems STK200, STK300,
.
Kanda STK200/300.
.5 COM-.
: R1, R3-R5 ,
VD2-VD4 (4,7 ), R2 VT1 . VD1 ,
COM-. , BC547 (Philips),
VT1.

, , PonyProg.
COM- (.6) DD1,
SA1. :
DD1 ,
COM- 10 +10 . -

. , , .
LPT- (.3)
R1-R4,
. 2, 12 3, 11 XP1
.

37

.7
12005

XTAL1, XTAL2 .
COM- , .5. HL1 . HL2 5 , DA1. 1-3, 68 . VD1 . 1 , , , 1015 100 .
ISP, (XS8). - ISP . / , MISO, MOSI, SCK
.

, .
, AVR ( ).

SPI. , (.3-7),
AVR.
, , AVR. ChaN (http://elmchan.org/works/avrx/report_e.html, ) 20- (.8) 8- (.9) .

R1-R3
DD1.
5 (VCC) . 1 . R5-R9
. HL1
, . , DD1 . , .
. , ,
http://iron.fire.usi.ru, http://evm.wallst.ru/main/prog, http://www.ln.com.ua
/~real/avreal/adapters.html#STK.

AVR DIP-8, DIP-20, DIP28, DIP-40 (.7). MISO, MOSI, SCK,
RES, VCC, GND . , , XS2-XS7.
20- 40- DIP-20(1),
DIP-20(2), DIP-40(1), DIP-40(2), DATASHEET Atmel http://www.atmel.com.
ZQ1 4, 5 . , RC-, .
- ZQ1

38

.8
12005


DOS (http://elmchan.org/works/avrx/avrxtool.zip, 69 ) Win-9x/XP (http://elmchan.org/works/avrx/avrxtool32.zip, 91 ).
DIP-28, DIP-40 20- .

,
12 . , . , RESET . . ISP ,
RESET . .
, ,
, . , PonyProg , .
, - ,
, .

, 2030 10- ISP 1,52- . ,
-0,1. .
LPT- COM. , .
9- 25- COM-, , .5, 6, , : 3-2,
4-20, 5-7, 6-6, 7-4, 8-5 (DB9-DB25).
, , , - . HC,
74HC245 5556 (.4). VCC 2 XS1.
- 3 , LPT-

5 .
15336, 15546

GND .

(.7), , XS2XS6 ,
.
(.8) DC.10
DC U3 NMJ2352D
12 , 50 . , - 3. L1, D1, U3, 2, R1-R3
. 74HC299 - 155424. RN1202, RN2202, RN2205 3102, 3107, .
.8, 9.
IDC-10F - , . , . ,
.
10- 6, -6, -6. , , .
: (.10). , , .
. AVR- ,
.3-6, ,
PonyProg. .

1. AVR910: In-System Programming. - Atmel, 2000, http://sinbad.narod.ru/isp.htm ( ).


12005

.9

39

2,
.

2. 2
IAR Systems. ,
902
AVR.
ICCAVR Code2
Vision. , 2
. 22
2
. 2
2 , 2
. 2 2
: AVR,
: , , 2
2 CodeVision AVR.
, 2 2
?
2, . 2
freeware22
, WinAVR. 2,
, 2,
, 2
, , ,
.
,
. 2
.

.
, , . 2
, freeware2 2
.
2
CD. 2 2
, 2
.
2
: , 2 .
Freeware ( FREE softWARE)

. 2
,
.
Shareware ( SHARE softWARE) 2
. 2
.
. ,

( 1/2005) 

() AVR.
,
.
, 2
,
. , 2

. , ,
, 2
. 2
, 2
.
2
Starter Kit,
,
, , 2
, , . 2

.
Atmel AVR 2
: STK2100, STK2200, STK2300, STK2500,
AVR Embedded Internet, AVR Butterfly. 2
STK2500 (.1). 2
,

AVR. $802100.

, 2
,
? , 2
:
;
;
;
2, 2
.
, 1, 2
.
.
AVR

AVR2! 2
, Ada, Basic, C, Forth Pascal.
.
2
, .
, AVR

, ,
, .

.. , .

AVR. 2

35

.1
22005

36

, , . 2
, 2
!. demo2 trial2 2
,
.
Commercial , 2
, , , .
, 2
, . 2
Windows, MS Office, AutoCAD,
Adobe Photoshop .
, , ,
2
.
.
freeware .
Adware (adsponsored software, bannerware) 2
, , 2
. , 2
, .
.
Donationware (Beerware, cakeware) 2
freeware shareware. 2
2
, 2
, 2
.
Spyware (trackware, Big Brotherware) 2,
2
, e2mail, .
2
2 .

, .
, spyware 2
. , 2
2 , 2
, 2
.
Postcardware
. 2
, ,
. , 2
,
.
, free8
ware8
2
? , 2
,
[1].
1.
, 2
. 2

.
2. 2
(. ) .
. ,
, ,
. 2
,
. , 2
.
3.
. 2
, , , , 2
. 2
,
, 2
.
22005

4.
. , 2
, 2

,
5. 2
2 ,
.
.
6. free2
ware2 commercial2, ,
, 2
. ,

.
7. 2
. 2
,
, .
, 2
.
8. 2
, .
:
,
.
9. 2
, ,
. 2
, 2
, , 2
, .
10. 2
. 2
2 : . 2
Linux, 2
Windows.
, 2
, 2
GNU. 2
WinAVR. 2
,
.
GNU
1984 2
(Richard Stallman) 2
GNU (GNU Project).
Unix2 2
,

.
GNU 2
2

GNUs Not Unix (GNU


Unix).
(.2) 2

,
gnu.

.2


(free software), 2
, , ,
, . free
. 2
GNU , 2
:
0
;

22005

7 : Avr Insight,
Avr2libs, GNU manuals, MFile, Programmers Notepad, Readme,
TkInfo. 2
.
WinAVR.
2
. , 2
, 2
2
. 2
. , 2
2
WinAVR, 2.
: Pro2
grammers Notepad (PN), Simon Steele, 2
2.
2
, Visual Basic Java, 2
http://www.pnotepad.org. 2
, WinAVR ,
.
, WinAVR 2
2
2
.
, WinAVR .
2
2. C:\WinAVR\examples\demo\
demo.c. 2
Beer2ware (
freeware), 2
, 2
. ,
(Joerg Wunsch), 2
2

22
. , 2
, . , 2
,
.
8

demo.c, , 2
, .

, . , 2
,
OC1 (OC1A) GND. 2
, , 2
,
2 2
.
, OC1 (OC1A),
, . 22
,
AT90S2313, 2333, 4414, 4433, 8515, 8535, ATmega8,
64,128,163.
?
2 WinAVR
make2. 2
, 2. , , 2
C:\WinAVR\examples\demo\ 2
makefile 1770 . 2
2
, :
MCU_TARGET = at90s2313, 2
demo.c
AT90S2313.

DATASHEET http://www.atmel.com/dyn/resources/prod_doc2

1 2
;
2
;
3 2
2.
2
. 2
1 3 2
. 2
( 2
!), .
GNU
, . 2
, 2
. GNU 2
.
2
, 2
2 2
.
GNU,

, 2
.
? 2
GNU 2
2
.
, 2
, .
,
. 2
.
,
Free Software
Foundation, Inc. (http://www.gnu.org, , ,
http://www.gnu.org/home.ru.html). , 2

GNU, 2
.
WinAVR
WinAVR 2

http://winavr.sourceforge.net/download/install_config_WinAVR.
pdf, 297 , Colin OFlynn. 2
, 2 2
, .
http://source2
forge.net/projects/winavr 2
WinAVR ( 2005 . 20040720).
2
2, , http://ovh.dl.sourceforge.net/source2
forge/winavr/WinAVR2200407202install.exe 20 2
2004 . 13 , 2
10 . 2
23 2
57 / 2
.
WinAVR2200407202install.exe
, ,
. , WinAVR (2
whenever) 2
, GNU GPL (General
Public License).
C:\WinAVR, 69,9 .
2
.

autoexec.bat Win9x 2
, Windows29x/2000/XP 2

37

uments/DOC0839.PDF, 1,6 . 2
(.3) ,
OC1 PB3 15 .
DATASHEET 2
MISO, MOSI, SCK, RES,
.
(.4).
ZQ1
2, 3. 1
2
VCC, GND. DD1
202 . ZQ1 35 .
XP1 ,
. 2
AVR910 STK200 (. 2
1). 1022
IDC210F. 2
, VCC 2
XP1.

, 2
2
.
1. PN:
WinAVR Programmers Notepad. 2
New, . 2
2: File Open <
C:\WinAVR\examples\demo\demo.c> . 2
: Tools
make all, Process
Exit Code: 0 (.5). 2
10 , hex2 demo.hex
.
2. PonyProg
2.06: PonyProg PonyProg2000 (2
, 2
1).

.4

38

.3
22005

.5

.6

.10

2
: Setup Calibration Yes OK. 2
. 2
: Device AVRmicro AT90S2313. 2
: Command Program
Options < Reload
Files, Erase, Write Program memory (FLASH)> OK.
3.
LPT2 COM2 ,
1 (.4). DD1 2
5 .
4. PonyProg : Setup
Interface Setup, LPT2 2
Parallel, LPT1 LPT2, Avr ISP API
(.6). COM2
Serial, COM1 COM2, SI ProgAPI (.7).
COM2 74HC125 (2
1, .5) Invert
Reset. 2
Probe,
Test OK () Test Filed ( 2
). 2
.
5. PonyProg 1
hex2: File Open Program (FLASH) File <
*.hex> <
C:\WinAVR\examples\demo\demo.hex> .
<Ctrl> <P>. 10 2
: Programming
Sucsessfull ( ).
,
2
HL1 2
1 . 2
XP1 .

, 2
8
HL1. ,
PonyProg PN,
.
PN demo.c 2

90: TCCR1B = _BV (CS10); 2


: TCCR1B = _BV (CS11);. 2
2: Tools make all, 2
Process Exit Code: 0. 2
PonyProg,
<Ctrl> <P> 10 HL1 2
.
, !
AVR2 2
1000 10000 .
:
AT90S2313 ATmega8.
OC1A DATASHEET
http://www.atmel.com/dyn/resources/prod_documents/doc248
6.pdf, 2,4 . (.8).
DD1 282 ,
.4.
R1 HL1,
ATmega8 , AT90S2313.
make2, 2
PN : File Open <
C:\WinAVR\examples\demo\makefile> . 2
MCU_TARGET =
at90s2313 MCU_TARGET = atmega8 (.9). 2
: Tools make all, 2
Process Exit Code: 0.
PonyProg, : Device
AVRmicro ATmega8. 2
( AT90S2313): Command Security
and Configuration Bits Clear all Write (.10). 2
PonyProg , 2
5 , <Ctrl> <P>.
30
HL1. .
2
, 2
. , make2,
2 PonyProg ,
22
.
.
.
demo.c, 2
PonyProg .

1. .. ...//. 2
. 2002. 8. .912.
22005

.8

.9

.7

39

.1

ATmega8515, 8535, 162.


. 6
.
. , 6
ATtiny2313, AT90S2313,
. , 6
ATmega8. (28 6
), ($363,5), ATmega128 6
JTAG.
AVR
6
: , 6
, ,
6. 6
,
DATASHEET ("data" , "sheet" ).
(summary) (complete) "", 6
. , ATmega8 summary6
http://www.atmel.com/dyn/resources/prod_documents/2486S.pdf 6
199 21 , complete6
http://www.atmel.com/dyn/resources/prod_documents/doc2486.pdf
2,4 305 .
AVR ,
DATASHEET.
, Atmel 6
AVR. " ",
.
ATmega8 (.1): VCC, AVCC , GND
, PB06PB7 B, PC06PC6 C, PD06PD7
D, AREF
1,3 .
, .
, AT89C2051, , 6
. 6
.

: ATmega8616
ATmega8L68. 4,55,5
016 , 2,75,5 08 .
, ATmega8 3 .
, 6
. 6
, 6
, ATmega8L.
.
, 6
ATmega8 816
5 . ,
ATmega8L , . 6

48 35 .

( 6


() AVR 
. 

.
AVR 866
RISC6.
, MIPS (Millions
of Instructions Per Second).
8 6
.
AVR, RISC6,
.
, 6
, , , . 6
, "" AVR 6
ATtiny13, 24 . ,
24 MIPS.
AT89C2051 MCS651, 12 . ,
AVR USB66
AT76C713 48 MIPS.

M ,
, 6
. AVR 6
. , 6
. , , , ,
6 . "6" 6
. ,
AVR ("classic", "tiny", "mega") , .
6 AVR
AT90S2313. , 206
. 6
, AT89C2051
( RESET). "classic"
. 6
, 6
, .
.1 AVR. 6
, 6
0,5 0,35 . : 20016
2002 . . ,
, ,
1624 FLASH6 1000
10000. , 6
.
. Atmel
http://www.atmel.com 6
"Replacing by" "Migrating between",
.
6
ATmega128, 6
. 646
TQFP6 6
.
"mega", "tiny"
6

ATmega128 ( , ,
). , 6

.
DIP66
(8), (20628) 6
(40) . 6
"" 6
86 ATtiny13,
ATtiny15L, 6
,
. , "tiny"
( "")
"".
406 ""

Dictum factum
(.)

.. , .

AVR. 3

35
32005

36

) . 6
DIP6,
PI ( 640+85C), PU ( ,
, ), PC (0+70C).
ATmega8 : "" VCC, GND ( 8)
"" AVCC, GND ( 22).
(.2), ."1" "0", 6
. ,
VCC, AVCC, GND6 8 22
0,7 .
1, 2 , , 106
17. "" 6
. [1]
. AVCC, ,
ATmega8515, . ,
ATmega8.
66 , 6
LC6 AVCC.
, AVCC VCC 6
.
6
LC6 (.3).

.
, AVR " " 6
( 6 ). , 6
GND, VCC,
200 . 6
78L05 5,6 .

6
. ATmega8 6
(.4):
6
1,42,3 ;

Brown6Out;
."0" 1 /RESET;
Watchdog
.

, (. "6
2"). Power6On. 6
6
,
6
().
AVR Atmel
RESET "66
" (4,7 0,01 1N4148) 6
[1, 2]. 6
4,8 ,
R1, VD2 (.5).
AVR 6
(brown6out) (black6out) .
6
BOD (Brown6Out Detector).
VCC 6
: 2,7 4 . 0,1 ,
"" 6
.
6 ,
: BODEN (BOD ENable)
BODLEVEL (.2).
" 2". , ,
, FLASH6 , 6
"1" "0" .
.
?
6
. , 6
(4 ) 6
(3 ).

(.6). : 6
" ", 6
. R1, R2 . 6
, DA1
. 6
R, . VDo . 6
RES .
32005

.3

.2

.4

.5

.6

6
, , 4,2 , 6
4 . "1"
BODEN.
,
AT89C2051, "watchdog". WDTON (Watch Dog
Timer ON) (.. WDTON=0, .3), 6
, .
"", 17 2,2
.
"watchdog" ,
? , G1
(.4), "watchdog", . 6
(WDTON=1) , ,
, . , 50 6
3 Watchdog.
, , 6
RESET 1,5 ."0". 6
SB1 RC66
(.7). 1 6
ISP, SB1 6
.
. ATmega8
, (
515 2025 ).
.
, , SB1, C1 6
. ,
, , . 6
6
, 6
.

.7

.8

.10


AVR
, MCS651.
, ,
"" 6
.

ATmega8 .8. XTAL1, XTAL2 ( 6
XT1, XT2) 5 6
, 1,
. : CKSEL (ClocK
SELect), CKOPT (ClocK OPTion) SUT (Start6Up Time).
(. fuse ""), 6
.
DATASHEET 6
, .
,
, ,
65 (SUT0, SUT1), .4. 6
, DATASHEET "time6out" 6
, 6
. 1
.8 , .
"time6out" 4 ,
, . 6
6
.
ATmega8 :
0,916 ;
0,40,9 6
;
32768 ;
RC6 1; 2; 4; 8 ;
RC6 0,412 ;
016 .
, 6
.
.
, 6
RC6 (.9). .5 6
, , 6
1 . , 6
ATmega8 6. XT1,
XT2 6 PB6, PB7,
. 6
,
XT1, XT2
ZQ1 (
TOSC1, TOSC2, .10).
, 6
RC6 (.11).
R1

.11

, . S1 6
CKOPT. (CKOPT=0), 6
1 ,
=36 . 6
F[]=1000 / (3*R[]*C[]).
, F=0,46 R1=33 , 1=22 . ,
6
.
6
(.12) (.13).
,
.
CKOPT, 6
. ( "0"), 6
XT2 "rail6to6rail", .. 0 VCC, 6
F DD1. CKOPT=1, 6
. 6
6, 6
.

,
32768 (.14). 6
ATmega8 80 !
CKOPT
. ZQ1 6
XT1, XT2.
30300 ,
32768 , .
6
, (.15), 6
. R1 , DD1
6. ."1" 6
, XT1 ( ) 6
0,8*VCC.
,
"" ,
XT1, XT2 6
. ,
1, 2 (.13) XT1, XT2,
8 6
. , ZQ1
GND,
.
6
DIP6, 6
32005

.9

37

38

, JCO68 Jauch.
, .
,
,
6
.
)
, 6
6
6 6
. 6
AVR
MCS651. ,
:
P0, P1, P2, P3 MCS651 PA, PB, PC, PD
AVR. ,
ATmega128 PE, PF,
PG, ATtiny 6
PB.

MCS651 6 AVR. .16,
17 6
AVR
PB1. 6

PC6 ( VDo ).
6
ATmega8 6
: PORTn,
DDRn, PINn, n=B, C, D (.6).
S1, 6
R .
MO6, 6
. MCS651 R ,
.
U1 U2.

.

.12

.14

.13

.15
.16


PINB1. MCS651 6
, , "" , .
AVR PORTB1,
PB1 PINB1 6
(U2). ""
.

AVR "" 6
Z6 ( MCS651 ."1").
. , 6
, 6
100 ,
" ".
, 6
(PORTn=1,
DDRn=0), , 6
(PORTn=DDRn=0). ,
32005

" " (6
) " " 6
.
6
.
6
AVR , 6
VCC (SA1 ),
GND (SA1 ). AVR 6
,
."0" 1020 ,
."1" 34 . AVR
20 . 6
150200 , 6
6
.
60,5 VCC +0,5 ,
VDo.

.18
.17


MISO, MOSI, SCK,
ISP. " 2" 6
6
. .
, 6
. , , ISP 6
,
."1" "0", , 6
FLASH6.

. 6,
. 6
.
, MISO, MOSI, SCK
GND 110
ISP6. 6
10 SCK GND. RES 6
RC6 (.7) VCC 6
XT1 (.18).
, . 6
,
. 6
ISP6 6
.
.1, MISO, MOSI, SCK
PB3, PB4, PB5. Atmel 6
ISP R16
R3 (.19).
, ,
. ,
MISO, MOSI, SCK ISP6.
, RES,
.

6
. PonyProg, 6
, (. " 2"), 6
ISP . ,
,
.
, PonyProg
ATmega8 ("Device AVRmicro ATmega8"),
. 6
: "Command Security and Configuration Bits", 6
.
6 6
: BootLock01, 02, 11, 12; Lock1, 2. 6
( ""),
( "").
7 6, RSTDISBL,
EESAVE, BOOTSZ0, 1, BOOTRST "" ( 6

.21

),
WDTON CKOPT .3, 4.
8 6. 6
.2, 4.
, . 6
( "0")
PonyProg "" , , "" 6
( "1"). 6
FLASH6, 6
."1".
6
. , 6
(
8 , 1 ). , 6
, ,
. , 6
RSTDISBL, RES 6
PC6. 6
ISP6 . " 6
" (. " 1"),
.
"" , RSTDISBL,
AVR. , ATmega8515 . 6
DATASHEET, Fuse Bits.
.20 PonyProg 6
ATmega8:
;
8 ;
Brown6Out 4 ;
Watchdog.
:
CKSEL0=CKSEL1=CKSEL3=SUT0=SUT1=BODLEVEL=BODEN=0, 6
"1" ( , 6
"").
, 6
, 6
. , ,
,
.. "6"
(.21). 6
1 , ATmega8
( ) .
. DATASHEET Atmega8
.

.

1. AVR042: AVR Hardware Design Considerations


http://www.atmel.com/dyn/resources/prod_documents/doc2521.pdf.
2. AVR180: http://sin6
bad.narod.ru/avr/BrownOut.htm (.).
32005

.20

.19

39

6/2004.

0
. 0
ATmega8, . 0

. , 0
, , 0
. 0
: .
Tips and Tricks

. , 0
WinAVR.
WinAVR
Add Shortcuts to Desktop ,
.
PN ,
Tools0Options0Start with a new blank document.
PN
, Lucida Console Courier
New Cyr Tools0Options0Style Schemes0< 0
, >0OK.
PN ,
View0Line Number. , ,
, 0
.
, WinAVR C:\WinAVR. 0
0
.

0
.
: Hello, world!

.

. 2005 0
AVR .
0, Atmel AVR00
, Lighting AVR, Smart Bat0
tery AVR (.1). 0
. , 0
(425 ) .
, Atmel
25 . , 0
AVR 1,8 , 0
( , 0
!).
0, WinAVR. 0
20050214, 14 2005 .
http://sourceforge.net/projects/winavr/.
WinAVR0200502140install.exe 0
13,7 , , , 0
.
, WinAVR 20040720,
. 0
, 0
0
. ,
, 0
.
WinAVR020050214 ,
, , Programmers
Notepad (PN). 0, 0
WinAVR. , , 0
.
. WinAVR 0
. ,

00
AVR0GCC. 0
GCC (GNU Com0
piler Collection), Windows,
Linux, , ++, -, Ada, Fortran, Java.
WinAVR , 0
AVR,
Windows C, C++
.1
ANSI, ISO. GCC 0
http://gcc.gnu.org/ (.1).

GCC http://gcc.gnu.org/bugs.html. , 0
, 0

.
AVR0GCC
0, . 0
, (. , 0
, ) 0
WinAVR ATmega32 (http://clay0
more.engineer.gvsu.edu/ ~jackh/eod/egr345.html). 0
, 0
.

, , 0
. 0
, AVR, 0
. 0
MCS051 0
AVR. 0
. (
) . .24
2004 .

,
,

.

.. , .
() AVR .
(, ,
), 7
. , , .

AVR. 4

35
42005

36

, , 0
. , 0
0
. ? Hello, world!
, .
.
.2 , 0
MCS051 (. 5/2004),
.3 AVR0. : HL1 0
SB1, 0
HL2, , 0
SB2.
. 4 MCS051 0
. AVR DD1,
R1, R2 .
C2, C3, ZQ1 MCS051 0
. AVR , RC00
1 .
SB1, SB2 0
+5 (VCC) P3.4,
P3.5 PD4, PD5. .
R3, R4 .3 . 0
, , 0
SB1, SB2 , . 0
, PD4, PD5 0
?
SB1, SB2 0
R3, R4 6, 11 DD1 0
100 .
, DD1
. .
( 0
), , 0
.
. 0,
, 0
, 0
0
PD4,
PD5 . 0
, 0
.
, 0 .

, 0
GND VCC, , 0
. 0
,
.
MCS@51 AVR
, 0
, , 0

. , ,
. , 0
. , 0
, , 0
. 0
, 0
, , .
, ,
.
,
. 0
, .
, , .2, 3, 0
, , 0 0
. 1 MCS051, 2 0
AVR.

1 2 . 0
0
MCS051,
make0. AVR 0
.
1 , 0
2.
42005

.2

.3

1 ,
. , 0
. 0
, 5. 0,
/* */ ,
. .
2, 3 AVR MCS051. 0
, , 0
make0 MFile 0
PonyProg. , ,
, avr41, 0
ATmega8, 0
1 , 0
0
VMLab.
6.
int. 1 .

7. 0

(PORTB=PORTC=PORTD=DDRB=DDRC=DDRD=0). 0
, (0
0xFF), 0
2050 . 0
, 0
.
8 PC3 0
. , .3, 0
R5 HL1.
.1, 7 PORTC.
: 1 0
DDRC.
, . 0
80 DDRC, 0
. |= , 0
, 0
, .. DDRC. _BV 0
AVR0GCC, 0
1 (Bit Value). 0
. (PC3).
, DDRC 1 3, 0
.
0 ,
, DDRC |= (1 << PC3), .
9 8. 1
DDRD, PD7 .
12, 13. bit_is_set 0
AVR0GCC.
PD4 PIND , 1,
, . PD4 0
SB1, ,
. if0else: PD4 0

.4

.5

.6

.1, .1 PC3 0
14. PD4 .0, 13
.0 PC3.
_BV 13 0
, .. 1 0
0 . , 0
(&), ,
PORTC 0 3, .
.5 0, 0
, . 0
PC3, 0
(PORTB, PORTD, DDRB, DDRD) 0
(PB00PB7, PC00PC7, PD00PD7), , PORTB
I= _BV(PB0).
15, 16 12, 13, 0
bit_is_clear ( ), 0
.0 PD5
PIND .1. 1,
9.
18 WinAVR,
, 0
.
MAKE@
, 0 WinAVR
make0.
makefile
C:\WinAVR\examples\demo\ 0
, .4. , 0
avr41.c ( 2) make0 0

.
make0
, WinAVR 0
MFile ( Joerg Wunsch, . , 0
). . MFile:
WinAVR MFile. Makefile
:
Makefile0Main file nameMain file 0
avr41 OK.
Makefile0MCU type0ATmega
atmega8 (.5).
Makefile0Optimization level
2 WinAVR.
, 0 , s 0
, 103 , 0
3 , 0
.
Makefile0Debug format
AVR0ext0COFF (AVR Studio 4.07+, VMLab 3.10+).
,
.
: FileSave as<
, avr41.c>< makefile>0
. MFile (File Exit) 0
. 0
makefile , UNIX.
PN,
0 avr41.c [WinAVR]
42005

37

38

Make All. make0, .4, 0


. , 0
FLASH0
(.6).
PonyProg,
avr41.hex, ISP0 0
, 5 .
SUT0, CKSEL3, CKSEL2, CKSEL1 3 2,
<Ctrl> <P>. 30 0
Programming Successful SB1,
SB2 HL1,
HL2.
@

. 0
, .
, .3,
SB1, SB2 R3, R4.
3.
2.
13, 14 .0 .1
. .
15 . 0
pause
0 ( 7). 15 pause 0
( +). 15000 (0
) , pause, 15000,
16. 0 0
, 0
. , , 0
15000 65535 1.
18 .
(15000) pause 0
15. 18
( -). 15000 pause ,
19. 0
: 15 , 18 .

avr42.c
avr42.hex 0
. , 0
( 15, 18 3), 0
, HL2 , HL1.
.
, 00
. . ,
, , 0
15, 18 3? ,
HL1, HL2 0
PC3, PD7 DD1 0?
0
, 304 . 0
,
.
, ? ,
. 0
, Amega8, 0
,
0
.
Visual Micro Lab
(VMLab) AMTools. http://www.amctools.com
0
(http://www.amtools.net/vmlab310.zip, 3,8 ) 0
(75 ). 0 : 0
4 , 0
50%, 0
4, 50 .
, ,
ATmega8, . , 4
, AT89C2051. , 00
VMLab , 0
.
. WinAVR0VMLab 0
0.
WinAVR VMLab 0
0
42005

. 0
0 , 0
.
, ,
VMLab , 0
? .
(emulation) , 0
[1]. , 0
, , 0
, , .
,
. IBM PC :
, , , 0
.
(imitation) [1].
,
. 0 (
),
( ), (
).
(simulation) , 0
,
, [1]. 0
,
, ,
. , 0
, , , ..
, VMLab 0
, software sim0
ulation with analog simulation . 0
, , 0
. VMLab , 0
IBM PC 8001000 ,
.
VMLab
VMLab 0
. .prj, 0

.
C:\Vmlab\AVR_demo\ C:\Vmlab\WinAVRdemo\, 0
VMLab . ,
: , , , , 0
, , RS0
232 .
0 0.
1. VMLab: 0
Vmlab. Project0New project, 0
(Step104) , .7.
, 0
avr42.c, makefile, avr42.hex .. OK,
. Messages 0
PRJ file is OK!.
2. avr42.prj
4 ( 0
). 0

. 0
, .3 0
: R5, R6, HL1, HL2, DD1. R1, R2 0
1 , SB1, SB2, R3,
R4 .
3. , F9 Build.
Messages Success! All ready to run.
4. , F5
Go/Continue. Messages
Starting hardware0software co0simulation...
5. View0Scope. 0
20 /, 0
2 /. , 0
PC3, PD7 (.8). ,
PC3 PD7 0
. VMLab , 0
, 0
.
6. Shift+F5
Pause program. 0
Cursor 1, 0
. 0
Cursor 2 .
. , .8
1322,4 1427,2 , , 0
01 ( HL2) 0
t2=104,8 . ,
HL1
t1=60 .

t2 t1? 3 t2 0
15, t1 18. ,
15000 . 0
15 15000 0
while. , 0
18 ( ), , 0
.

0
, . 0

.8


. , VMLab, 0
Code. Target file: avr42.hex,
avr42.c 15 15000 1000 (
Restart simulation? ). F9, F5
, , 0
0
. 0
: Project0Re0build all.
, avr42.c, , 0
. 0
, 0 0
. .
Step
. ,
Project0Close project, 0
0 HEX0.
.
. .
0. 0 VMLab 0
.
VMLab ( 2)
.

.7

1. The Blackwell Guide to Philosophy of Computing and Information. Edited


by Luciano Floridi, August 2003, 392 pages, http://www.blackwellpub0
lishing.com/pci/downloads/Glossary.pdf.

39
42005

AVR. 5

2C5 R1*, R2* 6


, , 6
.
. 6
, R1*, R2*
4050 ( ).
R1, R2 , 6

SB1 6
175 475 (5,72,1 ) . 6
,
. ,
.
/
1.
2, 3 , make6
(MFile) (PonyProg).
5, 6. 6
,
avr/delay.h . UL 6
F_CPU Unsigned Long, ..
04,2 .
13. 6
PB0 PB1.
1525. 6
( ) .3.
_delay_loop_1(X), X=TIK=208, T1
T1[]=3*F_CPU[]*X=3*1*208=624 ,
800 625 . TIK
7 1256,
.
2628. SB1,
temp : 70, 100, 130, 160, 190.
(. 15, 30).
1 ,
, 6
. _delay_loop_2(Y) 6
T 2 T2[]= (F_CPU[]*Y)/250=
=(1*62500)/250=250 . Y 165536
.

, (),
, .
, +
, +
,
, , 6
.
: , 6
, .
: 6
, , , 6
.
:
, , ,
.
: , 6
, , .
6
. . 6
6
(, , ).
. , 6
.
, 6
6
, . 6
, 6
, , 6
.

, , 6
2. 6
, 6
. : 6
, , 6
.
6
, . 6
1974 . (Diana Deutsch)
, (http://philomel.com/pdf/Nature6
1974_251_3076309.pdf, 67 ). . 6
,
400
800 (.1,). 6
, 50% 50%
.
,
.
, . ,
, ,
,
, 6
.. , , 6
.

(R) (L). .1,
.
, R
.1,. ,
, 6
.
6
, .
: 400
, 800 , 250
( 240 ), 6
.1,.
(.2) 6
DD1, 6
RC6 1 . 6
, 6
, . 6
PB0, PB1 R
L , X1.

?
. 

.. , .

.1

35

.2
52005

36

3040 1525,
.

WinAVR:
MFile Programmers Notepad (PN). 6
, PonyProg. , Clau6
dio Lanconelli 2.06f, 5 2005 .
(http://www.lancos.com/e2p/V2_06/ponyprogV206f.zip, 606 , .4).
, ,
.
WinAVR 6
AVRDUDE (AVR Downloder Uploader, Brian S. Dean), 6
, PonyProg,
. , 6
COM6 (. .5, 6 6
1), 6
. , 6
.
AVRDUDE, make6
. . 6
MFile: WinAVR
MFile. :
Makefile6Main file nameMain file
avr51;
Makefile6MCU type6ATmega
atmega8;
Makefile6Optimization level 2;
Makefile6Debug format AVR6ext6COFF
(AVR Studio 4.07+, VMLab 3.10+);
Makefile6Programmer pony6stk200;
MakefilePort lpt1
lpt2, lpt3.
: FileSave as<6
, avr51.c>< make6
file>. File Exit.

3 1. PonyProg,
. AVR6
DUDE C:\WinAVR \bin\avrdude6gui.exe , 6
. , 6
HEX6, 0 RST6
DISBL (. 3) 6
.
, 6
PN, 1 6
Toools [WinAVR] Make All. . 6
Warning: F_CPU redefined.
, 6 1
1 , make6 8
. 6, 6
F_CPU make6 .
. ,
Makefile PN 51 F_CPU 8000000 F_CPU
1000000. ,
.
LPT6 (. .3, 4 1). 6
. PN,
Tools [WinAVR] Program, 6
. PonyProg 6
, AVRDUDE 6
FLASH6, , .

6
. 2030
. ,

. 6
, SB1.
6
.
, 800
,
. 6
, , .
, 6
. 6
() , 6
.

6
52005

.3

.4

.5

19, 20. PB0 6


, , , 6
64 19.
2233. SB1SB4 6
sdvig, 6
.
, ( ),
3, 7, 12, 16 . 6
, , 6
, 6 6

.
3437.
OSCCAL : 0x00, 0x33,
0x66, 0x99, 0xCC, 0xFF.
38.
OSCCAL, 6
b c.
43. PB1 , 6
, , sdvig. , PB1
, PB0 ( 20) .
52005

6
(). , 6
. , 6
.
, 6
.

, (.1). 6
,
? ,
, (Hans Berger), 6
192429 ., 10
. 6, 6,
6 .
,
, ,
.
. 6
, , , 6
, , 6
.
,
. 6
. , 6
0,530 .
, 6
.
, ,
, , 400 ,
410 .
405 , 6
10 . .2
6
. 6
.
. 6
6
200400 . 6
.1.
, 6
.

.5. SB1SB4 ,
HL1HL4. 6
RP1, R5, R6, C2, C3 6
. RP1
. 6
.
SB5 ,
, 150450 . 6
? DD1,
, ,
DATASHEET ATmega8 , 6
2550%.
SA1 ,
. 4*

. , 6
.
/
2.
3. RC66
8 . 6 6
.
16. 6
OSCCAL (OSCillator CALibration). 6
, RC66
. 6
, 3% 6
, 1 (2, 4 8 ). 6
PonyProg, :
Command Read Osc. Calibration Byte. , ATmega8
OSCCAL=167 HEX6 0xA7.
6
, . .6
6
OSCCAL. , ( 16)
8 4,3 , .. 2 ! 6
, ,
.

37

38


, 6
, 6
. , 6
, , 6
6
6.
, , BrainWave Gen6
erator (http://www.bwgen.com/bwgen31.exe, 1,2 ),
(http://andrei512.narod.ru/programs/Mozgoprav_03.2005.zip, 42 ),
, 6
. 6
.
,
6
, (http://www.bwgen.com/com6
ments.htm)! ,
, 6
. 6
:
, .
, 6
. ,
6
SB2 , SB5 6
SA1 (
), .
: 6 10 , 6 6
.
RP1. , 6
( ), 6
, .
.
.
. 6
, 6
. , , ,
6
.
6
, ( 6
), . 6
6
, , , 6
.
, 6
.

6
1020 1822 . 6
, 6
. ,
100 200 , 6
.
. 6
6 , 30 ,
( ), . 6
, 6
4050 .
.

(Rotor Sound). ,
6
.
,
8 (.7).
, , 6
. 6
6
.
6
, 6
.
.
. 8. 6
, 6
. 12 . 6
100900 (6
52005

.6

.7

52005

.8

101,1 ).
.
6
.8.
BA1BA8 6
18 RP1RP8 6
.
D 6
, 6
.
6
HG1, 6
R1R8 200360 . 6
SB2, SB3 6
. 6
SA1 6
.
6

HG1.
+5 26,
1113 ,
360
307 ( +5 ),
.
SB1 , 6
5 , 6
6
.
/ /
3.
79. , 6
.
6 ,
.
1620. 6
. 2040 , 6
50 ( 17). 6
, , 6
.
2736. ,
1,
, , PC6 .
54. a 6
. . 13 temp=50, 6
, a=temp*50=50*50=2500. 6
56 t=250 , N=8,
T[]=a*N*t[]=2500*8*0,00025=5 .
.
64. temp , 6
SB2 900 .
SB3 , 6
59.

, 6
8 .7. 6
. , SA1
. (
SB1) 6
. RP1RP8 ,
.
+
, ,
. HG1,
100 , .
SA1 , 6
. ,
. 6
. 6
, 6
,
( ).
. 6
, .2, 5, 8, VMLab. 6

. WinAVR
6
MFile, PN, AVRDUDE.

39

AVR. 6

8x2, 16x1, 16x2, 20x2, 20x4 ..).


.
. 5
,
+
16 . 5
( , ). , 5
, 162, 5
,
.
, , ,
, , ,
, .
, , . 5
,
, , SC1602 ( Sunlike), WD5C1602
( Wintek), BC1602 ( Bolymin), MTC516204 (
Microtips), PC1602 ( Powertip), MT516S2 ( ) ..

, 5
. 1888 . 5
(Friedrich Reinitzer)
.
5
. ,
5 Sharp 1964 .,
(1966 ., RCA)
14 (1976 ., Sharp).
, 5
, 5
. 5
, 5
. 5
. 5
, 5
.
,
55

. 5
, ,
.
, 5
. 5
5
. 5
,

.
? 5

.


, HT1611 5
(.1). 5
. 5
, 5
. 5
, , , (.1).
, , 5
. 5
, HD44780
( Hitachi) , , KS0066 ( Sam5
sung), SED1278 ( Epson), ST7066 ( Sitronix). 5
,
5.
5
:
HD44780 ();

();
(5
+5 );
( , ,
);
(8x1,

.1

(), $
. ,
$
().
, AVR,
. $
.

.. , .

35

.2
62005

36

.
.2 5
162, 5
5. 5
, 55
, SMD5. 5

HD44780.
Dot Matrix Liquid Crystal Display Controller/Driver, 5
,
.
RC5
G1, 250 50 . 5
, 5
. 5
5.
4,04,2 .
5
(.2). ,
8x1 16x2.
15, 16 ,
.
. 5
. 5
, : 1516,
1651, 15, 16, 1514. 5
5
. 15, 16 5
. 5
.
,
. , 5
10 . 5
4 .
:
DB05DB7 ;
RS, R/W, E ;
VCC, GND, Vo, A, K .

.3.
5

5
Hello, world! (5
, !). SB1 5
. 5
R2
.

5 20 .
, R2 5
, 5
5
5
. ,


. 5
R2
, , 5
5
,
.

5
, , 5
,
.
5
DD1.
, 5
5
. 5, 5

62005

.3

.4


, ( 65535) .
1421, 2329 5
, .5.
3139.
. .
5
. , 5

.

DATASHEET HD44780. lcd_init
, 008 5
, 5
. , 5
.
4449. 5
5
. , H
. 5
(. 37) 5
e ..
62005

11 . 5
, 5
. 5,
5
( 5
,

DATASHEET

HD44780
http://www.gaw.ru/pdf/lcd/Chips/Hitachi/hd44780u.pdf, 316 ).

5
, 5
. ,
HD44780 ATmega8,
. , 5

.
.3
, , .4
.
.
RC5 , , , 5
5
.
.
0x01503F .
( 0x3F)
. .5
0x80 5

4 0x34.
, .5,
.3, 5
. 5
. , 5
.
5
. ,
. 5
. 5
,
.
1 5
, .3.
1
5, 6 5
RS E. 5
. , 25 5
DD1, RS, 5
(28) 5 #define
RS PC5. 5
.
7. TIME 5
.5.
TIME 5
. 5
. , , ,
TIME .
912. 5
. 5

.5

37

.6

38

.7

50. , 5
. 0
return
. 5
, return(51). 5
(51) main 41 int, void.
VMLab
, , .
Hello, world!, 1, 5
VMLab.
. VMLab.
avr61.prj
, avr61.c ( 5
4).
62005

2.
, 5
1. LCD
.
(16), (2) F (250 )
. 5
, 5
RS, R/W, E, DB7DB0. 5
, (PLOT)
RS E.
. 5
View Scope View Control
Panel. 5
RS, E, LCD (HD44780 type)
(.6).
. , VMLab,
( ?), 5
. , 5
2
1000 33, 36 1, VMLab 5
, MTC516204 Microtips 5
.

5
, . ,
,
8 ,
5.
0057Fh 5
, ,
. IBM PC. 5
.
HD44780 5
:
(European standard font Euro);
(Japanese standard font
Japan;)
(Custom font Russian, .7).
.
5
, . 16 5
000500F .
5
.
,
5
,


HD44780.

5
.8. .5 5
. 5
DB4DB7, DB0DB3
.
,
, . 5
, 5
(
) 4 . ,

, .
5 .9. 5
5 . R/W
: ,
.0 ( 5
, : ).
SB1 . 5
, , .
R1, 13 . 5
S1 ( ). 5
R2,
120150 . 5
70100 .
:
x=(y*k+x*k)/k-y, x , y 5
, k .
x k
. 5
5, 5
. x k 5

19 29.
: (y). 5
(k).
(x*k). (k) 5
(y). , 5
x, 5
.

.9

.
5
.
4051 1 4058 3. 5
, 5

0255 5
.
.7, , .
, , 5
.7 5
8, .
, 5,

. , 5 55
, 5. 5
.
, 5
,
5 5, 5
. , 5
5.

.
3
,
, 5
, . 5
, 5
. 5 ,
, 5
.
5
. , 5
, , . 5
, , ,
65

[1]. 5
.
5
, 5 ,
.
5
.
5
.
.
. 5
. 5
4 .

. ,
.3, 8 , 5
DB0DB7. 2 5
. 5
, 5

.8

. 5
, 5
( 1, 3). 5.
7.

1. . . .: ,
1986. 128 .
62005

39

AVR. 7
*
* ( 6/2005, .39,
.9), *
(). ,
*
.

,

1


, ,
, , . <
. , <<
, <
. :
.
<
< 6. <
,
AVR.
.1 , <
ATmega8. (FLASH, EEPROM,
) . <
. RAM
,
.
FLASH< . <
. , <
. <
ISP PonyProg.

, , , <
, BOD, <
. PonyProg,
FLASH.
EEPROM ,
FLASH. ,
. ,
FLASH , EEP<
ROM .
, .1 <
FLASH.
FLASH , EEPROM
Intel <
. FLASH<
. , <
.
ATmega8 EEPROM, <
<
(100 ).
RAM
<
, <
<
<,

. <
RAM
,
, <


. ,
ATmega8
1000
.
.1

.. , .

35
72005

36

EEPROM
. <
<, 1.

3. <
1 .
BODEN BODLEVEL,
BOD.
4
( 3,74,5 ).
,
FLASH<, BOD <
? , <
FLASH (
ISP ). EEPROM
,
22,7 .
EEPROM <
,
BOD.
,
<
117142, <
RESET.
5, 6 .
, EEPROM <
7, 1216, 6973. <
rand 87,

07FFFh.
7 .
, , <
1216. <
. E
, .
t0[ ]t4[ ], <
E, FLASH,
EEPROM. ? . <
,
, FLASH 99%, <
<.
2335, 3748, 5057
1 6, 4< <
. , ,
. ,
, <
. <
DATASHEET HD44780,
. <

DATASHEET,
VMLab.
66. <
. <
.
1216. , 16
t0[ ]t4[ ] , <
16 .
6774.
. (<,
) 67 (lcd_com),
<
for. <
, .
6973. eep<
rom_read_byte EEPROM. <
, <
& <
t0[ ]t4[ ].
. <
. <
72005

, , ,
eeprom_read_byte.
7584. 13,
14, 16, , <
. : <
(lcd_com),
(lcd_dat) .3 6 ( 6/2005, .37).
8589. SB1 <
.
1, . ,
rand 87 ( <
) , ,
while
SB1, .
90 ,
SB1,
.
93. , <
: FLASH EEPROM.
, .
- VMLab
<
, avr71.c (<
1) make<,
MFile.
VMLab <
, 1 6.
, avr71.prj
, , : X1 (16 2 250K) PC0
PC1 PC2 PD7 PD6 PD5 PD4 nc3 nc2 nc1 nc0.
<
<
(.2). <
, <
<,
! <
.2

.3

, <
.
. <
ruslcd.exe , avr71.c. <
ruslcd avr71.c, <
1216 1 <
IBM PC <
. <
Programmers Notepad
Tools [WinAVR] Make All.

3 ruslcd.exe ,
<
.
EEPROM PonyProg
avr71.c,
, avr71.hex, <
FLASH.
avr71.eep,
HEX<, EEPROM. , <
.
.
PonyProg. avr71.hex File Open
Program (FLASH) File < *.hex> <
avr71.hex>. avr71.eep File
Open Data (EEPROM) File < *.eep> <<
avr71.eep>. Command Program
Option
Reload Files, Erase, Write Program memory (FLASH) <
Write Data memory (EEPROM). <
<Ctrl>+<P> <
.

<
. <
. <
< <
.
2 <
( 2, 3). <
, <
MCS<51. .3
avr72.c ( 2), lcd.c
( 3) make<. xxxxx
. <
lcd.c <
.
2
5. pgm<
space, .

, VMLab
Windows , <
, , <
. , <
, .
VMLab
, .. <
.
VMLab <
.

37

.4
72005

38

710. ,
( extern).
, make<.
1114. t0[ ]
, .
(\). <
.
15. . <
<
. <
.
28. sizeof(t0) <
t0[ ].
1115.
,
, .
30.
b. <
16 , <
t0[ ]. <
, .
32. ,
. <
<
TEMP 6.
3
lcd.c <
avr72.c.
lcd_com, lcd_dat, lcd_init, pause
1. <
80
lcd, lcd_dat lcd_com.

, <,
make<.
. MFile <
avr72.c.
makefile , avr72.c lcd.c.
Programmers Notepad.
makefile. <
: View Line Numbers. <
63 lcd.c SRC = $(TARGET).c
lcd.c. : File Save All.
avr72.c
ruslcd.exe.
avr72.bat < ruslcd avr72.c <
: Tools [WinAVR] Make All.
FLASH
avr72.hex EEPROM avr72.eep. <
PonyProg.

,
.
, <
. <
( <
< http://www.vizit<ka.ru/rus/soft.html, 14 , ), <
.
<
, < , <
. ,
, <
.
.4 <
. <
.
DD1, <
HG1 4<
.
<
<
R1. <
72005

.
: ? <
: DD1
36 .
R1 <
, , <
, <
, , Email.
, <
.
R2. ,
, ,
(
120180 ).
R3 <
. 20 ,
.
22 .
<
, , , <
, .
avr73.c ( 4)
lcd.c, , <
, .
4
3.
RC< 0,10,9 . <
R1 <
, .
, , <
, <
R1. <
10 , <
1 .
14. I <
.
2729 , <
. <
2, .

< , ,
4

.
,
11< . .5
,
.
1 () <
(). 2 (). <
3 ,
().
< <
. <
.
, <
.
5.
13, 14 <
,
.5. t2[ ] <
. <
t3[ ] foot[ ],
22 ( ), 26 (
), 22 ( ), 25 ().
1520 <
. t4[ ], t5[ ] <
.
, <
. , t4[0] 0xC0,
.
t5[0] 0x20, .. .
, .
t4[1] 01
, <
0x01. 23
. :
,
0xC0, , 0xC1
..
2129 , <
0x000x07.
.6 <
, 29, <
0x07.
, .
3058 . <
, <
.
. <<
. ,
1 2.

VMLab. <
, <
.
72005

.6

, , .
. .
( 6/2005, .38,
.7), 16 0x000x0F <
.
58
.
, <
, <
. <

.5

39