Explore ATtiny microcontrollers using C and Assembly language: AVR architecture and programming
Gespeichert in:
1. Verfasser: | |
---|---|
Format: | Buch |
Sprache: | English |
Veröffentlicht: |
Aachen
Elektor
[2021]
|
Schriftenreihe: | Elektor books
|
Schlagworte: | |
Online-Zugang: | Inhaltsverzeichnis |
Beschreibung: | In-Depth |
Beschreibung: | 376 Seiten Illustrationen 23.5 cm x 17 cm |
ISBN: | 9783895764790 3895764795 |
Internformat
MARC
LEADER | 00000nam a22000008c 4500 | ||
---|---|---|---|
001 | BV047666293 | ||
003 | DE-604 | ||
005 | 20220801 | ||
007 | t | ||
008 | 220112s2021 gw a||| |||| 00||| eng d | ||
015 | |a 21,N51 |2 dnb | ||
016 | 7 | |a 1247933792 |2 DE-101 | |
020 | |a 9783895764790 |c pbk: EUR 37.95 (DE) (freier Preis), EUR 39.10 (AT) (freier Preis), CHF 39.95 (freier Preis) |9 978-3-89576-479-0 | ||
020 | |a 3895764795 |9 3-89576-479-5 | ||
024 | 3 | |a 9783895764790 | |
028 | 5 | 2 | |a Bestellnummer: 20007 |
035 | |a (OCoLC)1298287530 | ||
035 | |a (DE-599)DNB1247933792 | ||
040 | |a DE-604 |b ger |e rda | ||
041 | 0 | |a eng | |
044 | |a gw |c XA-DE-NW | ||
049 | |a DE-29T |a DE-M347 |a DE-83 | ||
084 | |a ST 170 |0 (DE-625)143602: |2 rvk | ||
084 | |a ZN 4980 |0 (DE-625)157428: |2 rvk | ||
084 | |8 1\p |a 621.3 |2 23sdnb | ||
100 | 1 | |a Smith, Warwick A. |e Verfasser |0 (DE-588)1022275852 |4 aut | |
245 | 1 | 0 | |a Explore ATtiny microcontrollers using C and Assembly language |b AVR architecture and programming |c Warwick A. Smith |
264 | 1 | |a Aachen |b Elektor |c [2021] | |
300 | |a 376 Seiten |b Illustrationen |c 23.5 cm x 17 cm | ||
336 | |b txt |2 rdacontent | ||
337 | |b n |2 rdamedia | ||
338 | |b nc |2 rdacarrier | ||
490 | 0 | |a Elektor books | |
500 | |a In-Depth | ||
650 | 0 | 7 | |a Mikrocontroller AVR |0 (DE-588)4540630-3 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a C |g Programmiersprache |0 (DE-588)4113195-2 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Assembler |0 (DE-588)4003255-3 |2 gnd |9 rswk-swf |
650 | 0 | 7 | |a Mikrocontroller |0 (DE-588)4127438-6 |2 gnd |9 rswk-swf |
653 | |a Microchip | ||
653 | |a Atmel | ||
653 | |a ATmega | ||
653 | |a Microcontroller | ||
653 | |a Programming | ||
689 | 0 | 0 | |a Mikrocontroller |0 (DE-588)4127438-6 |D s |
689 | 0 | |5 DE-604 | |
689 | 1 | 0 | |a Mikrocontroller AVR |0 (DE-588)4540630-3 |D s |
689 | 1 | |5 DE-604 | |
689 | 2 | 0 | |a Assembler |0 (DE-588)4003255-3 |D s |
689 | 2 | |5 DE-604 | |
689 | 3 | 0 | |a C |g Programmiersprache |0 (DE-588)4113195-2 |D s |
689 | 3 | |5 DE-604 | |
710 | 2 | |a Elektor Verlag GmbH |0 (DE-588)1065539746 |4 pbl | |
776 | 0 | 8 | |i Erscheint auch als |n Online-Ausgabe |z 978-3-89576-480-6 |
856 | 4 | 2 | |m DNB Datenaustausch |q application/pdf |u http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033051026&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |3 Inhaltsverzeichnis |
999 | |a oai:aleph.bib-bvb.de:BVB01-033051026 | ||
883 | 1 | |8 1\p |a vlb |d 20211218 |q DE-101 |u https://d-nb.info/provenance/plan#vlb |
Datensatz im Suchindex
_version_ | 1804183141291655168 |
---|---|
adam_text | INTRODUCTION
17
BROAD
OVERVIEW
OF
THIS
BOOK......................................................................................
18
ABOUT
THE
TARGETED
AVR
MICROCONTROLLERS
.................................................................
18
PRIMARY
PROGRAMMING
SOFTWARE
.................................................................................
19
WHY
LEARN
ASSEMBLY
LANGUAGE?
............................................................................
...19
THE
MANY
REASONS
FOR
LEARNING
ASSEMBLY
LANGUAGE
............................................
19
C
PROGRAMMING
.............................................................................................................
21
INTENDED
AUDIENCE
........................................................................................................
21
PREREQUISITES
.................................................................................................................
21
SOFTWARE
REQUIREMENTS
...........................................................
22
HARDWARE
REQUIREMENTS
...........................................................................................
22
A
DIP
PACKAGED
ATTINY
........................................................................................
23
AN
ELECTRONIC
BREADBOARD....................................................................................
23
PROGRAMMER/DEBUGGER
........................................................................................
23
ATMEL-ICE
BASIC
KIT
........................................................................................
24
ATMEL-ICE
FULL
KIT
...........................................................................................
24
AVR
DRAGON
....................................................................................................
25
AVRISP
MKLL
...................................................................................................
25
HOBBYIST
USB
PROGRAMMERS..........................................................................
25
POWER
SUPPLY
.......................................................................................................
26
JUMPER
LINKS
AND
WIRES
......................................................................................
27
ELECTRONIC
COMPONENTS
.......................................................................................
28
OPTIONAL
TEST
EQUIPMENT
.....................................................................................
28
MICROCHIP,
ATMEL,
MICROCHIP
STUDIO
AND
ATMEL
STUDIO
............................................
28
ACCOMPANYING
RESOURCES..........................................................................................
29
LET
S
GET
STARTED
..............................................................
29
CHAPTER
1
YY
OVERVIEW
OF
ATTINY
MICROCONTROLLERS
31
1.1
ATTINY
MICROCONTROLLERS
......................................................................................
32
1.1.1
8-PIN
DEVICES
...................................................................................................
33
1.1.1.1
ATTINYL3
AND
ATTINYL3A
..........................................................................
33
1.1.1.2
ATTINY25,
ATTINY45
AND
ATTINY85
............................................................
33
1.1.2
14-PIN
ATTINY24,
ATTINY44
AND
ATTINY84
.........................................................
34
3
1.1.3
20-PIN
DEVICES
.................................................................................................
34
1.1.3.1
ATTINY26
...................................................................................................
34
1.1.3.2
ATTINY261,
ATTINY461
AND
ATTINY861
.......................................................
35
1.1.3.3
ATTINY2313
AND
ATTINY4313
.....................................................................
35
1.1.4
28-PIN
DEVICES
.................................................................................................
36
1.1.4.1
ATTINY48
AND
ATTINY88
.............................................................................
36
1.1.4.2
ATTINY28L
AND
ATTINY28V
.........................................................................
36
1.2
WHICH
ATTINY
TO
USE
...............................................................................................
36
1.3
COMPARISON
OF
ATTINY
DEVICES
..............................................................................
37
1.4
SUMMARY..................................................................................................................
38
CHAPTER
2
*
HARDWARE
AND
SOFTWARE
SETUP
39
2.1
INSTALL
MICROCHIP
STUDIO
.........................................................................................
40
2.1.1
DOWNLOAD
PAGE
AND
SOFTWARE
VERSION
............................................................
40
2.1.2
NEWEST
SOFTWARE
VERSION
.................................................................................
40
2.1.3
START
THE
INSTALLATION
.........................................................................................
40
2.1.4
INSTALLATION
STEPS
..............................................................................................
40
2.2
8-PIN
ATTINY
MICROCONTROLLER
LED
CIRCUIT
............................................................
41
2.2.1
CIRCUIT
POWER
SUPPLY
........................................................................................
44
2.2.2
DECOUPLING
CAPACITOR
.......................................................................................
45
2.3
A
FIRST
ASSEMBLY
LANGUAGE
PROGRAM
...................................................................
45
2.3.1
START
A
NEW
AVR
ASSEMBLER
PROJECT
IN
MICROCHIP
STUDIO
...............................
45
2.3.2
LED
BLINK
ASSEMBLY
CODE
..............................................................................
47
2.3.3
BUILD
THE
PROJECT
..............................................................................................
48
2.3.4
FIX
ANY
BUILD
ERRORS
.........................................................................................
49
2.3.5
LOAD
THE
PROGRAM
TO
THE
AVR
MICROCONTROLLER
.................................................
49
2.3.6
FAULT
FINDING
.....................................................................................................
50
2.4
A
FIRST
C
PROGRAM...................................................................................................
50
2.4.1
START
A
NEW
GCC
C
EXECUTABLE
PROJECT
IN
MICROCHIP
STUDIO
..........................
50
2.4.2
LED
BLINK
C
CODE
............................................................................................
51
2.4.3
BUILD
THE
PROJECT
...............................................................................................
53
2.4.4
FIX
ANY
BUILD
ERRORS
.........................................................................................
53
2.4.5
LOAD
THE
PROGRAM
TO
THE
AVR
MICROCONTROLLER
.................................................
53
2.4.6
FAULT
FINDING
.....................................................................................................
53
2.5
SUMMARY
..................................................................................................................
54
4
CHAPTER
3
YY
BASICS
OF
ASSEMBLY
LANGUAGE
55
3.1
MNEMONICS..............................................................................................................
56
3.2
AVR
INSTRUCTION
SET
................................................................................................
56
3.3
OPCODES
AND
OPERANDS
.........................................................................................
58
3.4
ASSEMBLY
LANGUAGE
COMMENTS...........................................................................
58
3.5
LED
BLINK
PROGRAM
OPERATION
..............................................................................
59
3.6
USING
THE
DEBUGGER
AND
SIMULATOR
......................................................................
61
3.6.1
USING
THE
AVR
SIMULATOR
AND
DEBUGGER
.........................................................
62
3.6.2
USING
A
PHYSICAL
AVR
MICROCONTROLLER
AND
DEBUGGER
.....................................
64
3.6.3
PUTTING
AN
AVR
BACK
INTO
ISP
MODE
...............................................................
67
3.7
SUMMARY
..................................................................................................................
67
CHAPTER
4
*
BINARY
NUMBERS
AND
MEMORY
69
4.1
BITS
AND
BYTES
........................................................................................................
70
4.1.1
COUNTING
IN
BINARY
...........................................................................................
70
4.1.2
BYTES
AND
NIBBLES
............................................................................................
73
4.2
WEIGHTED
NUMBER
SYSTEMS
...................................................................................
73
4.2.1
WEIGHTED
DECIMAL
NUMBERS
............................................................................
73
4.2.2
WEIGHTED
BINARY
NUMBERS...............................................................................
75
4.3
HEXADECIMAL
NUMBERS...........................................................................................
76
4.3.1
COUNTING
IN
HEXADECIMAL
.................................................................................
76
4.3.2
USING
HEXADECIMAL
TO
REPRESENT
BINARY
........................................................
76
4.4
CALCULATING
NUMBER
SIZES
.....................................................................................
79
4.4.1
CALCULATING
THE
MAXIMUM
VALUE
OF
A
BINARY
NUMBER
.....................................
79
4.4.2 CALCULATING
MEMORY
SIZE
.................................................................................
79
4.4.3 CONVERTING
BETWEEN
BYTES
AND
KILOBYTES
.......................................................
81
4.5
NUMBERS
IN
ASSEMBLY
PROGRAMS
..........................................................................
81
4.6
NUMBERS
IN
C
PROGRAMS........................................................................................
82
4.6
SUMMARY
...............................................................................................................
83
CHAPTER
5
YY
AVR
REGISTERS
AND
MEMORY
MAP
85
5.1
AVR
REGISTERS
.........................................................................................................
86
5.1.1
GENERAL
PURPOSE
WORKING
REGISTERS
..............................................................
86
5.1.2
I/O
REGISTERS
....................................................................................................
86
5.2
USING
GENERAL
PURPOSE
REGISTERS
........................................................................
86
5.2.1
ADDING
TWO
REGISTERS
......................................................................................
87
5
5.2.2
INCREMENTING
A
REGISTER
.................................................................................
90
5.3
AVR
MEMORY
MAP....................................................................................................
91
5.3.1
PROGRAM
MEMORY..............................................................................................
92
5.3.2
DATA
MEMORY....................................................................................................
93
5.3.3
EEPROM..........................................................................................................
94
5.4
ACCESSING
SRAM
IN
ASSEMBLER
PROGRAMS
...........................................................
94
5.4.1
SRAM
STORE
AND
LOAD
EXAMPLE
......................................................................
95
5.4.2
STORE
AND
LOAD
EXAMPLE
IN
THE
SIMULATOR
.......................................................
96
5.4.3
SRAM
START
ADDRESSES
.....................................................................................
97
5.5
SUMMARY..................................................................................................................
98
CHAPTER
6
YY
AVR
INTERNAL
ARCHITECTURE
99
6.1
CLOCK
PULSES
AND
PROGRAM
COUNTER
.........................................
100
6.1.1
CLOCK
PULSES
...................................................................................................
100
6.1.2
CLOCK
PULSE
PERIOD
AND
FREQUENCY
...............................................................
101
6.1.2.1
ATTINYL3(A)
DEFAULT
CLOCK
FREQUENCY
...................................................
101
6.1.2.2
ATTINY25/45/85
DEFAULT
CLOCK
FREQUENCY
..............................................
101
6.1.2.3
RC
OSCILLATOR
ACCURACY
..........................................................................
102
6.1.2.4
CLOCK
SOURCES
AND
IMPROVING
ACCURACY
...............................................
102
6.1.2.5
CALCULATING
CLOCK
PERIOD
FROM
FREQUENCY
............................................
102
6.1.2.6
CALCULATING
CLOCK
FREQUENCY
FROM
PERIOD
............................................
103
6.1.3
THE
PROGRAM
COUNTER
.....................................................................................
103
6.2
MICROCONTROLLER
BUSES
..........................................................................................
105
6.3
HARVARD
AND
VON
NEUMANN
ARCHITECTURES
.........................................................
106
6.4
FETCHING
AND
EXECUTING
INSTRUCTIONS
.................................................................
107
6.5
STATUS
REGISTER
......................................................................................................
109
6.5.1
ZERO
FLAG
........................................................................................................
109
6.5.2
NEGATIVE
FLAG
..................................................................................................
ILL
6.6
STACK
AND
STACK
POINTER
.......................................................................................
112
6.6.1
HOW
THE
STACK
WORKS
.....................................................................................
113
6.6.2
ACCESSING
THE
STACK
WITH
PUSH
AND
POP
.....................................................
114
6.6.3
CALLING
A
SUBROUTINE
.......................................................................................
117
6.7
LED
BLINK
PROGRAM
FULLY
EXPLAINED
...................................................................
121
6.8
AVR
INSTRUCTION
ENCODING
....................................................................................
124
6.9
ADDRESSING
MODES................................................................................................
129
6.9.1
REGISTER
DIRECT
ADDRESSING
..........................................................................
130
6
6.9.2
I/O
DIRECT
ADDRESSING
131
6.9.3
OTHER
ADDRESSING
MODES
132
6.10
SUMMARY
CHAPTER
7
ARITHMETIC
AND
LOGIC
INSTRUCTIONS
135
7.1
POSITIVE
AND
NEGATIVE
NUMBERS
136
7.1.1
L
S
COMPLIMENT
NUMBERS
136
7.1.2
2
S
COMPLIMENT
NUMBERS
136
7.2
ADDITION
139
7.2.1
ADD
-
ADD
WITHOUT
CARRY
139
7.2.2
ADC
-
ADD
WITH
CARRY
140
7.3
SUBTRACTION
142
7.4
LOGIC
INSTRUCTIONS
143
7.4.1
LOGICAL
AND
143
7.4.2
LOGICAL
OR
145
7.4.3
LOGICAL
EXCLUSIVE
OR
147
7.5
OTHER
ARITHMETIC
AND
LOGIC
INSTRUCTIONS
148
7.6
SUMMARY
148
CHAPTER
8
YY
PROGRAMMING
AVR
I/O
PORTS
149
8.1
INSTRUCTIONS
FOR
ACCESSING
I/O
REGISTERS
150
8.1.1
READING
AND
WRITING
I/O
REGISTERS
WITH
IN
AND
OUT
150
8.1.1.1
THE
IN
INSTRUCTION
150
8.1.1.2
THE
OUT
INSTRUCTION
151
8.1.2
I/O
REGISTER
BIT
MANIPULATION
AND
TESTING
152
8.1.3 ACCESSING
I/O
REGISTERS
AS
DATA
SPACE
152
8.2
I/O
PORTS
153
8.2.1
CONFIGURING
I/O
PINS
AS
OUTPUTS
IN
ASSEMBLER
154
8.2.1.1
FIVE
LED
8-PIN
ATTINY
CIRCUIT
154
8.2.1.2
USING
DEBUGWIRE
OR
ISP/SPI
TO
PROGRAM
AN
ATTINY
AVR
154
PROGRAM-ONLY
PROGRAMMERS
155
PERIPHERAL
HARDWARE
DEVICES
INTERFERING
WITH
PROGRAMMING
155
PUTTING
THE
AVR
INTO
DEBUGWIRE
MODE
156
8.2.1.3
BUILD
THE
5
LED
ATTINY
CIRCUIT
ON
BREADBOARD
156
8.2.1.4
ASSEMBLY
CODE
FOR
THE
5
LED
COUNT
CIRCUIT
157
8.2.1.5
SELECT
THE
DEBUGGER
OR
SIMULATOR
157
7
8.2.1.6
WHAT
THE
LED
COUNT
ASSEMBLER
CODE
DOES
........................................
157
8.2.1.7
BUILD
AND
RUN
THE
PROGRAM
...................................................................
158
8.2.1.8
HOW
THE
LED
COUNT
ASSEMBLER
PROGRAM
WORKS
..................................
158
8.2.1.9
USING
A
BREAKPOINT
IN
THE
DEBUGGER
.....................................................
161
8.2.2 CONFIGURING
I/O
PINS
AS
OUTPUTS
IN
C
............................................................
162
8.2.2.1
LED
COUNT
C
CODE
................................................................................
162
8.2.2.2
HOW
THE
LED
COUNT
C
CODE
WORKS
......................................................
163
8.2.2.3
RUNNING
THE
LED
COUNT
C
CODE
...........................................................
163
8.2.2.4
LED
COUNT
C
CODE
DISASSEMBLY
..........................................................
163
8.2.3
LIMITING
A
COUNT
VALUE
...................................................................................
171
8.2.4
THREE
WAYS
TO
TOGGLE
AN
LED
WITH
AN
AVR
.................................................
173
8.2.4.1
TOGGLING
AN
LED
BY
VALUE
....................................................................
173
8.2.4.2
TOGGLING
AN
LED
BY
EXCLUSIVE
OR
.......................................................
173
8.2.4.3
TOGGLING
AN
LED
WITH
THE
PINB
REGISTER
.............................................
175
8.2.5
CONFIGURING
I/O
PINS
AS
INPUTS
.......................................................................
177
8.3
SUMMARY..............................................................................................................
182
CHAPTER
9
YY
ASSEMBLY
LANGUAGE
ELEMENTS
183
9.1
INSTRUCTIONS
AND
LABELS
.......................................................................................
184
9.2
THE
PREPROCESSOR
AND
INCLUDE
FILES
..................................................................
185
9.3
ASSEMBLER
DIRECTIVES
...........................................................................................
187
9.3.1
SPECIFYING
CODE
AND
DATA
LOCATIONS
............................................................
188
9.3.1.1
ORG
ASSEMBLER
DIRECTIVE
......................................................................
188
9.3.1.2
CSEG
CODE
SEGMENT
DIRECTIVE
............................................................
189
9.3.1.3
DSEG
DATA
SEGMENT
AND
BYTE
DIRECTIVES
.........................................
190
9.3.1.4
ESEG
EEPROM
SEGMENT
DIRECTIVE
.....................................................
191
9.3.2
RESERVING
MEMORY
.........................................................................................
192
9.3.2.1
BYTE
......................................................................................................
192
9.3.2.2
DB
-
DEFINE
CONSTANT
BYTE
...................................................................
192
MODIFIED
HARVARD
ARCHITECTURE
......................................................................
192
EXAMPLE
CODE
USING
THE
DB
ASSEMBLER
DIRECTIVE
.......................................
192
CSEG
DIRECTIVE
AND
FIRST
RJMP
INSTRUCTION
................................................
192
USAGE
OF
THE
DB
ASSEMBLER
DIRECTIVE
..........................................................
193
DATA
FORMATS
AND
NULL
TERMINATING
STRINGS
.................................................
193
LOCATION
OF
DB
DATA
IN
PROGRAM
MEMORY
AND
ALIGNMENT
............................
194
16-BIT
ADDRESS
POINTER
REGISTERS
.................................................................
194
8
LOADING
THE
Z
REGISTER
.................................................................................
195
READING
BYTES
FROM
PROGRAM
MEMORY........................................................
195
RUNNING
THE
EXAMPLE
CODE
.........................................................................
196
9.3.2.3
DW
-
DEFINE
CONSTANT
WORD
.................................................................
199
9.3.2.4
DD
-
DEFINE
CONSTANT
DOUBLE-WORD
.....................................................
199
9.3.2.5
DQ
-
DEFINE
CONSTANT
QUAD-WORD
........................................................
199
9.3.3
DEFINING
NAMES
FOR
REGISTERS
WITH
DEF.......................................................
200
9.3.4
EQUATING
NAMES
TO
EXPRESSIONS
USING
EQU
AND
SET
.................................
200
9.3.5
CONDITIONAL
ASSEMBLY
....................................................................................
201
9.4
OTHER
ASSEMBLY
LANGUAGE
ELEMENTS
.................................................................
203
9.5
FURTHER
READING
....................................................................................................
204
9.6
SUMMARY
...............................................................................................................
204
CHAPTER
10
YY
AVR
TIMING,
TIMERS
AND
INTERRUPTS
205
10.1
INSTRUCTION
TIMING
..............................................................................................
206
10.1.1
AVR
CPU
VERSIONS
......................................................................................
206
10.1.2
INSTRUCTION
TIMING
EXAMPLES
.......................................................................
206
10.1.2.1
THE
NOP
INSTRUCTION
............................................................................
206
10.1.2.2
16-BIT
AND
32-BIT
INSTRUCTION
TIMING
....................................................
208
10.1.2.3
TIMING
OF
BRANCH
INSTRUCTIONS
.............................................................
208
THE
SIMULATOR
CYCLE
COUNTER
AND
STOP
WATCH
............................................
210
SIMULATOR
CYCLE
COUNTER
BUG
.......................................................................
211
10.2
ASSEMBLY
LANGUAGE
TIME
DELAY
......................................................................
213
10.2.1
CALCULATING
A
SOFTWARE
DELAY
SUBROUTINE
TIME
DELAY
................................
213
10.2.1.1
DELAY
SUBROUTINE
CYCLE
COUNTER
MEASUREMENT
.................................
214
10.2.1.2
DELAY
SUBROUTINE
MATHEMATICAL
FORMULA
...........................................
215
10.2.2
A
BETTER
SOFTWARE
DELAY
SUBROUTINE
...........................................................
226
10.2.2.1
PRINCIPLE
OF
OPERATION
.........................................................................
227
10.2.2.2
32-BIT
SUBTRACTION
WITH
8-BIT
REGISTERS
...............................................
227
10.2.2.3
TIMING
OF
THE
CODE
..............................................................................
229
10.2.2.4
TESTING
THE
CODE
IN
MICROCHIP
STUDIO
.................................................
230
10.2.3
A
CHANGEABLE
SOFTWARE
TIME
DELAY
SUBROUTINE
.........................................
231
10.2.3.1
SPLITTING
AN
ASSEMBLY
LANGUAGE
PROJECT
INTO
FILES
............................
234
10.2.3.2
HOW
THE
WAIT_MS
SUBROUTINE
WORKS
...................................................
235
10.2.3.3
LIMITS
OF
THE
WAIT_MS
SUBROUTINE
.......................................................
237
SIMPLIFYING
THE
FORMULA
..............................................................................
238
9
CALCULATING
THE
MAXIMUM
DELAY
TIME
OF
THE
SUBROUTINE
............................
238
POSING
VALUE
LIMITS
IN
ASSEMBLY
LANGUAGE
................................................
240
NUMBER
SIZE
LIMITS
IN
THE
ASSEMBLER
PROGRAM
...........................................
243
SOLUTION
TO
FLAGGING
OUT
OF
RANGE
UPPER
VALUES
........................................
246
FLAGGING
OUT
OF
RANGE
HIGH
AND
LOW
VALUES
..............................................
247
10.2.4
PASSING
A
VALUE
TO
A
SUBROUTINE
...............................................................
251
10.2.4.1
SIMPLEST
WAY
TO
PASS
A
VALUE
............................................................
251
10.2.4.2
IMPROVED
WAY
TO
PASS
A
VALUE
...........................................................
253
10.3
CALLING
AN
ASSEMBLY
SUBROUTINE
FROM
C
CODE
...............................................
261
10.3.1
PASSING
A
VALUE
TO
AN
ASSEMBLY
SUBROUTINE
FROM
C
..................................
261
10.3.1.1
TESTING
THE
WAIT_MS_C
PROJECT
CODE
...................................................
263
10.3.1.2
HOW
THE
WAIT_MS_C
PROJECT
CODE
WORKS
............................................
264
10.3.2
RETURNING
A
VALUE
FROM
AN
ASSEMBLY
SUBROUTINE
IN
C
................................
266
10.4
POLLED
TIMER
DELAY
..............................................................................................
268
10.4.1
TIMER/COUNTERO
REGISTERS
............................................................................
268
10.4.1.1
TIMER/COUNTERO
REGISTER
ADDRESSES
...................................................
269
10.4.1.2
USING
COUNTER/TIMERO
AS
A
TIMER
.......................................................
270
10.4.2
POLLED
TIMER
ASSEMBLY
PROGRAM
..................................................................
271
10.4.2.1
THE
IFNDEF
DIRECTIVE
.........................................................................
271
10.4.2.2
LEFT
SHIFT
OPERATOR
...............................................................................
272
10.4.2.3
REGISTER
WRITE
OR
READ-MODIFY-WRITE
..................................................
273
10.4.2.4
INITIALIZING
TIMER
0
................................................................................
273
10.4.2.5
POLLING
TIMER
0
.....................................................................................
275
10.4.2.6
RUNNING
THE
CODE
IN
THE
SIMULATOR
.....................................................
276
10.4.3
POLLED
TIMER
C
PROGRAM
...............................................................................
276
10.5
TIMER
INTERRUPT
DELAY
..........................................................................................
277
10.5.1
HOW
INTERRUPTS
WORK
.....................................................................................
278
10.5.2
THE
INTERRUPT
VECTOR
TABLE
...........................................................................
278
10.5.3
ASSEMBLY
PROGRAM
TIMER
INTERRUPT
..............................................................
279
10.5.3.1
ATTINYL3(A)
TIMER
INTERRUPT
PROJECT
.....................................................
279
THE
INTERRUPT
VECTOR
TABLE
............................................................................
280
MAIN
PROGRAM
CODE
......................................................................................
282
INTERRUPT
SERVICE
ROUTINE
CODE
....................................................................
282
RUNNING
THE
TIMER
INTERRUPT
CODE
...............................................................
283
10.5.3.2
ATTINY25/45/85
TIMER
INTERRUPT
PROJECT
...............................................
283
10.5.3.3
UNIVERSAL
TIMER
INTERRUPT
PROJECT
........................................................
285
10
10.5.4
C
PROGRAM
TIMER
INTERRUPT
...........................................................................
286
10.6
SUMMARY...........................................................................................................
288
CHAPTER
11
*
THE
AVR
INSTRUCTION
SET
289
11.1
AVR
INSTRUCTION
SET
OVERVIEW
AND
CATEGORIES
...............................................
290
11.2
A
GUIDED
TOUR
THROUGH
THE
ATTINY
AVR
INSTRUCTION
SET
.................................
290
11.2.1
ARITHMETIC
AND
LOGIC
INSTRUCTIONS
................................................................
290
11.2.1.1
ADD
AND
SUBTRACT
INSTRUCTIONS
.............................................................
290
ADDITION
INSTRUCTIONS
.....................................................................................
290
SUBTRACTION
INSTRUCTIONS
...............................................................................
293
11.2.1.2
LOGICAL
INSTRUCTIONS
.............................................................................
294
LOGICAL
AND
..................................................................................................
294
LOGICAL
OR
....................................................................................................
294
LOGICAL
EXCLUSIVE
OR
...................................................................................
294
11.2.1.3
INCREMENT
AND
DECREMENT
INSTRUCTIONS
...............................................
294
11.2.1.4
SIGN
CHANGE
INSTRUCTIONS
....................................................................
294
11.2.1.5
BIT
SET
AND
CLEAR
INSTRUCTIONS
.............................................................
295
11.2.1.6
REGISTER
SET,
CLEAR
AND
TEST
INSTRUCTIONS
...........................................
296
11.2.2
BRANCH
INSTRUCTIONS
......................................................................................
297
11.2.2.1
JUMP
INSTRUCTIONS
................................................................................
297
11.2.2.2
SUBROUTINE
CALL
INSTRUCTIONS
................................................................
299
11.2.2.3
RETURN
FROM
SUBROUTINE
AND
INTERRUPT
INSTRUCTIONS
.............................
300
11.2.2.4
COMPARE
INSTRUCTIONS
..........................................................................
300
11.2.2.5
SKIP
INSTRUCTIONS
..................................................................................
301
11.2.2.6
BRANCH
INSTRUCTIONS
.............................................................................
302
BRANCH
IF
BIT
IN
SREG
SET
OR
CLEARED
..........................................................
302
BRANCH
IF
EQUAL
OR
NOT
EQUAL
-
SREG
Z
FLAG
.............................................
303
BRANCH
IF
CARRY
SET
OR
CLEARED
-
SREG
C
FLAG
..........................................
303
BRANCH
IF
SAME
OR
HIGHER,
OR
LOWER
-
SREG
C
FLAG
..................................
303
BRANCH
IF
MINUS
OR
PLUS
-
SREG
N
FLAG
......................................................
304
BRANCH
IF
GREATER
OR
EQUAL,
OR
LESS
THAN
SIGNED
-
SREG
S
FLAG
.............
304
BRANCH
IF
HALF
CARRY
FLAG
SET
OR
CLEARED
-
SREG
H
FLAG
..........................
304
BRANCH
IF
T
BIT
SET
OR
CLEARED
-
SREG
T
FLAG
............................................
304
BRANCH
IF
OVERFLOW
FLAG
SET
OR
CLEARED
-
SREG
V
FLAG
............................
304
BRANCH
IF
INTERRUPT
ENABLED
OR
DISABLED
-
SREG
I
FLAG
.............................
304
11.2.3
BIT
AND
BIT-TEST
INSTRUCTIONS
.........................................................................
305
11
11.2.3.1
BIT
SET
AND
CLEAR
INSTRUCTIONS
..............................................................
305
11.2.3.2
SHIFT,
ROTATE
AND
SWAP
INSTRUCTIONS
....................................................
305
LOGICAL
SHIFT
INSTRUCTIONS
..............................................................................
305
ROTATE
THROUGH
CARRY
INSTRUCTIONS
................................................................
305
LOGICAL
SHIFT
AND
ROTATE
CODE
EXAMPLE
......................................................
305
LED
CHASER
LOGICAL
SHIFT
CODE
EXAMPLE
.....................................................
306
ARITHMETIC
SHIFT
AND
SWAP
INSTRUCTIONS
........................................................
310
11.2.3.3
STATUS
REGISTER
BIT
SET
AND
CLEAR
INSTRUCTIONS
...................................
310
SET
OR
CLEAR
SREG
BIT
..................................................................................
310
STORE
OR
LOAD
SREG
T
BIT
TO/FROM
REGISTER
.................................................
310
SET
OR
CLEAR
CARRY
FLAG
-
SREG
C
BIT
.........................................................
311
SET
OR
CLEAR
NEGATIVE
FLAG
-
SREG
N
BIT
...................................................
311
SET
OR
CLEAR
ZERO
FLAG
-
SREG
Z
BIT
...........................................................
311
SET
OR
CLEAR
GLOBAL
INTERRUPT
FLAG
BIT
-
SREG
I
BIT
....................................
311
SET
OR
CLEAR
SIGN
FLAG
-
SREG
S
BIT
...........................................................
312
SET
OR
CLEAR
TWO
S
COMPLIMENT
OVERFLOW
FLAG
-
SREG
V
BIT
......................
312
SET
OR
CLEAR
T
BIT
IN
SREG
-
SREG
T
BIT
....................................................
312
SET
AND
CLEAR
HALF
CARRY
FLAG
-
SREG
H
BIT
...............................................
312
11.2.4
DATA
TRANSFER
INSTRUCTIONS
............................................................................
312
11.2.4.1
MOVE/COPY
INSTRUCTIONS
.......................................................................
312
11.2.4.2
LOAD
IMMEDIATE
INSTRUCTION
.................................................................
313
11.2.4.3
LOAD
INDIRECT
INSTRUCTIONS
....................................................................
313
11.2.4.4
STORE
INDIRECT
INSTRUCTIONS
...................................................................
314
11.2.4.5
LOAD
INDIRECT
WITH
DISPLACEMENT
.........................................................
315
11.2.4.6
STORE
INDIRECT
WITH
DISPLACEMENT
.........................................................
315
11.2.4.7
LOAD
DIRECT
FROM
SRAM
.......................................................................
315
11.2.4.8
STORE
DIRECT
TO
SRAM
..........................................................................
316
11.2.4.9
LOAD
PROGRAM
MEMORY
INSTRUCTIONS
....................................................
316
11.2.4.10
STORE
PROGRAM
MEMORY......................................................................
316
11.2.4.11
PORT
IN
AND
OUT
INSTRUCTIONS
............................................................
316
11.2.4.12
PUSH
AND
POP
INSTRUCTIONS
..............................................................
317
11.2.5
MCU
CONTROL
INSTRUCTIONS
.............................................................................
317
11.3
ENTIRE
AVR
INSTRUCTION
SET
...............................................................................
318
11.3.1
NUMBER
OF
AVR
INSTRUCTIONS
.......................................................................
318
11.3.1.1
TOTAL
NUMBER
OF
AVR
INSTRUCTIONS
.......................................................
318
11.3.1.2
NUMBER
OF
ATTINY
AVR
INSTRUCTIONS
.....................................................
318
12
11.3.1.3
DISCREPANCIES
IN
DOCUMENTATION
......................................................
318
11.3.2
OTHER
AVR
INSTRUCTIONS
................................................................................
319
11.3.2.1
ARITHMETIC
AND
LOGIC
INSTRUCTIONS
........................................................
319
11.3.2.2
BRANCH
INSTRUCTIONS
.............................................................................
319
11.3.2.3
DATA
TRANSFER
INSTRUCTIONS
...................................................................
320
11.3.3
PUTTING
INSTRUCTIONS
INTO
PERSPECTIVE
...........................................................
321
11.3.3.1
THE
FULL
AVR
INSTRUCTION
SET
...............................................................
321
11.3.3.2
THE
PLAIN
AVR
CPU
.............................................................................
321
11.3.3.3
REDUCED
AVRRC
CORE
..........................................................................
321
11.3.3.4
AVRE
AND
AVRXT
CORES
.......................................................................
321
11.3.3.5
AVRE+
CPU.........................................................................................
322
11.3.3.6
AVRXM
CPU
.........................................................................................
322
CHAPTER
12
*
SOFTWARE
TOOLS
AND
SETTINGS
323
12.1
AVR
ASSEMBLER
PROGRAMS................................................................................
324
12.1.1
THE
AVRASM2
ASSEMBLER
..........................................................................
324
12.1.1.1
BUILDING
A
PROJECT
WITH
AVRASM2
......................................................
324
12.1.1.2
AVRASM2
ON
THE
COMMAND
LINE
......................................................
326
12.1.1.3
AVRASM2
OPTIONS
IN
MICROCHIP
STUDIO
..............................................
327
12.1.1.4
LIST
FILE
OPTIONS
..................................................................................
328
12.1.2
THE
AVR-AS
ASSEMBLER
...............................................................................
329
12.1.3
THE
AVRA
ASSEMBLER
...................................................................................
329
12.2
THE
GNU
C
TOOLCHAIN
.........................................................................................
329
12.3
WHERE
TO
FROM
HERE?
..........................................................................................
330
12.3.1
OBJECTIVES
ACHIEVED
....................................................................................
330
12.3.2
WHAT
WAS
NOT
COVERED
................................................................................
332
12.3.3
OTHER
AVR
MICROCONTROLLERS
.........................................................................
332
12.3.4
ASSEMBLY
LANGUAGE
RESOURCES
..................................................................
332
APPENDIX
A
*
EXTERNAL
PROGRAMMER
SETUP
333
A.
L
HOBBY
USB
PROGRAMMER
CAPABILITIES
...............................................................
334
A.
1.1
DIFFERENCES
BETWEEN
HOBBY
PROGRAMMERS
AND
THE
ATMEL-ICE
...................
334
A.L.
2
PROGRAMMING
INTERFACES
................................................................................
335
A.
1.3
USING
HOBBY
USB
PROGRAMMERS
WITH
THIS
BOOK
..........................................
335
A.2
OVERVIEW
OF
EXTERNAL
PROGRAMMER
SETUP
.........................................................
336
A.3
EXTERNAL
PROGRAMMER
SETUP
...............................................................................
336
13
A.
3.1
INSTALL
A
DRIVER
................................................................................................
336
A.
3.1.1
USBASP
DRIVER
.......................................................................................
336
A.3.1.2
USBTINYISP
DRIVER
.................................................................................
339
A.3.
1.3
ARDUINO
UNO
SKETCH
...............................................................................
341
A.3.2
DOWNLOAD
AND
INSTALL
AVRDUDE
.......................................................................
342
A.3.3
BUILD
AN
AVR
CIRCUIT
AND
CONNECT
A
PROGRAMMER
........................................
343
A.
3.3.1
CONNECTING
A
USBASP
...........................................................................
344
10-PIN
MALE
HEADER
......................................................................................
344
10-PIN
FEMALE
CONNECTOR
ON
RIBBON
CABLE
................................................
344
6-PIN
ADAPTER
(ISP/SPI)
................................................................................
345
A.3.3.
2
CONNECTING
A
USBTINYISP
.....................................................................
345
6-PIN
MALE
HEADER
........................................................................................
345
6-PIN
FEMALE
CONNECTOR
ON
RIBBON
CABLE
..................................................
345
A.3.3.
3
CONNECTING
AN
ARDUINO
UNO
ARDUINOISP
..............................................
345
A.
3.4
PROGRAMMING
PARAMETERS
..............................................................................
346
A.3.4.1
DOCUMENTATION
FOR
AVRDUDE
...................................................................
346
A.3.4.2
PARAMETERS
FOR
AVRDUDE
EXPLAINED
.......................................................
346
A.3.4.3
PARAMETERS
FOR
A
USBASP
.....................................................................
349
A.3.4.4
PARAMETERS
FOR
A
USBTINYISP
...............................................................
350
A.3.4.5
PARAMETERS
FOR
AN
ARDUINOISP
..............................................................
350
A.3.5
MICROCHIP
STUDIO
EXTERNAL
TOOL
SETUP
...........................................................
350
A.3.5.1
OPEN
AN
ASSEMBLY
OR
C
PROJECT
............................................................
351
A.3.5.
2
ADD
AN
EXTERNAL
TOOL
IN
MICROCHIP
STUDIO
.............................................
351
USBASP.........................................................................................................
352
USBTINYISP
...................................................................................................
352
ARDUINOISP
(ARDUINO
UNO
WITH
ARDUINOISP
SKETCH
LOADED)
.........................
352
A.3.5.
3
ADD
A
TOOLBAR
BUTTON
FOR
THE
EXTERNAL
TOOL
...........................................
353
A.
3.6
TESTING
THE
PROGRAMMER
................................................................................
355
A.
3.7
PROGRAMMING
PROBLEMS
AND
SOLUTIONS
..........................................................
355
APPENDIX
B
ALTERNATE
CIRCUITS
AND
PROGRAMS
357
B.
L
8-PIN
PDIP
ATTINYL3/25/45/85
..............................................................................
358
B.
2
14-PIN
PDIP
ATTINY24/44/84
.................................................................................
359
B.3
20-PIN
PDIP
ATTINY26/261/461/861
AND
ATTINY2313/4313
.................................
360
B.4
28-PIN
PDIP
ATTINY48/88
......................................................................................
361
B.5
ALTERNATE
PROGRAMS
..............................................................................................
362
14
B.5.1
ALTERNATE
LED
BLINK
ASSEMBLY
PROGRAM
.......................................................
363
B.
5.2
ALTERNATE
LED
BLINK
C
PROGRAM
....................................................................
363
APPENDIX
C
YY
THE
ASCII
TABLE
365
C.
L
PRINTABLE
CHARACTERS
...........................................................................................
365
C.
2
ASCII
TABLE...........................................................................................................
365
INDEX
367
15
|
adam_txt |
INTRODUCTION
17
BROAD
OVERVIEW
OF
THIS
BOOK.
18
ABOUT
THE
TARGETED
AVR
MICROCONTROLLERS
.
18
PRIMARY
PROGRAMMING
SOFTWARE
.
19
WHY
LEARN
ASSEMBLY
LANGUAGE?
.
.19
THE
MANY
REASONS
FOR
LEARNING
ASSEMBLY
LANGUAGE
.
19
C
PROGRAMMING
.
21
INTENDED
AUDIENCE
.
21
PREREQUISITES
.
21
SOFTWARE
REQUIREMENTS
.
22
HARDWARE
REQUIREMENTS
.
22
A
DIP
PACKAGED
ATTINY
.
23
AN
ELECTRONIC
BREADBOARD.
23
PROGRAMMER/DEBUGGER
.
23
ATMEL-ICE
BASIC
KIT
.
24
ATMEL-ICE
FULL
KIT
.
24
AVR
DRAGON
.
25
AVRISP
MKLL
.
25
HOBBYIST
USB
PROGRAMMERS.
25
POWER
SUPPLY
.
26
JUMPER
LINKS
AND
WIRES
.
27
ELECTRONIC
COMPONENTS
.
28
OPTIONAL
TEST
EQUIPMENT
.
28
MICROCHIP,
ATMEL,
MICROCHIP
STUDIO
AND
ATMEL
STUDIO
.
28
ACCOMPANYING
RESOURCES.
29
LET
'
S
GET
STARTED
.
29
CHAPTER
1
YY
OVERVIEW
OF
ATTINY
MICROCONTROLLERS
31
1.1
ATTINY
MICROCONTROLLERS
.
32
1.1.1
8-PIN
DEVICES
.
33
1.1.1.1
ATTINYL3
AND
ATTINYL3A
.
33
1.1.1.2
ATTINY25,
ATTINY45
AND
ATTINY85
.
33
1.1.2
14-PIN
ATTINY24,
ATTINY44
AND
ATTINY84
.
34
3
1.1.3
20-PIN
DEVICES
.
34
1.1.3.1
ATTINY26
.
34
1.1.3.2
ATTINY261,
ATTINY461
AND
ATTINY861
.
35
1.1.3.3
ATTINY2313
AND
ATTINY4313
.
35
1.1.4
28-PIN
DEVICES
.
36
1.1.4.1
ATTINY48
AND
ATTINY88
.
36
1.1.4.2
ATTINY28L
AND
ATTINY28V
.
36
1.2
WHICH
ATTINY
TO
USE
.
36
1.3
COMPARISON
OF
ATTINY
DEVICES
.
37
1.4
SUMMARY.
38
CHAPTER
2
*
HARDWARE
AND
SOFTWARE
SETUP
39
2.1
INSTALL
MICROCHIP
STUDIO
.
40
2.1.1
DOWNLOAD
PAGE
AND
SOFTWARE
VERSION
.
40
2.1.2
NEWEST
SOFTWARE
VERSION
.
40
2.1.3
START
THE
INSTALLATION
.
40
2.1.4
INSTALLATION
STEPS
.
40
2.2
8-PIN
ATTINY
MICROCONTROLLER
LED
CIRCUIT
.
41
2.2.1
CIRCUIT
POWER
SUPPLY
.
44
2.2.2
DECOUPLING
CAPACITOR
.
45
2.3
A
FIRST
ASSEMBLY
LANGUAGE
PROGRAM
.
45
2.3.1
START
A
NEW
AVR
ASSEMBLER
PROJECT
IN
MICROCHIP
STUDIO
.
45
2.3.2
LED
BLINK
ASSEMBLY
CODE
.
47
2.3.3
BUILD
THE
PROJECT
.
48
2.3.4
FIX
ANY
BUILD
ERRORS
.
49
2.3.5
LOAD
THE
PROGRAM
TO
THE
AVR
MICROCONTROLLER
.
49
2.3.6
FAULT
FINDING
.
50
2.4
A
FIRST
C
PROGRAM.
50
2.4.1
START
A
NEW
GCC
C
EXECUTABLE
PROJECT
IN
MICROCHIP
STUDIO
.
50
2.4.2
LED
BLINK
C
CODE
.
51
2.4.3
BUILD
THE
PROJECT
.
53
2.4.4
FIX
ANY
BUILD
ERRORS
.
53
2.4.5
LOAD
THE
PROGRAM
TO
THE
AVR
MICROCONTROLLER
.
53
2.4.6
FAULT
FINDING
.
53
2.5
SUMMARY
.
54
4
CHAPTER
3
YY
BASICS
OF
ASSEMBLY
LANGUAGE
55
3.1
MNEMONICS.
56
3.2
AVR
INSTRUCTION
SET
.
56
3.3
OPCODES
AND
OPERANDS
.
58
3.4
ASSEMBLY
LANGUAGE
COMMENTS.
58
3.5
LED
BLINK
PROGRAM
OPERATION
.
59
3.6
USING
THE
DEBUGGER
AND
SIMULATOR
.
61
3.6.1
USING
THE
AVR
SIMULATOR
AND
DEBUGGER
.
62
3.6.2
USING
A
PHYSICAL
AVR
MICROCONTROLLER
AND
DEBUGGER
.
64
3.6.3
PUTTING
AN
AVR
BACK
INTO
ISP
MODE
.
67
3.7
SUMMARY
.
67
CHAPTER
4
*
BINARY
NUMBERS
AND
MEMORY
69
4.1
BITS
AND
BYTES
.
70
4.1.1
COUNTING
IN
BINARY
.
70
4.1.2
BYTES
AND
NIBBLES
.
73
4.2
WEIGHTED
NUMBER
SYSTEMS
.
73
4.2.1
WEIGHTED
DECIMAL
NUMBERS
.
73
4.2.2
WEIGHTED
BINARY
NUMBERS.
75
4.3
HEXADECIMAL
NUMBERS.
76
4.3.1
COUNTING
IN
HEXADECIMAL
.
76
4.3.2
USING
HEXADECIMAL
TO
REPRESENT
BINARY
.
76
4.4
CALCULATING
NUMBER
SIZES
.
79
4.4.1
CALCULATING
THE
MAXIMUM
VALUE
OF
A
BINARY
NUMBER
.
79
4.4.2 CALCULATING
MEMORY
SIZE
.
79
4.4.3 CONVERTING
BETWEEN
BYTES
AND
KILOBYTES
.
81
4.5
NUMBERS
IN
ASSEMBLY
PROGRAMS
.
81
4.6
NUMBERS
IN
C
PROGRAMS.
82
4.6
SUMMARY
.
83
CHAPTER
5
YY
AVR
REGISTERS
AND
MEMORY
MAP
85
5.1
AVR
REGISTERS
.
86
5.1.1
GENERAL
PURPOSE
WORKING
REGISTERS
.
86
5.1.2
I/O
REGISTERS
.
86
5.2
USING
GENERAL
PURPOSE
REGISTERS
.
86
5.2.1
ADDING
TWO
REGISTERS
.
87
5
5.2.2
INCREMENTING
A
REGISTER
.
90
5.3
AVR
MEMORY
MAP.
91
5.3.1
PROGRAM
MEMORY.
92
5.3.2
DATA
MEMORY.
93
5.3.3
EEPROM.
94
5.4
ACCESSING
SRAM
IN
ASSEMBLER
PROGRAMS
.
94
5.4.1
SRAM
STORE
AND
LOAD
EXAMPLE
.
95
5.4.2
STORE
AND
LOAD
EXAMPLE
IN
THE
SIMULATOR
.
96
5.4.3
SRAM
START
ADDRESSES
.
97
5.5
SUMMARY.
98
CHAPTER
6
YY
AVR
INTERNAL
ARCHITECTURE
99
6.1
CLOCK
PULSES
AND
PROGRAM
COUNTER
.
100
6.1.1
CLOCK
PULSES
.
100
6.1.2
CLOCK
PULSE
PERIOD
AND
FREQUENCY
.
101
6.1.2.1
ATTINYL3(A)
DEFAULT
CLOCK
FREQUENCY
.
101
6.1.2.2
ATTINY25/45/85
DEFAULT
CLOCK
FREQUENCY
.
101
6.1.2.3
RC
OSCILLATOR
ACCURACY
.
102
6.1.2.4
CLOCK
SOURCES
AND
IMPROVING
ACCURACY
.
102
6.1.2.5
CALCULATING
CLOCK
PERIOD
FROM
FREQUENCY
.
102
6.1.2.6
CALCULATING
CLOCK
FREQUENCY
FROM
PERIOD
.
103
6.1.3
THE
PROGRAM
COUNTER
.
103
6.2
MICROCONTROLLER
BUSES
.
105
6.3
HARVARD
AND
VON
NEUMANN
ARCHITECTURES
.
106
6.4
FETCHING
AND
EXECUTING
INSTRUCTIONS
.
107
6.5
STATUS
REGISTER
.
109
6.5.1
ZERO
FLAG
.
109
6.5.2
NEGATIVE
FLAG
.
ILL
6.6
STACK
AND
STACK
POINTER
.
112
6.6.1
HOW
THE
STACK
WORKS
.
113
6.6.2
ACCESSING
THE
STACK
WITH
PUSH
AND
POP
.
114
6.6.3
CALLING
A
SUBROUTINE
.
117
6.7
LED
BLINK
PROGRAM
FULLY
EXPLAINED
.
121
6.8
AVR
INSTRUCTION
ENCODING
.
124
6.9
ADDRESSING
MODES.
129
6.9.1
REGISTER
DIRECT
ADDRESSING
.
130
6
6.9.2
I/O
DIRECT
ADDRESSING
131
6.9.3
OTHER
ADDRESSING
MODES
132
6.10
SUMMARY
CHAPTER
7
ARITHMETIC
AND
LOGIC
INSTRUCTIONS
135
7.1
POSITIVE
AND
NEGATIVE
NUMBERS
136
7.1.1
L
'
S
COMPLIMENT
NUMBERS
136
7.1.2
2
'
S
COMPLIMENT
NUMBERS
136
7.2
ADDITION
139
7.2.1
ADD
-
ADD
WITHOUT
CARRY
139
7.2.2
ADC
-
ADD
WITH
CARRY
140
7.3
SUBTRACTION
142
7.4
LOGIC
INSTRUCTIONS
143
7.4.1
LOGICAL
AND
143
7.4.2
LOGICAL
OR
145
7.4.3
LOGICAL
EXCLUSIVE
OR
147
7.5
OTHER
ARITHMETIC
AND
LOGIC
INSTRUCTIONS
148
7.6
SUMMARY
148
CHAPTER
8
YY
PROGRAMMING
AVR
I/O
PORTS
149
8.1
INSTRUCTIONS
FOR
ACCESSING
I/O
REGISTERS
150
8.1.1
READING
AND
WRITING
I/O
REGISTERS
WITH
IN
AND
OUT
150
8.1.1.1
THE
IN
INSTRUCTION
150
8.1.1.2
THE
OUT
INSTRUCTION
151
8.1.2
I/O
REGISTER
BIT
MANIPULATION
AND
TESTING
152
8.1.3 ACCESSING
I/O
REGISTERS
AS
DATA
SPACE
152
8.2
I/O
PORTS
153
8.2.1
CONFIGURING
I/O
PINS
AS
OUTPUTS
IN
ASSEMBLER
154
8.2.1.1
FIVE
LED
8-PIN
ATTINY
CIRCUIT
154
8.2.1.2
USING
DEBUGWIRE
OR
ISP/SPI
TO
PROGRAM
AN
ATTINY
AVR
154
PROGRAM-ONLY
PROGRAMMERS
155
PERIPHERAL
HARDWARE
DEVICES
INTERFERING
WITH
PROGRAMMING
155
PUTTING
THE
AVR
INTO
DEBUGWIRE
MODE
156
8.2.1.3
BUILD
THE
5
LED
ATTINY
CIRCUIT
ON
BREADBOARD
156
8.2.1.4
ASSEMBLY
CODE
FOR
THE
5
LED
COUNT
CIRCUIT
157
8.2.1.5
SELECT
THE
DEBUGGER
OR
SIMULATOR
157
7
8.2.1.6
WHAT
THE
LED
COUNT
ASSEMBLER
CODE
DOES
.
157
8.2.1.7
BUILD
AND
RUN
THE
PROGRAM
.
158
8.2.1.8
HOW
THE
LED
COUNT
ASSEMBLER
PROGRAM
WORKS
.
158
8.2.1.9
USING
A
BREAKPOINT
IN
THE
DEBUGGER
.
161
8.2.2 CONFIGURING
I/O
PINS
AS
OUTPUTS
IN
C
.
162
8.2.2.1
LED
COUNT
C
CODE
.
162
8.2.2.2
HOW
THE
LED
COUNT
C
CODE
WORKS
.
163
8.2.2.3
RUNNING
THE
LED
COUNT
C
CODE
.
163
8.2.2.4
LED
COUNT
C
CODE
DISASSEMBLY
.
163
8.2.3
LIMITING
A
COUNT
VALUE
.
171
8.2.4
THREE
WAYS
TO
TOGGLE
AN
LED
WITH
AN
AVR
.
173
8.2.4.1
TOGGLING
AN
LED
BY
VALUE
.
173
8.2.4.2
TOGGLING
AN
LED
BY
EXCLUSIVE
OR
.
173
8.2.4.3
TOGGLING
AN
LED
WITH
THE
PINB
REGISTER
.
175
8.2.5
CONFIGURING
I/O
PINS
AS
INPUTS
.
177
8.3
SUMMARY.
182
CHAPTER
9
YY
ASSEMBLY
LANGUAGE
ELEMENTS
183
9.1
INSTRUCTIONS
AND
LABELS
.
184
9.2
THE
PREPROCESSOR
AND
INCLUDE
FILES
.
185
9.3
ASSEMBLER
DIRECTIVES
.
187
9.3.1
SPECIFYING
CODE
AND
DATA
LOCATIONS
.
188
9.3.1.1
ORG
ASSEMBLER
DIRECTIVE
.
188
9.3.1.2
CSEG
CODE
SEGMENT
DIRECTIVE
.
189
9.3.1.3
DSEG
DATA
SEGMENT
AND
BYTE
DIRECTIVES
.
190
9.3.1.4
ESEG
EEPROM
SEGMENT
DIRECTIVE
.
191
9.3.2
RESERVING
MEMORY
.
192
9.3.2.1
BYTE
.
192
9.3.2.2
DB
-
DEFINE
CONSTANT
BYTE
.
192
MODIFIED
HARVARD
ARCHITECTURE
.
192
EXAMPLE
CODE
USING
THE
DB
ASSEMBLER
DIRECTIVE
.
192
CSEG
DIRECTIVE
AND
FIRST
RJMP
INSTRUCTION
.
192
USAGE
OF
THE
DB
ASSEMBLER
DIRECTIVE
.
193
DATA
FORMATS
AND
NULL
TERMINATING
STRINGS
.
193
LOCATION
OF
DB
DATA
IN
PROGRAM
MEMORY
AND
ALIGNMENT
.
194
16-BIT
ADDRESS
POINTER
REGISTERS
.
194
8
LOADING
THE
Z
REGISTER
.
195
READING
BYTES
FROM
PROGRAM
MEMORY.
195
RUNNING
THE
EXAMPLE
CODE
.
196
9.3.2.3
DW
-
DEFINE
CONSTANT
WORD
.
199
9.3.2.4
DD
-
DEFINE
CONSTANT
DOUBLE-WORD
.
199
9.3.2.5
DQ
-
DEFINE
CONSTANT
QUAD-WORD
.
199
9.3.3
DEFINING
NAMES
FOR
REGISTERS
WITH
DEF.
200
9.3.4
EQUATING
NAMES
TO
EXPRESSIONS
USING
EQU
AND
SET
.
200
9.3.5
CONDITIONAL
ASSEMBLY
.
201
9.4
OTHER
ASSEMBLY
LANGUAGE
ELEMENTS
.
203
9.5
FURTHER
READING
.
204
9.6
SUMMARY
.
204
CHAPTER
10
YY
AVR
TIMING,
TIMERS
AND
INTERRUPTS
205
10.1
INSTRUCTION
TIMING
.
206
10.1.1
AVR
CPU
VERSIONS
.
206
10.1.2
INSTRUCTION
TIMING
EXAMPLES
.
206
10.1.2.1
THE
NOP
INSTRUCTION
.
206
10.1.2.2
16-BIT
AND
32-BIT
INSTRUCTION
TIMING
.
208
10.1.2.3
TIMING
OF
BRANCH
INSTRUCTIONS
.
208
THE
SIMULATOR
CYCLE
COUNTER
AND
STOP
WATCH
.
210
SIMULATOR
CYCLE
COUNTER
BUG
.
211
10.2
ASSEMBLY
LANGUAGE
TIME
DELAY
.
213
10.2.1
CALCULATING
A
SOFTWARE
DELAY
SUBROUTINE
TIME
DELAY
.
213
10.2.1.1
DELAY
SUBROUTINE
CYCLE
COUNTER
MEASUREMENT
.
214
10.2.1.2
DELAY
SUBROUTINE
MATHEMATICAL
FORMULA
.
215
10.2.2
A
BETTER
SOFTWARE
DELAY
SUBROUTINE
.
226
10.2.2.1
PRINCIPLE
OF
OPERATION
.
227
10.2.2.2
32-BIT
SUBTRACTION
WITH
8-BIT
REGISTERS
.
227
10.2.2.3
TIMING
OF
THE
CODE
.
229
10.2.2.4
TESTING
THE
CODE
IN
MICROCHIP
STUDIO
.
230
10.2.3
A
CHANGEABLE
SOFTWARE
TIME
DELAY
SUBROUTINE
.
231
10.2.3.1
SPLITTING
AN
ASSEMBLY
LANGUAGE
PROJECT
INTO
FILES
.
234
10.2.3.2
HOW
THE
WAIT_MS
SUBROUTINE
WORKS
.
235
10.2.3.3
LIMITS
OF
THE
WAIT_MS
SUBROUTINE
.
237
SIMPLIFYING
THE
FORMULA
.
238
9
CALCULATING
THE
MAXIMUM
DELAY
TIME
OF
THE
SUBROUTINE
.
238
POSING
VALUE
LIMITS
IN
ASSEMBLY
LANGUAGE
.
240
NUMBER
SIZE
LIMITS
IN
THE
ASSEMBLER
PROGRAM
.
243
SOLUTION
TO
FLAGGING
OUT
OF
RANGE
UPPER
VALUES
.
246
FLAGGING
OUT
OF
RANGE
HIGH
AND
LOW
VALUES
.
247
10.2.4
PASSING
A
VALUE
TO
A
SUBROUTINE
.
251
10.2.4.1
SIMPLEST
WAY
TO
PASS
A
VALUE
.
251
10.2.4.2
IMPROVED
WAY
TO
PASS
A
VALUE
.
253
10.3
CALLING
AN
ASSEMBLY
SUBROUTINE
FROM
C
CODE
.
261
10.3.1
PASSING
A
VALUE
TO
AN
ASSEMBLY
SUBROUTINE
FROM
C
.
261
10.3.1.1
TESTING
THE
WAIT_MS_C
PROJECT
CODE
.
263
10.3.1.2
HOW
THE
WAIT_MS_C
PROJECT
CODE
WORKS
.
264
10.3.2
RETURNING
A
VALUE
FROM
AN
ASSEMBLY
SUBROUTINE
IN
C
.
266
10.4
POLLED
TIMER
DELAY
.
268
10.4.1
TIMER/COUNTERO
REGISTERS
.
268
10.4.1.1
TIMER/COUNTERO
REGISTER
ADDRESSES
.
269
10.4.1.2
USING
COUNTER/TIMERO
AS
A
TIMER
.
270
10.4.2
POLLED
TIMER
ASSEMBLY
PROGRAM
.
271
10.4.2.1
THE
IFNDEF
DIRECTIVE
.
271
10.4.2.2
LEFT
SHIFT
OPERATOR
.
272
10.4.2.3
REGISTER
WRITE
OR
READ-MODIFY-WRITE
.
273
10.4.2.4
INITIALIZING
TIMER
0
.
273
10.4.2.5
POLLING
TIMER
0
.
275
10.4.2.6
RUNNING
THE
CODE
IN
THE
SIMULATOR
.
276
10.4.3
POLLED
TIMER
C
PROGRAM
.
276
10.5
TIMER
INTERRUPT
DELAY
.
277
10.5.1
HOW
INTERRUPTS
WORK
.
278
10.5.2
THE
INTERRUPT
VECTOR
TABLE
.
278
10.5.3
ASSEMBLY
PROGRAM
TIMER
INTERRUPT
.
279
10.5.3.1
ATTINYL3(A)
TIMER
INTERRUPT
PROJECT
.
279
THE
INTERRUPT
VECTOR
TABLE
.
280
MAIN
PROGRAM
CODE
.
282
INTERRUPT
SERVICE
ROUTINE
CODE
.
282
RUNNING
THE
TIMER
INTERRUPT
CODE
.
283
10.5.3.2
ATTINY25/45/85
TIMER
INTERRUPT
PROJECT
.
283
10.5.3.3
UNIVERSAL
TIMER
INTERRUPT
PROJECT
.
285
10
10.5.4
C
PROGRAM
TIMER
INTERRUPT
.
286
10.6
SUMMARY.
288
CHAPTER
11
*
THE
AVR
INSTRUCTION
SET
289
11.1
AVR
INSTRUCTION
SET
OVERVIEW
AND
CATEGORIES
.
290
11.2
A
GUIDED
TOUR
THROUGH
THE
ATTINY
AVR
INSTRUCTION
SET
.
290
11.2.1
ARITHMETIC
AND
LOGIC
INSTRUCTIONS
.
290
11.2.1.1
ADD
AND
SUBTRACT
INSTRUCTIONS
.
290
ADDITION
INSTRUCTIONS
.
290
SUBTRACTION
INSTRUCTIONS
.
293
11.2.1.2
LOGICAL
INSTRUCTIONS
.
294
LOGICAL
AND
.
294
LOGICAL
OR
.
294
LOGICAL
EXCLUSIVE
OR
.
294
11.2.1.3
INCREMENT
AND
DECREMENT
INSTRUCTIONS
.
294
11.2.1.4
SIGN
CHANGE
INSTRUCTIONS
.
294
11.2.1.5
BIT
SET
AND
CLEAR
INSTRUCTIONS
.
295
11.2.1.6
REGISTER
SET,
CLEAR
AND
TEST
INSTRUCTIONS
.
296
11.2.2
BRANCH
INSTRUCTIONS
.
297
11.2.2.1
JUMP
INSTRUCTIONS
.
297
11.2.2.2
SUBROUTINE
CALL
INSTRUCTIONS
.
299
11.2.2.3
RETURN
FROM
SUBROUTINE
AND
INTERRUPT
INSTRUCTIONS
.
300
11.2.2.4
COMPARE
INSTRUCTIONS
.
300
11.2.2.5
SKIP
INSTRUCTIONS
.
301
11.2.2.6
BRANCH
INSTRUCTIONS
.
302
BRANCH
IF
BIT
IN
SREG
SET
OR
CLEARED
.
302
BRANCH
IF
EQUAL
OR
NOT
EQUAL
-
SREG
Z
FLAG
.
303
BRANCH
IF
CARRY
SET
OR
CLEARED
-
SREG
C
FLAG
.
303
BRANCH
IF
SAME
OR
HIGHER,
OR
LOWER
-
SREG
C
FLAG
.
303
BRANCH
IF
MINUS
OR
PLUS
-
SREG
N
FLAG
.
304
BRANCH
IF
GREATER
OR
EQUAL,
OR
LESS
THAN
SIGNED
-
SREG
S
FLAG
.
304
BRANCH
IF
HALF
CARRY
FLAG
SET
OR
CLEARED
-
SREG
H
FLAG
.
304
BRANCH
IF
T
BIT
SET
OR
CLEARED
-
SREG
T
FLAG
.
304
BRANCH
IF
OVERFLOW
FLAG
SET
OR
CLEARED
-
SREG
V
FLAG
.
304
BRANCH
IF
INTERRUPT
ENABLED
OR
DISABLED
-
SREG
I
FLAG
.
304
11.2.3
BIT
AND
BIT-TEST
INSTRUCTIONS
.
305
11
11.2.3.1
BIT
SET
AND
CLEAR
INSTRUCTIONS
.
305
11.2.3.2
SHIFT,
ROTATE
AND
SWAP
INSTRUCTIONS
.
305
LOGICAL
SHIFT
INSTRUCTIONS
.
305
ROTATE
THROUGH
CARRY
INSTRUCTIONS
.
305
LOGICAL
SHIFT
AND
ROTATE
CODE
EXAMPLE
.
305
LED
CHASER
LOGICAL
SHIFT
CODE
EXAMPLE
.
306
ARITHMETIC
SHIFT
AND
SWAP
INSTRUCTIONS
.
310
11.2.3.3
STATUS
REGISTER
BIT
SET
AND
CLEAR
INSTRUCTIONS
.
310
SET
OR
CLEAR
SREG
BIT
.
310
STORE
OR
LOAD
SREG
T
BIT
TO/FROM
REGISTER
.
310
SET
OR
CLEAR
CARRY
FLAG
-
SREG
C
BIT
.
311
SET
OR
CLEAR
NEGATIVE
FLAG
-
SREG
N
BIT
.
311
SET
OR
CLEAR
ZERO
FLAG
-
SREG
Z
BIT
.
311
SET
OR
CLEAR
GLOBAL
INTERRUPT
FLAG
BIT
-
SREG
I
BIT
.
311
SET
OR
CLEAR
SIGN
FLAG
-
SREG
S
BIT
.
312
SET
OR
CLEAR
TWO
'
S
COMPLIMENT
OVERFLOW
FLAG
-
SREG
V
BIT
.
312
SET
OR
CLEAR
T
BIT
IN
SREG
-
SREG
T
BIT
.
312
SET
AND
CLEAR
HALF
CARRY
FLAG
-
SREG
H
BIT
.
312
11.2.4
DATA
TRANSFER
INSTRUCTIONS
.
312
11.2.4.1
MOVE/COPY
INSTRUCTIONS
.
312
11.2.4.2
LOAD
IMMEDIATE
INSTRUCTION
.
313
11.2.4.3
LOAD
INDIRECT
INSTRUCTIONS
.
313
11.2.4.4
STORE
INDIRECT
INSTRUCTIONS
.
314
11.2.4.5
LOAD
INDIRECT
WITH
DISPLACEMENT
.
315
11.2.4.6
STORE
INDIRECT
WITH
DISPLACEMENT
.
315
11.2.4.7
LOAD
DIRECT
FROM
SRAM
.
315
11.2.4.8
STORE
DIRECT
TO
SRAM
.
316
11.2.4.9
LOAD
PROGRAM
MEMORY
INSTRUCTIONS
.
316
11.2.4.10
STORE
PROGRAM
MEMORY.
316
11.2.4.11
PORT
IN
AND
OUT
INSTRUCTIONS
.
316
11.2.4.12
PUSH
AND
POP
INSTRUCTIONS
.
317
11.2.5
MCU
CONTROL
INSTRUCTIONS
.
317
11.3
ENTIRE
AVR
INSTRUCTION
SET
.
318
11.3.1
NUMBER
OF
AVR
INSTRUCTIONS
.
318
11.3.1.1
TOTAL
NUMBER
OF
AVR
INSTRUCTIONS
.
318
11.3.1.2
NUMBER
OF
ATTINY
AVR
INSTRUCTIONS
.
318
12
11.3.1.3
DISCREPANCIES
IN
DOCUMENTATION
.
318
11.3.2
OTHER
AVR
INSTRUCTIONS
.
319
11.3.2.1
ARITHMETIC
AND
LOGIC
INSTRUCTIONS
.
319
11.3.2.2
BRANCH
INSTRUCTIONS
.
319
11.3.2.3
DATA
TRANSFER
INSTRUCTIONS
.
320
11.3.3
PUTTING
INSTRUCTIONS
INTO
PERSPECTIVE
.
321
11.3.3.1
THE
FULL
AVR
INSTRUCTION
SET
.
321
11.3.3.2
THE
PLAIN
AVR
CPU
.
321
11.3.3.3
REDUCED
AVRRC
CORE
.
321
11.3.3.4
AVRE
AND
AVRXT
CORES
.
321
11.3.3.5
AVRE+
CPU.
322
11.3.3.6
AVRXM
CPU
.
322
CHAPTER
12
*
SOFTWARE
TOOLS
AND
SETTINGS
323
12.1
AVR
ASSEMBLER
PROGRAMS.
324
12.1.1
THE
AVRASM2
ASSEMBLER
.
324
12.1.1.1
BUILDING
A
PROJECT
WITH
AVRASM2
.
324
12.1.1.2
AVRASM2
ON
THE
COMMAND
LINE
.
326
12.1.1.3
AVRASM2
OPTIONS
IN
MICROCHIP
STUDIO
.
327
12.1.1.4
LIST
FILE
OPTIONS
.
328
12.1.2
THE
AVR-AS
ASSEMBLER
.
329
12.1.3
THE
AVRA
ASSEMBLER
.
329
12.2
THE
GNU
C
TOOLCHAIN
.
329
12.3
WHERE
TO
FROM
HERE?
.
330
12.3.1
OBJECTIVES
ACHIEVED
.
330
12.3.2
WHAT
WAS
NOT
COVERED
.
332
12.3.3
OTHER
AVR
MICROCONTROLLERS
.
332
12.3.4
ASSEMBLY
LANGUAGE
RESOURCES
.
332
APPENDIX
A
*
EXTERNAL
PROGRAMMER
SETUP
333
A.
L
HOBBY
USB
PROGRAMMER
CAPABILITIES
.
334
A.
1.1
DIFFERENCES
BETWEEN
HOBBY
PROGRAMMERS
AND
THE
ATMEL-ICE
.
334
A.L.
2
PROGRAMMING
INTERFACES
.
335
A.
1.3
USING
HOBBY
USB
PROGRAMMERS
WITH
THIS
BOOK
.
335
A.2
OVERVIEW
OF
EXTERNAL
PROGRAMMER
SETUP
.
336
A.3
EXTERNAL
PROGRAMMER
SETUP
.
336
13
A.
3.1
INSTALL
A
DRIVER
.
336
A.
3.1.1
USBASP
DRIVER
.
336
A.3.1.2
USBTINYISP
DRIVER
.
339
A.3.
1.3
ARDUINO
UNO
SKETCH
.
341
A.3.2
DOWNLOAD
AND
INSTALL
AVRDUDE
.
342
A.3.3
BUILD
AN
AVR
CIRCUIT
AND
CONNECT
A
PROGRAMMER
.
343
A.
3.3.1
CONNECTING
A
USBASP
.
344
10-PIN
MALE
HEADER
.
344
10-PIN
FEMALE
CONNECTOR
ON
RIBBON
CABLE
.
344
6-PIN
ADAPTER
(ISP/SPI)
.
345
A.3.3.
2
CONNECTING
A
USBTINYISP
.
345
6-PIN
MALE
HEADER
.
345
6-PIN
FEMALE
CONNECTOR
ON
RIBBON
CABLE
.
345
A.3.3.
3
CONNECTING
AN
ARDUINO
UNO
ARDUINOISP
.
345
A.
3.4
PROGRAMMING
PARAMETERS
.
346
A.3.4.1
DOCUMENTATION
FOR
AVRDUDE
.
346
A.3.4.2
PARAMETERS
FOR
AVRDUDE
EXPLAINED
.
346
A.3.4.3
PARAMETERS
FOR
A
USBASP
.
349
A.3.4.4
PARAMETERS
FOR
A
USBTINYISP
.
350
A.3.4.5
PARAMETERS
FOR
AN
ARDUINOISP
.
350
A.3.5
MICROCHIP
STUDIO
EXTERNAL
TOOL
SETUP
.
350
A.3.5.1
OPEN
AN
ASSEMBLY
OR
C
PROJECT
.
351
A.3.5.
2
ADD
AN
EXTERNAL
TOOL
IN
MICROCHIP
STUDIO
.
351
USBASP.
352
USBTINYISP
.
352
ARDUINOISP
(ARDUINO
UNO
WITH
ARDUINOISP
SKETCH
LOADED)
.
352
A.3.5.
3
ADD
A
TOOLBAR
BUTTON
FOR
THE
EXTERNAL
TOOL
.
353
A.
3.6
TESTING
THE
PROGRAMMER
.
355
A.
3.7
PROGRAMMING
PROBLEMS
AND
SOLUTIONS
.
355
APPENDIX
B
ALTERNATE
CIRCUITS
AND
PROGRAMS
357
B.
L
8-PIN
PDIP
ATTINYL3/25/45/85
.
358
B.
2
14-PIN
PDIP
ATTINY24/44/84
.
359
B.3
20-PIN
PDIP
ATTINY26/261/461/861
AND
ATTINY2313/4313
.
360
B.4
28-PIN
PDIP
ATTINY48/88
.
361
B.5
ALTERNATE
PROGRAMS
.
362
14
B.5.1
ALTERNATE
LED
BLINK
ASSEMBLY
PROGRAM
.
363
B.
5.2
ALTERNATE
LED
BLINK
C
PROGRAM
.
363
APPENDIX
C
YY
THE
ASCII
TABLE
365
C.
L
PRINTABLE
CHARACTERS
.
365
C.
2
ASCII
TABLE.
365
INDEX
367
15 |
any_adam_object | 1 |
any_adam_object_boolean | 1 |
author | Smith, Warwick A. |
author_GND | (DE-588)1022275852 |
author_facet | Smith, Warwick A. |
author_role | aut |
author_sort | Smith, Warwick A. |
author_variant | w a s wa was |
building | Verbundindex |
bvnumber | BV047666293 |
classification_rvk | ST 170 ZN 4980 |
ctrlnum | (OCoLC)1298287530 (DE-599)DNB1247933792 |
discipline | Informatik Elektrotechnik / Elektronik / Nachrichtentechnik |
discipline_str_mv | Informatik Elektrotechnik / Elektronik / Nachrichtentechnik |
format | Book |
fullrecord | <?xml version="1.0" encoding="UTF-8"?><collection xmlns="http://www.loc.gov/MARC21/slim"><record><leader>02466nam a22006378c 4500</leader><controlfield tag="001">BV047666293</controlfield><controlfield tag="003">DE-604</controlfield><controlfield tag="005">20220801 </controlfield><controlfield tag="007">t</controlfield><controlfield tag="008">220112s2021 gw a||| |||| 00||| eng d</controlfield><datafield tag="015" ind1=" " ind2=" "><subfield code="a">21,N51</subfield><subfield code="2">dnb</subfield></datafield><datafield tag="016" ind1="7" ind2=" "><subfield code="a">1247933792</subfield><subfield code="2">DE-101</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">9783895764790</subfield><subfield code="c">pbk: EUR 37.95 (DE) (freier Preis), EUR 39.10 (AT) (freier Preis), CHF 39.95 (freier Preis)</subfield><subfield code="9">978-3-89576-479-0</subfield></datafield><datafield tag="020" ind1=" " ind2=" "><subfield code="a">3895764795</subfield><subfield code="9">3-89576-479-5</subfield></datafield><datafield tag="024" ind1="3" ind2=" "><subfield code="a">9783895764790</subfield></datafield><datafield tag="028" ind1="5" ind2="2"><subfield code="a">Bestellnummer: 20007</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(OCoLC)1298287530</subfield></datafield><datafield tag="035" ind1=" " ind2=" "><subfield code="a">(DE-599)DNB1247933792</subfield></datafield><datafield tag="040" ind1=" " ind2=" "><subfield code="a">DE-604</subfield><subfield code="b">ger</subfield><subfield code="e">rda</subfield></datafield><datafield tag="041" ind1="0" ind2=" "><subfield code="a">eng</subfield></datafield><datafield tag="044" ind1=" " ind2=" "><subfield code="a">gw</subfield><subfield code="c">XA-DE-NW</subfield></datafield><datafield tag="049" ind1=" " ind2=" "><subfield code="a">DE-29T</subfield><subfield code="a">DE-M347</subfield><subfield code="a">DE-83</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ST 170</subfield><subfield code="0">(DE-625)143602:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="a">ZN 4980</subfield><subfield code="0">(DE-625)157428:</subfield><subfield code="2">rvk</subfield></datafield><datafield tag="084" ind1=" " ind2=" "><subfield code="8">1\p</subfield><subfield code="a">621.3</subfield><subfield code="2">23sdnb</subfield></datafield><datafield tag="100" ind1="1" ind2=" "><subfield code="a">Smith, Warwick A.</subfield><subfield code="e">Verfasser</subfield><subfield code="0">(DE-588)1022275852</subfield><subfield code="4">aut</subfield></datafield><datafield tag="245" ind1="1" ind2="0"><subfield code="a">Explore ATtiny microcontrollers using C and Assembly language</subfield><subfield code="b">AVR architecture and programming</subfield><subfield code="c">Warwick A. Smith</subfield></datafield><datafield tag="264" ind1=" " ind2="1"><subfield code="a">Aachen</subfield><subfield code="b">Elektor</subfield><subfield code="c">[2021]</subfield></datafield><datafield tag="300" ind1=" " ind2=" "><subfield code="a">376 Seiten</subfield><subfield code="b">Illustrationen</subfield><subfield code="c">23.5 cm x 17 cm</subfield></datafield><datafield tag="336" ind1=" " ind2=" "><subfield code="b">txt</subfield><subfield code="2">rdacontent</subfield></datafield><datafield tag="337" ind1=" " ind2=" "><subfield code="b">n</subfield><subfield code="2">rdamedia</subfield></datafield><datafield tag="338" ind1=" " ind2=" "><subfield code="b">nc</subfield><subfield code="2">rdacarrier</subfield></datafield><datafield tag="490" ind1="0" ind2=" "><subfield code="a">Elektor books</subfield></datafield><datafield tag="500" ind1=" " ind2=" "><subfield code="a">In-Depth</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Mikrocontroller AVR</subfield><subfield code="0">(DE-588)4540630-3</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">C</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4113195-2</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Assembler</subfield><subfield code="0">(DE-588)4003255-3</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="650" ind1="0" ind2="7"><subfield code="a">Mikrocontroller</subfield><subfield code="0">(DE-588)4127438-6</subfield><subfield code="2">gnd</subfield><subfield code="9">rswk-swf</subfield></datafield><datafield tag="653" ind1=" " ind2=" "><subfield code="a">Microchip</subfield></datafield><datafield tag="653" ind1=" " ind2=" "><subfield code="a">Atmel</subfield></datafield><datafield tag="653" ind1=" " ind2=" "><subfield code="a">ATmega</subfield></datafield><datafield tag="653" ind1=" " ind2=" "><subfield code="a">Microcontroller</subfield></datafield><datafield tag="653" ind1=" " ind2=" "><subfield code="a">Programming</subfield></datafield><datafield tag="689" ind1="0" ind2="0"><subfield code="a">Mikrocontroller</subfield><subfield code="0">(DE-588)4127438-6</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="0" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="689" ind1="1" ind2="0"><subfield code="a">Mikrocontroller AVR</subfield><subfield code="0">(DE-588)4540630-3</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="1" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="689" ind1="2" ind2="0"><subfield code="a">Assembler</subfield><subfield code="0">(DE-588)4003255-3</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="2" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="689" ind1="3" ind2="0"><subfield code="a">C</subfield><subfield code="g">Programmiersprache</subfield><subfield code="0">(DE-588)4113195-2</subfield><subfield code="D">s</subfield></datafield><datafield tag="689" ind1="3" ind2=" "><subfield code="5">DE-604</subfield></datafield><datafield tag="710" ind1="2" ind2=" "><subfield code="a">Elektor Verlag GmbH</subfield><subfield code="0">(DE-588)1065539746</subfield><subfield code="4">pbl</subfield></datafield><datafield tag="776" ind1="0" ind2="8"><subfield code="i">Erscheint auch als</subfield><subfield code="n">Online-Ausgabe</subfield><subfield code="z">978-3-89576-480-6</subfield></datafield><datafield tag="856" ind1="4" ind2="2"><subfield code="m">DNB Datenaustausch</subfield><subfield code="q">application/pdf</subfield><subfield code="u">http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033051026&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA</subfield><subfield code="3">Inhaltsverzeichnis</subfield></datafield><datafield tag="999" ind1=" " ind2=" "><subfield code="a">oai:aleph.bib-bvb.de:BVB01-033051026</subfield></datafield><datafield tag="883" ind1="1" ind2=" "><subfield code="8">1\p</subfield><subfield code="a">vlb</subfield><subfield code="d">20211218</subfield><subfield code="q">DE-101</subfield><subfield code="u">https://d-nb.info/provenance/plan#vlb</subfield></datafield></record></collection> |
id | DE-604.BV047666293 |
illustrated | Illustrated |
index_date | 2024-07-03T18:54:08Z |
indexdate | 2024-07-10T09:18:43Z |
institution | BVB |
institution_GND | (DE-588)1065539746 |
isbn | 9783895764790 3895764795 |
language | English |
oai_aleph_id | oai:aleph.bib-bvb.de:BVB01-033051026 |
oclc_num | 1298287530 |
open_access_boolean | |
owner | DE-29T DE-M347 DE-83 |
owner_facet | DE-29T DE-M347 DE-83 |
physical | 376 Seiten Illustrationen 23.5 cm x 17 cm |
publishDate | 2021 |
publishDateSearch | 2021 |
publishDateSort | 2021 |
publisher | Elektor |
record_format | marc |
series2 | Elektor books |
spelling | Smith, Warwick A. Verfasser (DE-588)1022275852 aut Explore ATtiny microcontrollers using C and Assembly language AVR architecture and programming Warwick A. Smith Aachen Elektor [2021] 376 Seiten Illustrationen 23.5 cm x 17 cm txt rdacontent n rdamedia nc rdacarrier Elektor books In-Depth Mikrocontroller AVR (DE-588)4540630-3 gnd rswk-swf C Programmiersprache (DE-588)4113195-2 gnd rswk-swf Assembler (DE-588)4003255-3 gnd rswk-swf Mikrocontroller (DE-588)4127438-6 gnd rswk-swf Microchip Atmel ATmega Microcontroller Programming Mikrocontroller (DE-588)4127438-6 s DE-604 Mikrocontroller AVR (DE-588)4540630-3 s Assembler (DE-588)4003255-3 s C Programmiersprache (DE-588)4113195-2 s Elektor Verlag GmbH (DE-588)1065539746 pbl Erscheint auch als Online-Ausgabe 978-3-89576-480-6 DNB Datenaustausch application/pdf http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033051026&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA Inhaltsverzeichnis 1\p vlb 20211218 DE-101 https://d-nb.info/provenance/plan#vlb |
spellingShingle | Smith, Warwick A. Explore ATtiny microcontrollers using C and Assembly language AVR architecture and programming Mikrocontroller AVR (DE-588)4540630-3 gnd C Programmiersprache (DE-588)4113195-2 gnd Assembler (DE-588)4003255-3 gnd Mikrocontroller (DE-588)4127438-6 gnd |
subject_GND | (DE-588)4540630-3 (DE-588)4113195-2 (DE-588)4003255-3 (DE-588)4127438-6 |
title | Explore ATtiny microcontrollers using C and Assembly language AVR architecture and programming |
title_auth | Explore ATtiny microcontrollers using C and Assembly language AVR architecture and programming |
title_exact_search | Explore ATtiny microcontrollers using C and Assembly language AVR architecture and programming |
title_exact_search_txtP | Explore ATtiny microcontrollers using C and Assembly language AVR architecture and programming |
title_full | Explore ATtiny microcontrollers using C and Assembly language AVR architecture and programming Warwick A. Smith |
title_fullStr | Explore ATtiny microcontrollers using C and Assembly language AVR architecture and programming Warwick A. Smith |
title_full_unstemmed | Explore ATtiny microcontrollers using C and Assembly language AVR architecture and programming Warwick A. Smith |
title_short | Explore ATtiny microcontrollers using C and Assembly language |
title_sort | explore attiny microcontrollers using c and assembly language avr architecture and programming |
title_sub | AVR architecture and programming |
topic | Mikrocontroller AVR (DE-588)4540630-3 gnd C Programmiersprache (DE-588)4113195-2 gnd Assembler (DE-588)4003255-3 gnd Mikrocontroller (DE-588)4127438-6 gnd |
topic_facet | Mikrocontroller AVR C Programmiersprache Assembler Mikrocontroller |
url | http://bvbr.bib-bvb.de:8991/F?func=service&doc_library=BVB01&local_base=BVB01&doc_number=033051026&sequence=000001&line_number=0001&func_code=DB_RECORDS&service_type=MEDIA |
work_keys_str_mv | AT smithwarwicka exploreattinymicrocontrollersusingcandassemblylanguageavrarchitectureandprogramming AT elektorverlaggmbh exploreattinymicrocontrollersusingcandassemblylanguageavrarchitectureandprogramming |