Best books for 8051 microcontroller

By With No comments:
Many of the students out there who already know about 8051 controllers will be surprised to see this book ranked as #1 over the top of Mazidi and Ayala 🙂 I will say this is one of the best books to get started with 8051 micro controller. The author Subrata Ghoshal has done an amazing job with this book that any layman can get a great idea about micro controllers and its working. You only need to have an idea of the basic stuffs in electronics to follow this book.

The 8051 Microcontroller and Embedded Systems using Assembly and C -by Muhammad Ali Mazidi

The book I recommend here is the second edition from the author trios – Muhammad Ali Mazidi, Rolin Mckinlay and Janice Gillispie Mazidi. For years this book enjoyed a great popularity among students (through first edition without C programming) and 8051 enthusiasts. Still this book is one of the most popular books out there on 8051 and the authors are renowned world wide. The single reason I ranked book of Subrata Ghoshal above this one is “easier understanding”. Ghoshal has been successful in developing his book in the most “easy to read and grasp” format.
I suggest you buy this book too along with the book of Subrata Ghoshal, as this book by Mazidi focuses on C programming of 8051 along with assembly language. As a student you really need to know program 8051 using embedded C language. In the initial phases of your learning curve, assembly language is enough for writing programs (and you should start learning 8051 software by writing in assembly language as it helps you to understand concepts better). But when it comes to advanced software development for 8051, the “embedded C” will be more handy. The reason is, its is more easy to program using C language than using assembly language. It can save your time and makes possible efficient coding!

Special function registers (SFR) for 8051 microcontrollers

By With No comments:
The registration area or special functions (SFR) is between 80H and FFH address the internal memory of the microcontroller.

This memory area can not be used as data memory, it is clear that if we write out of control in the memory allocated to a special register, modify the behavior of the microcontroller, resulting in unexpected results as the affected record. Although the memory locations that are not assigned to a special register can be used to hold data, it is not advisable to use, it has to bear in mind that these may be reserved and assigned to special registers in other models or manufacturers of microcontrollers and our program will conflict when changing model.

The input and output ports also occupy a specific position or memory addresses. The memory locations on the left side (80h, 88h, 90H ..) are reserved for routing bit so that the concerned records may be accessed via this system.

The following table shows the layout of each record in 8051 and 8052 microcontroller.
F8HFFH
F0HB * F7H
E8HEFH
E0hACC * E7H
D8HDFH
D0HPSW * D7H
C8HT2CON * # RCAP2L # RCAP2H # TL2 # TH2 # CFH
C0hC7H
B8HIP * BFH
B0hP3 * B7H
A8hIE * AFH
A0HP2 * A7H
98HSCON * SBUF9FH
90HP1 * 97H
88hTCON * TMODTL0TL1TH0TH18FH
80HP0 * SPDPLDPHPCON87H
The following table shows the description and the symbols of each bit or pin of the internal registers (SFR) of the 8051/8052 microcontroller family.
RegisterDescriptionAddressCommand bit or alternate function portReset value
MSBLSB
ACC *Accumulator
(Accumulator)
E0hE7E6E5E4E3E2E1E000H
B *Register B
(Register B)
F0HF7F6F5F4F3F2F1F000H
DPTR:Data Pointer
(Data Pointer) (2 bytes)
DPHHigh byte of DPTR
(Data pointer high)
83H00H
DPLLow byte of DPTR
(Data pointer low)
82H00H
AFAEADACABAAA9A8
IE *Enable interrupts
(Interrupt enable)
A8hEA-ET2ESET1EX1ET0EX00x000000B
BFBEBDBCBBBAB9B8
IP *Priority interrupts
(Interrupt priority)
B8H--PT2PSPT1PX1PT0PX00x000000B
8786858483828180
P0 *Port 0 (Port 0)80HAD7AD6AD5AD4AD3AD2AD1AD0FFH
9796959493929190
P1 *Port 1 (Port 1)90H------T2EXT2FFH
A7A6A5A4A3A2A1A0
P2 *Port 2 (Port 2)A0HA15A14A13A12A11A10A9A8FFH
B7B6B5B4B3B2B1B0
P3 *Port 3 (Port 3)B0hRDWRT1T0INT1INT0TxDRxDFFH
PCON1Consumption control
(Power control)
87HSMOD---GF1GF0PDIDL0xxxxxxxB
D7D6D5D4D3D2D1D0
PSW *Program status word
(Program status word)
D0HCYACF0RS1RS0OV-P00H
RegisterDescriptionAddressBit command or alternate function portReset value
MSBLSB
RCAP2H #Capture high byte
(Capture high)
CBH00H
RCAPL #Capture Low byte
(Capture low)
CAH00H
SBUFSerial Data Buffer
(Serial data buffer)
99hxxxxxxxxB
9F9E9D9C9B9A9998
SCON *Serial Port Control
(Serial controller)
98HSM0SM1SM2RENTB8Rb8ITRI00H
SPStack pointer
(Stack Pointer)
81F07H
8F8E8D8C8B8A8988
TCON *Control Timers
(Timer Control)
88hTF1TR1TF0TR0IE1IT1IE0IT000H
CFCECDCCCBCAC9C8
T2CON * #Timer 2 Control
(Timer 2 contro l)
C8HTF2EXF2RCLKTCLKEXEN2TR2C/T2CP/RL200H
TH0Timer 0 upper
(Timer high 0)
8CH00H
TH1Timer 1 upper
(Timer high 1)
8DH00H
TH2 #Timer 2 top
(Timer high 2)
CDH00H
TL0Timer 0 lower
(Timer Low 0)
8AH00H
TL1Timer 1 lower
(Timer Low 1)
8BH00H
TL2 #Timer 2 lower
(Timer Low 2)
CCH00H
TMODTimers Mode
(Timer mode)
89hGATEC / TM1M0GATEC / TM1M000H
Register with bit-level addressing.
Records added in the 8052 microcontroller family.