This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
en:avr:architecture [2010/09/30 17:26] – allan.pettai | en:avr:architecture [2020/07/20 09:00] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 20: | Line 20: | ||
</ | </ | ||
- | ===== Instruction | + | ===== Instruction |
The instruction set of most AVRs consists of 90-133 different instructions. ATmega128 has 133 instructions. Instructions have either one, two or no operands. Most instructions take only one cycle to complete, but the more complex ones can use up to 5 cycles. For XMega, the successor of AVR, several instructions have been modified to use less cycles. Most instructions in AVR are used for jumps, moving and comparing data and executing arithmetic calculations. A status register is used for performing calculations and comparisons. It stores the output status of the ALU - whether the result was negative, positive, zero, exceeded the maximum allowed value (8 bits), needed to transfer a bit to the next operation etc (there are a few more complex cases). | The instruction set of most AVRs consists of 90-133 different instructions. ATmega128 has 133 instructions. Instructions have either one, two or no operands. Most instructions take only one cycle to complete, but the more complex ones can use up to 5 cycles. For XMega, the successor of AVR, several instructions have been modified to use less cycles. Most instructions in AVR are used for jumps, moving and comparing data and executing arithmetic calculations. A status register is used for performing calculations and comparisons. It stores the output status of the ALU - whether the result was negative, positive, zero, exceeded the maximum allowed value (8 bits), needed to transfer a bit to the next operation etc (there are a few more complex cases). | ||
Line 37: | Line 37: | ||
</ | </ | ||
- | ===== Program | + | ===== Program |
- | Stack is a data structure, where the last data written to the memory is read out first. AVR's stack can be used while operating with subroutines, | + | Stack is a data structure, where the last data written to the memory is read out first. AVR's stack can be used while operating with subroutines, |
The stack of MegaAVR series microcontrollers is physically located in the random access memory. Some tinyAVR series devices do not have a random access memory at all and the stack is realized as a separate, quite limited memory unit. Typically there are no compilers for devices with no random access memory. | The stack of MegaAVR series microcontrollers is physically located in the random access memory. Some tinyAVR series devices do not have a random access memory at all and the stack is realized as a separate, quite limited memory unit. Typically there are no compilers for devices with no random access memory. | ||
To program in a high level language (Pascal, C, C++), it is not necessary to be familiar with the inner workings of the microcontroller, | To program in a high level language (Pascal, C, C++), it is not necessary to be familiar with the inner workings of the microcontroller, |