Back to the 2024 paper

Module 2: The 8051 Architecture

20247m

Demonstrate the Special Function Registers in 8051.

Worked SolutionAI Assisted

Special Function Registers (SFRs) in 8051

SFRs occupy internal RAM 80H–FFH (only addresses ending 0H/8H bit-addressable, total 21-26 SFRs). Key SFRs:

SFR Address Purpose
ACC (A) E0H Accumulator, ALU results
B F0H Multiply/divide, storage
PSW D0H Flags: CY, AC, FO, RS1,RS0, OV, P
SP 81H Stack Pointer
DPL/DPH 82H/83H Data Pointer 16-bit for external access
P0-P3 80H,90H,A0H,B0H I/O ports
IE A8H Interrupt Enable (EA, ES, ET1,EX1,ET0,EX0)
IP B8H Interrupt Priority
TCON 88H Timer control (TF1,TR1,TF0,TR0,IE1,IT1,IE0,IT0)
TMOD 89H Timer mode (GATE,C/T,M1,M0)
TH0/TL0, TH1/TL1 8AH-8DH Timer counts
SCON 98H Serial control (SM0,SM1,SM2,REN,TB8,RB8,TI,RI)
SBUF 99H Serial buffer (TX/RX)
PCON 87H Power control (SMOD, IDL, PD)

Bit-addressable SFRs (marked *) allow SETB/CLR. Maps allow direct bit manipulation for control. Example: SETB TR1 starts Timer1; JNB TF0 loop etc.

Similar questions

Free AppAndroid App

Coursify Android App

Generate AI courses, take quick quizzes between classes, and master complex engineering concepts on the go.