Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
AVR / datasheets / attiny_28L_28V.pdf
Скачиваний:
36
Добавлен:
20.03.2015
Размер:
746.49 Кб
Скачать

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Register Direct, Single

Figure 7. Direct Single Register Addressing

Register Rd

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The operand is contained in register d (Rd).

Register Indirect

Figure 8. Indirect Register Addressing

 

REGISTERFILE

0

Z-Register 30

31

The register accessed is the one pointed to by the Z-register (R31, R30).

Register Direct, Two Registers Figure 9. Direct Register Addressing, Two Registers

Rd and Rr

Operands are contained in register r (Rr) and d (Rd). The result is stored in register d (Rd).

8 ATtiny28L/V

1062G–AVR–01/06

ATtiny28L/V

I/O Direct

Relative Program Addressing,

RJMP and RCALL

Figure 10. I/O Direct Addressing

Operand address is contained in six bits of the instruction word. n is the destination or source register address.

Figure 11. Relative Program Memory Addressing

15

0

PC

+1

15

12 11

0

 

 

OP

 

k

 

 

 

 

 

PROGRAM MEMORY

$000

$3FF

Program execution continues at address PC + k + 1. The relative address k is -2048 to 2047.

Constant Addressing Using

Figure 12. Code Memory Constant Addressing

the LPM Instruction

 

 

 

PROGRAM MEMORY

 

 

 

 

 

15

1

0

 

$000

 

 

 

 

 

 

 

Z-REGISTER

 

 

 

 

 

 

 

 

 

$3FF

Constant byte address is specified by the Z-register contents. The 15 MSBs select word address (0 - 1K), and LSB selects low byte if cleared (LSB = 0) or high byte if set (LSB = 1).

9

1062G–AVR–01/06

Subroutine and Interrupt

Hardware Stack

Memory Access and

Instruction Execution

Timing

The ATtiny28 uses a 3-level-deep hardware stack for subroutines and interrupts. The hardware stack is 10 bits wide and stores the program counter (PC) return address while subroutines and interrupts are executed.

RCALL instructions and interrupts push the PC return address onto stack level 0, and the data in the other stack levels 1 - 2 are pushed one level deeper in the stack. When a RET or RETI instruction is executed the returning PC is fetched from stack level 0, and the data in the other stack levels 1 - 2 are popped one level in the stack.

If more than three subsequent subroutine calls or interrupts are executed, the first values written to the stack are overwritten.

This section describes the general access timing concepts for instruction execution and internal memory access.

The AVR CPU is driven by the System Clock, directly generated from the external clock crystal for the chip. No internal clock division is used.

Figure 13 shows the parallel instruction fetches and instruction executions enabled by the Harvard architecture and the fast-access register file concept. This is the basic pipelining concept to obtain up to 1 MIPS per MHz with the corresponding unique results for functions per cost, functions per clocks and functions per power unit.

Figure 13. The Parallel Instruction Fetches and Instruction Executions

T1

T2

T3

T4

System Clock Ø

1st Instruction Fetch

1st Instruction Execute 2nd Instruction Fetch 2nd Instruction Execute 3rd Instruction Fetch 3rd Instruction Execute 4th Instruction Fetch

Figure 14 shows the internal timing concept for the register file. In a single clock cycle an ALU operation using two register operands is executed, and the result is stored back to the destination register.

Figure 14. Single Cycle ALU Operation

T1

T2

T3

T4

System Clock Ø

Total Execution Time

Register Operands Fetch

ALU Operation Execute

Result Write Back

10 ATtiny28L/V

1062G–AVR–01/06

Соседние файлы в папке datasheets