Internal RAM Architecture
Internal RAM Architecture
Explanation:-
• In 8051 microcontroller has Total 128 bytes of RAM
• In 8051 RAM is divided into 2 parts
1. Lower part (or) USER RAM
User RAM is used to store the Run time Data
2. Upper part (or)SFR Area
SFR area Consists of Special function Registers
Explanation of USER RAM
• USER RAM again divide into 3 parts
1. Register Bank0 (00 - 0F)
2. Bit and Byte address area ( 0x20 - 0x2F)
3. Scratch pad Area (0x30 – 0x7F)
Explanation of Register bank
• Size of Register bank is 32 bytes
Register bank again divided into 4 banks.
1.Register bank0.
2.Register bank1.
3.Register bank2
4.Register bank3.
1.Register bank0 (0x0 - 0x7):
• Register bank0 is select as default bank when mc(microcontroller) gets
power ON.
• If one Bank gets full, then data is not saved in next bank automatically.
• We need to write logic to select different bank.
Bit and Byte addressable:-
• In Bit and Byte addressable area we can do any bit and byte
level operations
• We can't do bit operations on register banks.
• On Register bank area we can do only byte operations
• Example:
Mov R0 , # 'A' 0100 0001 -> A
CPL R0.5-.(invalid) 0110 0001 -> a
Scratch pad Area- ( 0x30 - 0x7F)
• Scratch pad area is consist of 80bytes
• There is no SFR(special function registers) in Scratch pad area
Stack pointer:-
1.stack pointer points to the stack area/ memory
2.Stack is a part of RAM, stack is belong to bank1.
3.in 8051 , the didn't mention total size , i.e memory for stack pointer.
4. stack pointer will do 2 operations
1.PUSH 2. POP
I/O port register:-
1. I/O ports are used for input and output operations
2. 8051 has 4 ports.
3. Each port consists of 8 I/o pins