Monday, April 17, 2017
Programming techniques Mikrokontroler AT89C51
Programming techniques Mikrokontroler AT89C51
CPU (Central Processing Unit) based on the work. The sequence of commands is called the Program. The program is stored in ROM or RAM.
However, data for the operation in mikrokontroler this operation can be done in one data bit, nibble (4 bit), byte (8 bits), and double-byte (16 bit).
Register A and B
A register is akumulator, used as a register for temporary data storage. In the program, the instructions to register as an A. Register B have specific functions in the operations division and multiplication, namely as a source and as a goal, while operating on the register as usual.
Status Register (Psw)
Register Psw (Program Status Word) is the 8-bit register. Register consists of bits CY, AC, FOR, RSO, OV, and P. Bit kesatu not used. Register this function to save the status information processor.
CY: contain the carry after arithmetic operations.
AC: Auxiliary carry contain the following arithmetic operations
OV: contains status arithmetic overflow after the operation.
P: parity of the register containing A.
FOR: is a flag for the general (general purpose flags) which will participate in the stack is stored in the saatpenyimpanan Psw.
RS0, RS1: voter register groups (four groups have to register).
CY (Carry) also functions as akumulator boolean operations for bit.
Bookmarks Pile (Stack Pointer)
Bookmarks stack (Stack Pointer) contain the address of the data entered into the last hill.
In operation furcation or interruptions it is necessary to rescue the data that has just done and will be the address, usually the address of the data is stored on the stack (stack), using the system Last In First Out (LIFO).
Decoder is a function to interpret the command. The command is defined as the need to order one or more bytes.
Program Counter (PC)
16 bit is a register containing the address that will be done.
Bookmarks Data (Data Pointer / DPTR)
A data register (DPTR), which is 16 bit wide mix of DPH register (the top of the byte) and DPL (the lower part of the byte). DPTR work for allocation not immediately register.
Bolean processor is the processor with a bit-free, built-in architecture 89C51. Processor has its own set of instructions, akumulator itself, RAM and I / O with allocation own. Instruction bit manipulation allowing allocation directly on the 128 bit in the RAM and 128-bit register in the register with a specific function (SFR)
Memory on mikrokontroler 89C51 organized as follows:
External program memory 64 Kbyte
External data memory 64 Kbyte
Internal data memory 384 bytes
Memoy outside
Because the PC register 16 bits wide, the CPU is able to put address memory up to 64 Kbyte.
This allocation can be done in the 64 Kbyte and 64 Kbyte Program Data, as the program memory and data memory separated logically in a way to distinguish signal strobe reading program or data
Data internal memory is divided into 2, namely:
Data internal RAM (128 bytes)
Special Function Register (128 bytes)
Special Function Register (SFR) occupy up to 80h address FFh which consists of 128 bytes. Not all addresses used in the SFR, and addresses that do not not be implemented on the chip. If the reading is done on the addresses that are not used, it will generate random data and written does not work at all. Each SFR has a name (symbol), and in particular address. In the making of the program, SFR can be called either the name or address.
Address internal RAM data is 0 to 255, consisting of:
1. Address 0 (00h) to 31 (1Fh) be occupied by 4 groups (bank) that registers each consisting of 8 bits.
2. Address 32d (20H) to the 47d (2Fh) is a block of memory that can be dialamati bytes (20H-2Fh), or a bit dialamati (00h-7Fh), or the location of 128 bits.
Address 30h to 7Fh used to register versatile (General User)
Address 128 (80h) to 255 (FFh) is used as a special function register (SFR). Register contains the address register in addition to the PC. In SFR there are 16 bytes that can be dialamati per bit, the byte address with the ending 0H or 8h
smiledeargod.blogspot.com - div1026
Go to link Download
Labels:
at89c51,
mikrokontroler,
programming,
techniques