Special function registers are upper RAM memory in the 8051 microcontrollers. These registers contain all peripheral related registers like P0, P1, P2, P3, timers or counters, serial port and interrupts-related registers. The SFR memory address starts from 80h to FFh. The SFR register is implemented by bit-address registers and byte-address registers.
The accumulator and B registers and port registers all are bit addressable register remaining all are bye addressable registers.
Accumulator: The accumulator which is also known as ACC or A is a bit as well as a byte-addressable register by an address of the accumulator. If you want to use a bit-addressable register, you can use a single bit (E0) of the register and you can use an 8-bit of the accumulator as a byte-addressable register. The accumulator holds the results of most Arithmetic and logical operations.
B-Register
The B-register is a bit and byte-addressable register. You can access 1-bit or all 8-bits by a physical address F0h. Suppose to access a bit 1, we have to use f1. The B register is only used for multiplication and division operations.
Port Registers
The 8051 microcontroller consists of 4-input and output ports (P0, P1, P2, and P3) or 32-I/O pins. Each pin is designed with a transistor and P registers. The pin configuration is very important for a microcontroller that depends on the logic states of the registers. The pin configuration as input given by 1 or output 0 depends on the logic states. If logic 1 is applied to the bit of the P register, the output transistor switches off the appropriate pin that acts as an input pin.
Counters and registers:
Many microcontrollers consist of one or more timers and counters. The timers are used to generate precious time delay and the source for the timers is a crystal oscillator. The counters are used to count the number of external events – for instance, the objective counter, and the source for counters are external pulses applied across the counter pin.
The 8051 microcontroller consists of two 16-bit timers and counters such as timer 0 and timer 1. Both the timers consist of a 16-bit register in which the lower byte is stored in the TL and the higher byte is stored in the TH. The Timer can be used as a counter as well as for timing operation that depends on the source of the clock pulses to the counters.
The Counters and Timers in 8051 microcontrollers contain two special function registers: TMOD (Timer Mode Register) and TCON (Timer Control Register), which are used for activating and configuring timers and counters.
Well, in yesterday's podcast discussed on registers in 8051, two types of a register, general purpose registers are today's article all about. The general purpose registers are called as RAM memory in 8051. It has 128 bytes of memory for this general purpose registers. These general purpose registers are divided into 3 areas, those are Banks. Bit addressable areas. scratchpad areas. Let we discuss clearly, Banks In this bank, 4 types of banks are there like bank 0 bank 1 bank 2 bank 3 In each bank has 8 registers those are R0 to R7. All these general purpose registers are byte addressable registers. An image is shown in below for better understanding, ...
TMOD register As we know there are 2 timer registers in 8051. Timer 0 and timer 1. Both of these registers use the same register called TMOD to set various timer operation modes. TMOD is an 8-bit register, in which lower 4 bits are for Timer 0 and upper 4 bits are for Timer 1. See table below. MSB ---- LSB GATE C/T M1 M0 GATE C/T M1 M0 TIMER 1 TIMER 0 Bit Description: Bit TMOD Bit Function 7 Gate -- OR gate enable bit which controls RUN/STOP of timer 1. Set to 1 by the program to enable the timer to run if bit TR1 in TCON is set and the signal on external interrupt is high. Cleared to 0 by the program to enable time to run if bit TR1 is set. 6 C/ T -- Set to 1 by the program to make timer 1 act as a counter by counting pulses from external input pins 3.5. Cleared to zero by the program to make timer act as a timer by counting internal frequency. 5 M1 -- Timer/counter operating mode select bit 1. Set/cleared by the...
Serial Transmission Modes Serial data can be transferred in two modes – asynchronous and synchronous. Asynchronous Data Transfer: Data Transfer is called Asynchronous when data bits are not “synchronized” with a clock line, i.e. there is no clock line at all! Let's take an analogy. Imagine you are playing a game with your friend where you have to throw coloured balls (let’s say we have only two colours – red (R) and yellow (Y)). Let's assume you have an unlimited number of balls. You have to throw a combination of these coloured balls to your friend. So you start throwing the balls. You throw R, then R, then Y, then R again and so on. So you start your sequence RRYR… and then you end your round and start another round. How will your buddy on the other side know that you have finished sending him the first round of balls and that you are already sending him the second round of balls?? He/she will be completely lost! How nice it would be if you both sit together and f...
Comments
Post a Comment