Microcontrollers can be considered as self-contained systems with a processor, memory and I/O ports.

Size: px
Start display at page:

Download "Microcontrollers can be considered as self-contained systems with a processor, memory and I/O ports."

Transcription

1 8051 Architecture 1

2 Microcontrollers can be considered as self-contained systems with a processor, memory and I/O ports. In most cases, all that is missing is the software to define the operation of the embedded system. Usually available in several forms: Devices for prototyping Built-in or piggy-back EPROM for storing the software. One Time Programmable (OTP) devices. No window on the package. Therefore, the internal EPROM cannot be erased after being programmed. High Volume Production devices. Use ROM internally to hold the software. Cheaper in large volume. 2

3 The Architectural Needs of a Microcontroller Lets consider what architectural features would be needed in a microcontroller. What are the expected applications? Sensing the environment. Input. Producing a response. Output. The response may be delayed. Timer/Counter. Prioritized response. Interrupts. Software to control the process. Non-volatile Memory. Temporary data. RAM. 3

4 Three criteria in Choosing a Microcontroller 1. meeting the computing needs of the task efficiently and cost effectively speed, the amount of ROM and RAM, the number of I/O ports and timers, size, packaging, power consumption easy to upgrade cost per unit 2. availability of software development tools assemblers, debuggers, C compilers, emulator, simulator, technical support 3. wide availability and reliable sources of the microcontrollers. 4

5 The MCS-51 Family of Microcontrollers Originally introduced by Intel in Currently, the most widely used microcontroller. 8-bit processor. 2 distinct separately addressable memory areas. Maximum of 64K on-chip ROM. Usually 0 to 4K. Maximum of 64K external data memory. Maximum of 64K external code memory. Basic version (8051) contains: 4K Bytes of on-chip ROM instruction memory. 128 Bytes of on-chip RAM for temporary data storage and the stack. 2 Timers, One Serial Port, and Four 8-bit Parallel I/O ports. Speeds starting from12 MHz. 5

6 Features of the 8051 Microcontroller Feature Quantity ROM 4K Bytes RAM 128 Bytes Timer 2 I/O Ports 4 Serial Port 1 Interrupt Sources 6 The 8051 is the original member of the Intel MCS-51 family of Microcontrollers. There are several varieties that differ slightly in the available features. 6

7 Feature EPROM On-Chip ROM 4K 8K 4k 8k 0K 0K RAM (Bytes) Timers I/O Ports Serial Port Interrupt Sources The 8031 requires external instruction memory. It can be as large as 64K Bytes. You lose 2 ports for interfacing to the external memory. You can replace these by interfacing the chip to an I/O port controller like the

8 Manufacturers of MCS-51 Clones There is a large number of companies that manufacture microcontrollers in the 8051 family. Atmel Corporation. Flash instead of EPROM. Low Voltage. Minimal version with less memory and fewer I/O ports in a smaller package. CMOS implementation. Speeds that range from 12 to 20 MHz. 8

9 Manufacturers of MCS-51 Clones Dallas Semiconductor Uses NV-RAM. Programmable in-system. As large as 32K of instruction memory. Some versions have an on-chip real-time clock. Philips Corporation. Large selection of 8051 based microcontrollers. Include features like A/D and D/A on chip. Xilinx and Altera 8051 FPGA cores. 9

10 Programmer s View Memory Organization Register Set Instruction Set Hardware Designer s View Pin-out Timing characteristics Current / Voltage requirements 10

11 The 8051 Internals External interrupts Interrupt Control On-chip ROM for program code On-chip RAM Timer/Counter Timer 1 Timer 0 Counter Inputs CPU OSC Bus Control 4 I/O Ports Serial Port P0 P1 P2 P3 Address/Data TxD RxD 11

12 The 8051 has separate address spaces for program storage and data storage. Depending on the type of instruction, the same address can refer to two logically and physically different memory locations. FFFF FFFF FFF 0000 External Internal Program Memory 7F 00 Special Function Registers Internal Data Memory FF External Data Memory 12

13 After reset, the MCS-51 starts fetching instructions from 0000H. This can be either on-chip or external depending on the value of the EA input pin. If EA is low, then the program memory is external. If EA is high, then addresses from 0000 to 0FFF will refer to on-chip memory and addresses 1000 up to FFFF refer to external memory. Note that the 8031 must have its EA connected low as all of its memory is external. 13

14 Port 0 acts as a multiplexed address/data bus. Sending the low byte of the program counter (PCL) as an address. Port 2 sends the program counter high byte (PCH) directly to the external memory. The signal ALE operates as in the 8085 to allow an external latch to store the PCL byte while the multiplexed bus is made ready to receive the code byte from the external memory. Port 0 then switches function and becomes the data bus receiving the byte from memory. 14

15 The 8051 has 256 bytes of RAM on-chip. The lower 128 bytes are intended for internal data storage. The upper 128 bytes are the Special Function Registers (SFR). The lower 128 bytes are not to be used as standard RAM. They house the 8051 s registers, its default stack area, and other features. Special Function Registers Internal Data Storage FFH 80H 7FH 00H 15

16 Data Storage Contd. The lowest 32 bytes of the on-chip RAM form 4 banks of 8 registers each. Only one of these banks can be active at any time. Bank is chosen by setting 2 bits in PSW Default bank (at power up) is bank 0 (locations 00 07). The 8 registers in any active bank are referred to as R0 through R7 Given that each register has a specific address, it can be accessed directly using that address even if its bank is not the active one. 1F H 1E H 1D H 1C H 1B H 1A H 19 H 18 H 17 H 16 H 15 H 14 H 13 H 12 H 11 H 10 H 0F H 0E H 0D H 0C H 0B H 0A H 09 H 08 H 07 H 06 H 05 H 04 H 03 H 02 H 01 H 00 H R7 R6 R5 R4 R3 R2 R1 R0 R7 R6 R5 R4 R3 R2 R1 R0 R7 R6 R5 R4 R3 R2 R1 R0 R7 R6 R5 R4 R3 R2 R1 R0 Bank 03 Bank 02 Bank 01 Bank 00 16

17 2F 7F 7E 7D 7C 7B 7A The next 16 bytes locations 20H to 2FH form a block that can be addressed as either bytes or individual bits. The bytes have addresses 20H to 2FH. The bits have addresses 00H to 7FH. Specific instructions are used for accessing the bits. 2E D 6F 6E 6D 6C 6B 6A C B 5F 5E 5D 5C 5B 5A A F 4E 4D 4C 4B 4A F 3E 3D 3C 3B 3A F 2E 2D 2C 2B 2A F 1E 1D 1C 1B 1A F 0E 0D 0C 0B 0A Locations 30H to 7FH are general purpose RAM. 17

18 Data Storage the Lower 128 Bytes 30 7F General Purpose Ram 2F 7F 7E 7D 7C 7B 7A E D 6F 6E 6D 6C 6B 6A C B 5F 5E 5D 5C 5B 5A A F 4E 4D 4C 4B 4A F 3E 3D 3C 3B 3A Bit addressable memory locations 25 2F 2E 2D 2C 2B 2A F 1E 1D 1C 1B 1A F 0E 0D 0C 0B 0A F Register Bank Register Bank F Register Bank Register Bank 0 18

19 The SFR Special Function Registers The upper 128 bytes of the on-chip RAM are used to house special function registers. In reality, only about 25 of these bytes are actually used. The others are reserved for future versions of the These are registers associated with important functions in the operation of the MCS-51. Some of these registers are bit-addressable as well as byteaddressable. The address of bit 0 of the register will be the same as the address of the register. 19

20 F8 FF F0 B F7 E8 EF E0 ACC E7 D8 DF D0 PSW D7 C8 (T2CON) (RCAP2L) (RCAP2H) (TL2) (TH2) CF C0 C7 B8 IP BF B0 P3 B7 A8 IE AF A0 P2 A7 98 SCON SBUF 9F 90 P TCON TMOD TL0 TL1 TH0 TH1 8F 80 P0 SP DPL DPH PCON 87 Bit/Byte addressable registers Byte only addressable registers 20

21 ACC and B registers 8 bit each DPTR : [DPH:DPL] 16 bit combined PC : Program Counter 16 bits Stack pointer SP 8 bit PSW : Program Status Word Port Latches Serial Data Buffer Timer Registers Control Registers 21

22 Commonly used for move and arithmetic instructions. Can be referred to in several ways: Implicitly in opcodes. Referred to as ACC (or A) for instructions that allow specifying a register. By its SFR address 0E0H. Operates in a similar manner to the 8085 accumulator. Bit addressable. ACC.2 means bit 2 of the ACC register. 22

23 Commonly used as a temporary register, much like a 9 th R register. Used by two opcodes mul AB, div AB B register holds the second operand and will hold part of the result Upper 8 bits of the multiplication result Remainder in case of division. Can also be accessed through its SFR address of 0F0H. Bit addressable. 23

24 2 8-bit registers that can be combined into a 16-bit DPTR Data Pointer. Used by commands that access external memory Also used for storing 16bit values mov DPTR, #data16 ; setup DPTR with 16bit ext. address movx ; copy mem[dptr] to A Can be accessed as 2 separate 8-bit registers if needed. DPTR is useful for string operations and look up table (LUT) operations. 24

25 SP is the stack pointer. SP points to the last used location of the stack. Push operation will first increment SP and then copy data. Pop operation will first copy data and then decrement SP. In 8051, stack grows upwards (from low memory to high memory) and can be in the internal RAM only. On power-up, SP points to 07H. Register banks 2,3,4 (08H to 1FH) form the default stack area. Stack can be relocated by setting SP to the upper memory area in 30H to 7FH. mov SP, #32H 25

26 Program Status Word is a bit addressable 8-bit register that has all the flags. (MSB) (LSB) CY AC F0 RS1 RS2 OV - P Symbol Position Function CY PSW.7 Carry Flag AC PSW.6 Auxiliary Carry Flag. For BCD Operations F0 PSW.5 Flag 0. Available to the user for general purposes. RS1 PSW.4 Register bank select bits. Set by software to RS2 PSW.3 determine which register bank is being used. OV PSW.2 Overflow Flag - PSW.1 Not used P PSW.0 Parity Flag. Even Parity. 26

27 The P0, P1, P2, and P3 Registers Port Latches. Specify the value to be output on the specific output port or the value read from the specific input port. Bit addressable. First bit has the same address as the register. Example: P1 has address 90H in the SFR, so P1.7 or 97H refer to the same bit. 27

28 Serial Port Data Buffer. 2 registers at the same location One is read-only used for reading serial input data. Serial Data Receive Buffer. The other is write-only used for storing serial output data. Serial Data Transmit Buffer. 28

29 The high and low bytes of the 16-bit counting register for timer/counter T0. There is also a TH1 / TL1 pair for the T1 timer. In the 8052, one more pair exists (TH2) / (TL2) for the T2 timer. (RCAP2H) and (RCAP2L) exist only in the 8052 and they are copies of the TH2 and TL2 registers. 29

30 IP Interrupt Priority. IE Interrupt Enable. TMOD Timer Mode. TCON Timer Control. T2CON Timer 2 Control (8052) SCON Serial Port Control. PCON Power Control (80C51). 30

31 31

32 Pin Description of the 8051 PDIP/Cerdip P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST (RXD)P3.0 (TXD)P3.1 (T0)P3.4 (T1)P3.5 XTAL2 XTAL1 GND (INT0)P3.2 (INT1)P3.3 (RD)P3.7 (WR)P3.6 Vcc P0.0(AD0 ) P0.1(AD1) P0.2(AD2 ) P0.3(AD3) P0.4(AD4) P0.5(AD5) P0.6(AD6) P0.7(AD7) EA/VPP ALE/PROG PSEN P2.7(A15) P2.6(A14 ) P2.5(A13 ) P2.4(A12 ) P2.3(A11) P2.2(A10) P2.1(A9) P2.0(A8) 8051 (8031) 32

33 Pins of 8051(1/4) Vcc(pin 40): Vcc provides supply voltage to the chip. The voltage source is +5V. GND(pin 20):ground XTAL1 and XTAL2(pins 19,18): These 2 pins provide external clock. Way 1:using a quartz crystal oscillator Way 2:using a TTL oscillator 33

34 Pins of 8051(2/4) RST(pin 9):reset It is an input pin and is active high(normally low). The high pulse must be high at least 2 machine cycles. It is a power-on reset. Upon applying a high pulse to RST, the microcontroller will reset and all values in registers will be lost. Reset values of some 8051 registers Way 1:Power-on reset circuit Way 2:Power-on reset with debounce 34

35 Pins of 8051(3/4) /EA(pin 31):external access There is no on-chip ROM in 8031 and The /EA pin is connected to GND to indicate the code is stored externally. /PSEN & ALE are used for external ROM. For 8051, /EA pin is connected to Vcc. / means active low. /PSEN(pin 29):Program Store ENable This is an output pin and is connected to the /OE pin of the ROM. 35

36 Pins of 8051(4/4) ALE(pin 30):Address Latch Enable It is an output pin and is active high port 0 provides both address and data. The ALE pin is used for de-multiplexing the address and data by connecting to the G pin of the 74LS373 latch. I/O port pins The four ports P0, P1, P2, and P3. Each port uses 8 pins. All I/O pins are bi-directional. 36

37 XTAL Connection to 8051 Using a quartz crystal oscillator We can observe the frequency on the XTAL2 pin. C2 30pF XTAL2 C1 30pF XTAL1 GND 37

38 XTAL Connection to an External Clock Source Using a TTL oscillator XTAL2 is unconnected. N C EXTERNAL OSCILLATOR SIGNAL XTAL2 XTAL1 GND 38

39 Example : Find the machine cycle for (a) XTAL = MHz (b) XTAL = 16 MHz. Solution: (a) MHz / 12 = khz; machine cycle = 1 / khz = s (b) 16 MHz / 12 = MHz; machine cycle = 1 / MHz = 0.75 s 39

40 RESET Value of Some 8051 Registers: Register PC ACC B PSW SP DPTR Reset Value RAM are all zero. 40

41 Power-On RESET Circuit Vcc + 10 uf 8.2 K 30 pf 30 pf MHz EA/VPP X1 X2 RST 41

42 Power-On RESET with Debounce Vcc 10 uf 30 pf 31 EA/VPP X1 9 X2 RST 8.2 K 42

43 Pins of I/O Port The 8051 has four I/O ports Port 0 (pins 32-39):P0(P0.0~P0.7) Port 1(pins 1-8) :P1(P1.0~P1.7) Port 2(pins 21-28):P2(P2.0~P2.7) Port 3(pins 10-17):P3(P3.0~P3.7) Each port has 8 pins. Named P0.X (X=0,1,...,7), P1.X, P2.X, P3.X Ex:P0.0 is the bit 0(LSB)of P0 Ex:P0.7 is the bit 7(MSB)of P0 These 8 bits form a byte. Each port can be used as input or output (bi-direction). 43

44 Registers A B R0 R1 DPTR DPH DPL R2 R3 R4 R5 R6 R7 PC PC Some bit Register Some 8-bitt Registers of the

45 Some Simple Instructions MOV dest,source ; dest = source MOV A,#72H ;A=72H MOV A, # r ;A= r OR 72H MOV R4,#62H ;R4=62H MOV B,0F9H ;B=the content of F9 th byte of RAM Just COPY MOV MOV MOV DPTR,#7634H DPL,#34H DPH,#76H MOV P1,A ;mov A to port 1 Note 1: MOV A,#72H MOV A,72H After instruction MOV A,72H the content of 72 th byte of RAM will replace in Accumulator MOV AL,72H MOV A,#72H MOV AL, r MOV A,# r MOV BX,72H MOV AL,[BX] MOV A,72H Note 2: MOV A,R3 MOV A,3 45

46 ADD A, Source ;A=A+SOURCE ADD A,#6 ;A=A+6 ADD A,R6 ;A=A+R6 ADD A,6 ;A=A+[6] or A=A+R6 ADD A,0F3H ;A=A+[0F3H] 46

47 SETB bit ; bit=1 CLR bit ; bit=0 SETB C ; CY=1 SETB P0.0 ;bit 0 from port 0 =1 SETB P3.7 ;bit 7 from port 3 =1 SETB ACC.2 ;bit 2 from ACCUMULATOR =1 Note: CLR instruction is as same as SETB i.e: CLR C ;CY=0 But following instruction is only for CLR: CLR A ;A=0 47

48 SUBB A,source ;A=A-source-CY SETBC SUBB A,R5 ;CY=1 ;A=A-R5-1 ADDC A,source ;A=A+source+CY SETBC ;CY=1 ADDC A,R5 ;A=A+R5+1 48

49 DEC byte ;byte=byte-1 INC byte ;byte=byte+1 INC R7 DEC A DEC 40H ; [40]=[40]-1 CPL A ;1 s complement Example: MOV A,#55H ;A= B L01: CPL A MOV P1,A ACALL DELAY SJMP L01 NOP & RET & RETI All are like 8086 instructions. 49

50 ANL - ORL - XRL EXAMPLE: MOV ANL R5,#89H R5,#08H RR RL RRC RLC A EXAMPLE: RR A 50

51 Structure of Assembly language and Running an 8051 program ORG MOV MOV MOV ADD ADD HERE: SJMP HERE END 0H R5,#25H R7,#34H A,#0 A,R5 A,#12H Myfile.lst EDITOR PROGRAM ASSEMBLER PROGRAM Myfile.obj LINKER PROGRAM OH PROGRAM Myfile.asm Myfile.abs Other obj file 51 Myfile.hex

52 Memory mapping in 8051 ROM memory map in 8051 family 4k 8k 32k 0000H 0000H 0000H 0FFFH 8751 AT89C51 1FFFH 8752 AT89C52 7FFFH DS from Atmel Corporation from Dallas Semiconductor 52

53 RAM memory space allocation in the FH Scratch pad RAM 30H 2FH Bit-Addressable RAM 20H 1FH 18H 17H 10H 0FH 08H 07H 00H Register Bank 3 Register Bank 2 (Stack) Register Bank 1 Register Bank 0 53

54 8051 Flag bits and the PSW register PSW Register CY AC F0 RS1 RS0 OV -- P CY PSW.7 Carry flag AC PSW.6 Auxiliary carry flag -- PSW.5 Available to the user for general purpose RS1 PSW.4 Register Bank selector bit 1 RS0 PSW.3 Register Bank selector bit 0 OV PSW.2 Overflow flag -- PSW.1 User define bit P PSW.0 Parity flag Set/Reset odd/even parity RS1 RS0 Register Bank Address H-07H H-0FH H-17H H-1FH 54

55 Instructions that Affect Flag Bits: Note: X can be 0 or 1 55

56 I/O Port Programming Port 1(pins 1-8) Port 1 is denoted by P1. P1.0 ~ P1.7 We use P1 as examples to show the operations on ports. P1 as an output port (i.e., write CPU data to the external pin) P1 as an input port (i.e., read pin data into CPU bus) 56

57 A Pin of Port 1 Read latch TB2 Vcc Load(L1) Internal CPU bus D P1.X Q P1.X pin Write to latch Clk Q M1 TB1 Read pin 8051 IC 57

58 Hardware Structure of I/O Pin Each pin of I/O ports Internal CPU bus:communicate with CPU D latch store the value of this pin D latch is controlled by Write to latch Write to latch=1:write data into the D latch 2 Tri-state buffer: TB1: controlled by Read pin Read pin=1:really read the data present at the pin TB2: controlled by Read latch Read latch=1:read value from internal latch A transistor M1 gate Gate=0: open Gate=1: close 58

59 Tri-state Buffer Output Input Tri-state control (active high) High impedance (open-circuit) L L H H Low H H 59

60 Writing 1 to Output Pin P1.X Read latch 1. write a 1 to the pin Internal CPU bus Write to latch TB2 D Q P1.X Clk Q 1 Vcc Load(L1) 2. output pin is Vcc P1.X pin 0 M1 output 1 Read pin TB IC 60

61 Writing 0 to Output Pin P1.X Read latch 1. write a 0 to the pin Internal CPU bus Write to latch TB2 D Q P1.X Clk Q 0 Vcc Load(L1) 2. output pin is ground P1.X pin 1 M1 output 0 Read pin TB IC 61

62 Port 1 as Output(Write to a Port) Send data to Port 1: MOV A,#55H BACK: MOV P1,A ACALL DELAY CPL A SJMP BACK Let P1 toggle. You can write to P1 directly. 62

63 Reading Input v.s. Port Latch When reading ports, there are two possibilities: Read the status of the input pin. (from external pin value) MOV A, PX JNB P2.1, TARGET ; jump if P2.1 is not set JB P2.1, TARGET ; jump if P2.1 is set Read the internal latch of the output port. ANL P1, A ; P1 P1 AND A ORL P1, A ; P1 P1 OR A INC P1 ; increase P1 63

64 Reading High at Input Pin Read latch 1. write a 1 to the pin MOV P1,#0FFH TB2 Vcc Load(L1) 2. MOV A,P1 external pin=high Internal CPU bus D Q P1.X 1 1 P1.X pin Write to latch Clk Q 0 M1 TB1 Read pin 3. Read pin=1 Read latch=0 Write to latch= IC 64

65 Reading Low at Input Pin Read latch 1. write a 1 to the pin MOV P1,#0FFH TB2 Vcc 2. MOV A,P1 Load(L1) external pin=low Internal CPU bus D Q P1.X 1 0 P1.X pin Write to latch Clk Q 0 M1 TB1 Read pin 3. Read pin=1 Read latch=0 Write to latch= IC 65

66 Port 1 as Input(Read from Port) In order to make P1 an input, the port must be programmed by writing 1 to all the bit. MOV A,#0FFH ;A= B MOV P1,A ;make P1 an input port BACK: MOV A,P1 ;get data from P1 MOV P2,A ;send data to P2 SJMP BACK To be an input port, P0, P1, P2 and P3 have similar methods. 66

67 Instructions For Reading an Input Port Following are instructions for reading external pins of ports: Mnemonics Examples Description MOV A,PX MOV A,P2 Bring into A the data at P2 pins JNB PX.Y,.. JNB P2.1,TARGET Jump if pin P2.1 is low JB PX.Y,.. JB P1.3,TARGET Jump if pin P1.3 is high MOV C,PX.Y MOV C,P2.4 Copy status of pin P2.4 to CY 67

68 Reading Latch OR the Port 1: MOV P1,#55H ;P1= ORL P1,#0F0H ;P1= The read latch activates TB2 and bring the data from the Q latch into CPU. Read P1.0=0 2. CPU performs an operation. This data is ORed with bit 1 of register A. Get The latch is modified. D latch of P1.0 has value The result is written to the external pin. External pin (pin 1: P1.0) has value 1. 68

69 Reading the Latch 1. Read pin=0 Read latch=1 Write to latch=0 (Assume P1.X=0 initially) Read latch 2. CPU compute P1.X OR 1 0 Internal CPU bus Write to latch 3. write result to latch Read pin=0 Read latch=0 Write to latch=1 1 TB2 D Q P1.X Clk Q Vcc Load(L1) M P1.X=1 P1.X pin TB1 Read pin IC

70 Read-modify-write Feature Read-modify-write Instructions This features combines 3 actions in a single instruction: 1. CPU reads the latch of the port 2. CPU perform the operation 3. Modifying the latch 4. Writing to the pin Note that 8 pins of P1 work independently. 70

71 Port 1 as Input(Read from latch) Exclusive-or the Port 1: MOV P1,#55H ;P1= AGAIN: XOR P1,#0FFH ;complement ACALL DELAY SJMP AGAIN Note that the XOR of 55H and FFH gives AAH. XOR of AAH and FFH gives 55H. The instruction read the data in the latch (not from the pin). The instruction result will put into the latch and the pin. 71

72 Other Pins P1, P2, and P3 have internal pull-up resisters. P1, P2, and P3 are not open drain. P0 has no internal pull-up resistors and does not connects to Vcc inside the P0 is open drain. Compare the figures of P1.X and P0.X. However, for a programmer, it is the same to program P0, P1, P2 and P3. All the ports upon RESET are configured as output. 72

73 A Pin of Port 0 Read latch TB2 Internal CPU bus D P1.X Q P0.X pin Write to latch Clk Q M1 TB1 Read pin 8051 IC 73

74 Port 0(pins 32-39) P0 is an open drain. Open drain is a term used for MOS chips in the same way that open collector is used for TTL chips. When P0 is used for simple data I/O we must connect it to external pull-up resistors. Each pin of P0 must be connected externally to a 10K ohm pull-up resistor. With external pull-up resistors connected upon reset, port 0 is configured as an output port. 74

75 Port 0 with Pull-Up Resistors Vcc 10 K DS P0.0 P0.1 P0.2 P0.3 P0.4 P0.5 P0.6 P0.7 Port 0 75

76 Dual Role of Port 0 When connecting an 8051/8031 to an external memory, the 8051 uses ports to send addresses and read instructions is capable of accessing 64K bytes of external memory. 16-bit address:p0 provides both address A0-A7, P2 provides address A8-A15. Also, P0 provides data lines D0-D7. When P0 is used for address/data multiplexing, it is connected to the 74LS373 to latch the address. There is no need for external pull-up resistors. 76

77 ALE Pin The ALE pin is used for de-multiplexing the address and data by connecting to the G pin of the 74LS373 latch. When ALE=0, P0 provides data D0-D7. When ALE=1, P0 provides address A0-A7. The reason is to allow P0 to multiplex address and data. 77

78 Port 2(pins 21-28) Port 2 does not need any pull-up resistors since it already has pull-up resistors internally. In an 8031-based system, P2 are used to provide address A8- A15. 78

79 Port 3(pins 10-17) Port 3 does not need any pull-up resistors since it already has pull-up resistors internally. Although port 3 is configured as an output port upon reset, this is not the way it is most commonly used. Port 3 has the additional function of providing signals. Serial communications signal:rxd, TxD External interrupt:/int0, /INT1 Timer/counter:T0, T1 External memory accesses in 8031-based system:/wr, /RD 79

80 Port 3 Alternate Functions P3 Bit Function Pin P3.0 RxD 10 P3.1 TxD 11 P3.2 INT0 12 P3.3 INT1 13 P3.4 T0 14 P3.5 T1 15 P3.6 WR 16 P3.7 RD 17 80

81 A simple project using AT89C51 81

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families

The Microcontroller. Lecture Set 3. Major Microcontroller Families. Example Microcontroller Families Cont. Example Microcontroller Families The Microcontroller Lecture Set 3 Architecture of the 8051 Microcontroller Microcontrollers can be considered as self-contained systems with a processor, memory and I/O ports. In most cases, all that is

More information

Three criteria in Choosing a Microcontroller

Three criteria in Choosing a Microcontroller The 8051 Microcontroller architecture Contents: Introduction Block Diagram and Pin Description of the 8051 Registers Some Simple Instructions Structure of Assembly language and Running an 8051 program

More information

8051 Programming using Assembly

8051 Programming using Assembly 8051 Programming using Assembly The Instruction Addressing Modes dest,source ; dest = source A,#72H ;A=72H A, # r ;A= r OR 72H R4,#62H ;R4=62H B,0F9H ;B=the content of F9 th byte of RAM DPTR,#7634H DPL,#34H

More information

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture

EEE3410 Microcontroller Applications Department of Electrical Engineering Lecture 4 The 8051 Architecture Department of Electrical Engineering Lecture 4 The 8051 Architecture 1 In this Lecture Overview General physical & operational features Block diagram Pin assignments Logic symbol Hardware description Pin

More information

Module I. Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC.

Module I. Microcontroller can be classified on the basis of their bits processed like 8bit MC, 16bit MC. MICROCONTROLLERS AND APPLICATIONS 1 Module 1 Module I Introduction to Microcontrollers: Comparison with Microprocessors Harvard and Von Neumann Architectures - 80C51 microcontroller features - internal

More information

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller EE4380 Fall 2001 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas 8051 Architecture Programmer s View Register Set Instruction Set Memory

More information

8051 Overview and Instruction Set

8051 Overview and Instruction Set 8051 Overview and Instruction Set Curtis A. Nelson Engr 355 1 Microprocessors vs. Microcontrollers Microprocessors are single-chip CPUs used in microcomputers Microcontrollers and microprocessors are different

More information

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller 1 Salient Features (1). 8 bit microcontroller originally developed by Intel in 1980. (2). High-performance CMOS Technology. (3). Contains Total 40 pins. (4). Address bus is of 16 bit

More information

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples.

Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples. MICROCONTROLLERS AND APPLICATIONS 1 Module 2 Module-2 Contents: Memory organization Programming model - Program status word - register banks - Addressing modes - instruction set Programming examples. MEMORY

More information

8051 microcontrollers

8051 microcontrollers 8051 microcontrollers Presented by: Deepak Kumar Rout Synergy Institute of Engineering and Technology, Dhenkanal Chapter 2 Introduction Intel MCS-51 family of microcontrollers consists of various devices

More information

UNIT IV MICROCONTROLLER

UNIT IV MICROCONTROLLER UNIT IV 8051- MICROCONTROLLER Prepared by R. Kavitha Page 1 Application Prepared by R. Kavitha Page 2 Pin Description of the 8051 UNIT IV- 8051 MICROCONTROLLER P1.0 P1.1 P1.2 P1.3 P1.4 P1.5 P1.6 P1.7 RST

More information

8051 Microcontroller

8051 Microcontroller 8051 Microcontroller The 8051, Motorola and PIC families are the 3 leading sellers in the microcontroller market. The 8051 microcontroller was originally developed by Intel in the late 1970 s. Today many

More information

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text

e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: 8051 Architecture Module No: CS/ES/5 Quadrant 1 e-text In this lecture the detailed architecture of 8051 controller, register bank,

More information

Microcontroller Intel [Instruction Set]

Microcontroller Intel [Instruction Set] Microcontroller Intel 8051 [Instruction Set] Structure of Assembly Language [ label: ] mnemonic [operands] [ ;comment ] Example: MOV R1, #25H ; load data 25H into R1 2 8051 Assembly Language Registers

More information

Module Contents of the Module Hours COs

Module Contents of the Module Hours COs Microcontrollers (EE45): Syllabus: Module Contents of the Module Hours COs 1 8051 MICROCONTROLLER ARCHITECTURE: Introduction to Microprocessors and Microcontrollers, the 8051 Architecture, 08 1 and pin

More information

Introduction To MCS-51

Introduction To MCS-51 Introduction To MCS-51 By Charoen Vongchumyen Department of Computer Engineering Faculty of Engineering KMITLadkrabang 8051 Hardware Basic Content Overview Architechture Memory map Register Interrupt Timer/Counter

More information

8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT89S52

8-bit Microcontroller with 8K Bytes In-System Programmable Flash AT89S52 Features Compatible with MCS -51 Products 8K Bytes of In-System Programmable (ISP) Flash Memory Endurance: 10,000 Write/Erase Cycles 4.0V to 5.5V Operating Range Fully Static Operation: 0 Hz to 33 MHz

More information

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller

Architecture & Instruction set of 8085 Microprocessor and 8051 Micro Controller of 8085 microprocessor 8085 is pronounced as "eighty-eighty-five" microprocessor. It is an 8-bit microprocessor designed by Intel in 1977 using NMOS technology. It has the following configuration 8-bit

More information

Input/Output Ports and Interfacing LCD & Seven Segment Display

Input/Output Ports and Interfacing LCD & Seven Segment Display Input/Output Ports and Interfacing LCD & Seven Segment Display Basic I/O Concepts Peripherals such as LEDs and keypads are essential components of microcontroller-based systems Input devices Provide digital

More information

8051 Microcontrollers

8051 Microcontrollers 8051 Microcontrollers Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu March 8, 2016 Controller vs Processor Controller vs Processor Introduction to 8051 Micro-controller In 1981,Intel corporation

More information

Unit I. Introduction Microcontrollers and Embedded processors Overview of the 8051 Inside the 8051 Addressing Modes

Unit I. Introduction Microcontrollers and Embedded processors Overview of the 8051 Inside the 8051 Addressing Modes Unit I Introduction Microcontrollers and Embedded processors Overview of the 8051 Inside the 8051 Addressing Modes 1.1.1. Basic Introduction 1.1.1. Basic Introduction (contd.) 1.1.1. Basic Introduction

More information

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman

Microprocessors 1. The 8051 Instruction Set. Microprocessors 1 1. Msc. Ivan A. Escobar Broitman Microprocessors 1 The 8051 Instruction Set Microprocessors 1 1 Instruction Groups The 8051 has 255 instructions Every 8-bit opcode from 00 to FF is used except for A5. The instructions are grouped into

More information

CS 320. Computer Architecture Core Architecture

CS 320. Computer Architecture Core Architecture CS 320 Computer Architecture 8051 Core Architecture Evan Hallam 19 April 2006 Abstract The 8051 is an 8-bit microprocessor designed originally in the 1980 s by the Intel Corporation. This inexpensive and

More information

8051 Memory Organization BY D. BALAKRISHNA, Research Assistant, IIIT-H Chapter 1: Memory Organization There are 2 types of memories available in 8051 microcontroller. Program memory/c code memory (ROM)

More information

C51 Family. Architectural Overview of the C51 Family. Summary

C51 Family. Architectural Overview of the C51 Family. Summary Architectural Overview of the C51 Family C51 Family Summary 1. Introduction............................................................ I.1. 1.1. TSC80C51/80C51/80C31.................................................................

More information

ISSI. IS89C51 CMOS SINGLE CHIP 8-BIT MICROCONTROLLER with 4-Kbytes of FLASH ISSI IS89C51 NOVEMBER 1998 FEATURES GENERAL DESCRIPTION

ISSI. IS89C51 CMOS SINGLE CHIP 8-BIT MICROCONTROLLER with 4-Kbytes of FLASH ISSI IS89C51 NOVEMBER 1998 FEATURES GENERAL DESCRIPTION IS89C51 CMOS SINGLE CHIP 8-BIT MICROCONTROLLER with 4-Kbytes of FLASH NOVEMBER 1998 FEATURES 80C51 based architecture 4-Kbytes of on-chip Reprogrammable Flash Memory 128 x 8 RAM Two 16-bit Timer/Counters

More information

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING

UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING UNIT 2 THE 8051 INSTRUCTION SET AND PROGRAMMING Instructions Alphabetical List of Instructions ACALL: Absolute Call ADD, ADDC: Add Accumulator (With Carry) AJMP: Absolute Jump ANL: Bitwise AND CJNE: Compare

More information

8051 Core Specification

8051 Core Specification 8051 Core Specification Authors: Jaka Simsic Simon Teran jakas@opencores.org simont@opencores.org Rev. 0.1 August 14, 2001 First Draft www.opencores.org Rev 0.1 First Draft 1 of 26 Revision History Rev.

More information

SN8F5000 Family Instruction Set

SN8F5000 Family Instruction Set SONiX Technology Co., Ltd. 8051-based Microcontroller 1 Overview SN8F5000 is 8051 Flash Type microcontroller supports comprehensive assembly instructions and which are fully compatible with standard 8051.

More information

8051 MICROCONTROLLER

8051 MICROCONTROLLER 8051 MICROCONTROLLER Mr.Darshan Patel M.Tech (Power Electronics & Drives) Assistant Professor Department of Electrical Engineering Sankalchand Patel College of Engineering-Visnagar WHY DO WE NEED TO LEARN

More information

The Timers/Counters The Serial Interface The Interrupt System Reset P0.0-P0.7 P2.0-P2.7. Port 2 Drivers. Port 2 Latch

The Timers/Counters The Serial Interface The Interrupt System Reset P0.0-P0.7 P2.0-P2.7. Port 2 Drivers. Port 2 Latch HARDWARE DESCRIPTION This chapter provides a detailed description of the 80C51 microcontroller (see Figure 1). Included in this description are: The port drivers and how they function both as ports and,

More information

1. Pin diagram of 8051 and ports

1. Pin diagram of 8051 and ports e-pg Pathshala Subject : Computer Science Paper: Embedded System Module: Programming parallel ports Module No: CS/ES/9 Quadrant 1 e-text In this lecture pin diagram of 8051 controller will be shown and

More information

Assembly Language programming (2)

Assembly Language programming (2) EEE3410 Microcontroller Applications LABORATORY Experiment 2 Assembly Language programming (2) Name Class Date Class No. Marks Arithmetic, Logic and Jump instructions Objectives To learn and practice the

More information

Rev. No. History Issue Date Remark

Rev. No. History Issue Date Remark Preliminary Bar Code Reader Document Title Bar Code Reader Revision History Rev. No. History Issue Date Remark 0.0 Initial issue June 5, 2000 Preliminary 0.1 Change document title from Bar Code Reader

More information

Engr. A. N. Aniedu Electronic and Computer Engineering Nnamdi Azikiwe University, Awka

Engr. A. N. Aniedu Electronic and Computer Engineering Nnamdi Azikiwe University, Awka Engr. A. N. Aniedu Electronic and Computer Engineering Nnamdi Azikiwe University, Awka INTRODUCTION Microcontroller vs General Purpose Microprocessor General-purpose microprocessors contains No RAM No

More information

Distributed by: www.jameco.com 1-800-831-4242 The content and copyrights of the attached material are the property of its owner. 8051 8052 and 80C51 Hardware Description December 1992 Order Number 270252-006

More information

Contents 8051 Instruction Set BY D. BALAKRISHNA, Research Assistant, IIIT-H Chapter I : Control Transfer Instructions Lesson (a): Loop Lesson (b): Jump (i) Conditional Lesson (c): Lesson (d): Lesson (e):

More information

VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-16kB Flash, 256B RAM, 40MHz, 8-Bit MCU

VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-16kB Flash, 256B RAM, 40MHz, 8-Bit MCU VRS550-8kB Flash, 256B RAM, 25~40MHz, 8-Bit MCU VRS560-6kB Flash, 256B RAM, 40MHz, 8-Bit MCU 34 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B H4 Tel: (54) 87-2447 http://www.goalsemi.com

More information

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU

VRS540-4kB Flash, 128B RAM, 25~40MHz, 8-Bit MCU VRS540-4kB Flash, 28B RAM, 25~40MHz, 8-Bit MCU 34 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B H4 Tel: (54) 87-2447 http://www.goalsemi.com P.3 P.2 XTAL NC P0./AD VRS540 Overview

More information

Embedded Controller Programming

Embedded Controller Programming Embedded Controller Programming Counters, Timers and I/O in Assembly Language Ken Arnold Copyright 2000-2004 Ken Arnold 1 Outline Timer/Counters Serial Port More 8051 Instructions Examples Copyright 2000-2004

More information

EE6502- MICROPROCESSOR AND MICROCONTROLLER

EE6502- MICROPROCESSOR AND MICROCONTROLLER . EE6502- MICROPROCESSOR AND MICROCONTROLLER UNIT III - 8051 MICROCONTROLLER PART - A 1. What is Microcontroller? A device which contains the microprocessor with integrated peripherals like memory, serial

More information

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING CHAPTER 2 8051 ASSEMBLY LANGUAGE PROGRAMMING Registers Register are used to store information temporarily: A byte of data to be processed An address pointing to the data to be fetched The vast majority

More information

UNIT MICROCONTROLLER AND ITS PROGRAMMING

UNIT MICROCONTROLLER AND ITS PROGRAMMING M i c r o p r o c e s s o r s a n d M i c r o c o n t r o l l e r s P a g e 1 UNIT-7 8051 MICROCONTROLLER AND ITS PROGRAMMING INTRODUCTION The microcontroller incorporates all the features that are found

More information

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote

Programming Book Microcontroller Kit. Rev 3.0 January, Wichit Sirichote Programming Book1 8051 Microcontroller Kit Rev 3.0 January, 016 016 Wichit Sirichote 1 Contents Overview...3 SAFTY INFORMATION...3 Tools...3 Experiment 1 Blinking LED...4 Experiment Binary number counting...9

More information

Dodatak. Skup instrukcija

Dodatak. Skup instrukcija Dodatak Skup instrukcija Arithmetic Operations [@Ri] implies contents of memory location pointed to by R0 or R1 Rn refers to registers R0-R7 of the currently selected register bank 2 ADD A,

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP 805 SFR Bus Digital Blocks Semiconductor IP 805 Microcontroller Configurable Peripherals General Description The Digital Blocks (Configurable Peripherals) Microcontroller Verilog IP Core is complaint with

More information

MODULE-1. Short Answer Questions

MODULE-1. Short Answer Questions MODULE-1 Short Answer Questions 1. Give the comparison between microprocessor and microcontroller. It is very clear from figure that in microprocessor we have to interface additional circuitry for providing

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP Digital Blocks Semiconductor IP 805 Microcontroller General Description The Digital Blocks Microcontroller Verilog IP Core is complaint with the MCS 5 Instruction Set and contains standard 805 MCU peripherals,

More information

ELEG3924 Microprocessor

ELEG3924 Microprocessor Department of Electrical Engineering University of Arkansas ELEG3924 Microprocessor Ch.2 Assembly Language Programming Dr. Jing Yang jingyang@uark.edu 1 OUTLINE Inside 8051 Introduction to assembly programming

More information

MCS -51 Programmer s Guide and Instruction Set

MCS -51 Programmer s Guide and Instruction Set MCS -51 Programmer s Guide and Instruction Set November 1992 Order Number 270249-003 COPYRIGHT INTEL CORPORATION 1996 MCS -51 PROGRAMMER S GUIDE AND INSTRUCTION SET CONTENTS PAGE MEMORY ORGANIZATION 1

More information

TUTORIAL Assembly Language programming (2)

TUTORIAL Assembly Language programming (2) 8051 Assembly Language programming (2) TUTORIAL 4 EEE3410 Microcontroller Applications 1. Write the instructions to move value 34h into register A and value 3Fh into register B, then add them together.

More information

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5

MICROCONTROLLER AND PLC LAB-436 SEMESTER-5 MICROCONTROLLER AND PLC LAB-436 SEMESTER-5 Exp:1 STUDY OF MICROCONTROLLER 8051 To study the microcontroller and familiarize the 8051microcontroller kit Theory:- A Microcontroller consists of a powerful

More information

CPEG300 Embedded System Design. Lecture 3 Memory

CPEG300 Embedded System Design. Lecture 3 Memory CPEG300 Embedded System Design Lecture 3 Memory Hamad Bin Khalifa University, Spring 2018 Review Von Neumann vs. Harvard architecture? System on Board, system on chip? Generic Hardware Architecture of

More information

MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Features of 8051:

MICROPROCESSORS AND MICROCONTROLLERS MATERIAL. Features of 8051: DEPARTMENT OF ECE MICROPROCESSORS AND MICROCONTROLLERS MATERIAL UNIT V 8051 MICROCONTROLLERS To make a complete microcomputer system, only microprocessor is not sufficient. It is necessary to add other

More information

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING

UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING UNIT THE 8051 INSTRUCTION SET AND PROGRAMMING Instructions Alphabetical List of Instructions ACALL: Absolute Call ADD, ADDC: Add Accumulator (With Carry) AJMP: Absolute Jump ANL: Bitwise AND CJNE: Compare

More information

Programming of 8085 microprocessor and 8051 micro controller Study material

Programming of 8085 microprocessor and 8051 micro controller Study material 8085 Demo Programs Now, let us take a look at some program demonstrations using the above instructions Adding Two 8-bit Numbers Write a program to add data at 3005H & 3006H memory location and store the

More information

VRS570 32K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS580 64K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU

VRS570 32K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS580 64K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS570 32K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU VRS580 64K Flash, 1kB RAM, 25~40MHz, 8-Bit MCU 1134 Ste Catherine Street West, Suite 900, Montreal, Quebec, Canada H3B 1H4 Tel: (514) 871-2447 http://www.goalsemi.com

More information

C51 Family. C51 Family Programmer s Guide and Instruction Set. Summary

C51 Family. C51 Family Programmer s Guide and Instruction Set. Summary C51 Family Programmer s Guide and Instruction Set Summary 1. Memory Organization.................................................... I.3.2 1.1. Program Memory.......................................................................

More information

8051 I/O and Class 6 EE4380 Spring 03. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas

8051 I/O and Class 6 EE4380 Spring 03. Pari vallal Kannan. Center for Integrated Circuits and Systems University of Texas at Dallas 8051 I/O and 8255 Class 6 EE4380 Spring 03 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Why I/O Ports Controllers need to get external inputs and produce

More information

Principle and Interface Techniques of Microcontroller

Principle and Interface Techniques of Microcontroller Principle and Interface Techniques of Microcontroller --8051 Microcontroller and Embedded Systems Using Assembly and C LI, Guang ( 李光 ) Prof. PhD, DIC, MIET WANG, You ( 王酉 ) PhD, MIET 杭州 浙江大学 2011 Chapter

More information

8051 Microcontrollers

8051 Microcontrollers 8051 Microcontrollers Richa Upadhyay Prabhu NMIMS s MPSTME richa.upadhyay@nmims.edu March 15, 2016 8051 INSTRUCTIONS JUMP, LOOP AND CALL INSTRUCTIONS 8051 INSTRUCTIONS Repeating a sequence of instructions

More information

Digital Blocks Semiconductor IP

Digital Blocks Semiconductor IP Digital Blocks Semiconductor IP DB805C-FSM 805 Microcontroller FSM Finite State Machine General Description The Digital Blocks DB805C-FSM IP Core contains Digital Blocks compact DB805C CPU Core & GPIO

More information

Microcontroller. Instruction set of 8051

Microcontroller. Instruction set of 8051 UNIT 2: Addressing Modes and Operations: Introduction, Addressing modes, External data Moves, Code Memory, Read Only Data Moves / Indexed Addressing mode, PUSH and POP Opcodes, Data exchanges, Example

More information

8051 Microcontroller. Ali Ziya Alkar 1

8051 Microcontroller. Ali Ziya Alkar 1 8051 Microcontroller Ali Ziya Alkar 1 8051 Introduction 8051 is one of the most popular microcontrollers in use today. Many derivative microcontrollers have since been developed that are based on--and

More information

8051 Programming: Arithmetic and Logic

8051 Programming: Arithmetic and Logic 8051 Programming: Arithmetic and Logic EE4380 Fall 2002 Class 4 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Topics Signed and Unsigned arithmetic Binary

More information

Y51 Microcontroller. Technical Manual

Y51 Microcontroller. Technical Manual Y51 Microcontroller Technical Manual Disclaimer Systemyde International Corporation reserves the right to make changes at any time, without notice, to improve design or performance and provide the best

More information

ELEG3923 Microprocessor Ch.2 Assembly Language Programming

ELEG3923 Microprocessor Ch.2 Assembly Language Programming Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.2 Assembly Language Programming Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 Inside 8051 Introduction to assembly programming

More information

Question Bank Microprocessor and Microcontroller

Question Bank Microprocessor and Microcontroller QUESTION BANK - 2 PART A 1. What is cycle stealing? (K1-CO3) During any given bus cycle, one of the system components connected to the system bus is given control of the bus. This component is said to

More information

8051 MICROCONTROLLER

8051 MICROCONTROLLER What is a Microcontroller? UNIT 5 8051 MICROCONTROLLER A Microcontroller is a programmable digital processor with necessary peripherals. Both microcontrollers and microprocessors are complex sequential

More information

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution

Vidyalankar T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution 1. (a) 1. (b) T.E. Sem. V [ETRX] Microprocessors and Microcontrollers I Prelim Question Paper Solution Priority modes. 1) Fully Nested Mode : It is a general purpose mode. IR 0 highest priority IR 1 lowest

More information

80C51 family programmer s guide and instruction set. 80C51 Family. PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization. Philips Semiconductors

80C51 family programmer s guide and instruction set. 80C51 Family. PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization. Philips Semiconductors PROGRAMMER S GUIDE AND INSTRUCTION SET Memory Organization Program Memory The 80C51 has separate address spaces for program and data memory. The Program memory can be up to 64k bytes long. The lower 4k

More information

ET355 Microprocessors Thursday 6:00 pm 10:20 pm

ET355 Microprocessors Thursday 6:00 pm 10:20 pm ITT Technical Institute ET355 Microprocessors Thursday 6:00 pm 10:20 pm Unit 4 Chapter 6, pp. 139-174 Chapter 7, pp. 181-188 Unit 4 Objectives Lecture: BCD Programming Examples of the 805x Microprocessor

More information

TUTORIAL. Donal Heffernan University of Limerick May Tutorial D.Heffernan 2000,

TUTORIAL. Donal Heffernan University of Limerick May Tutorial D.Heffernan 2000, 8051 TUTORIAL Donal Heffernan University of Limerick May-2002 8051 Tutorial D.Heffernan 2000, 2001 1 Blank 8051 Tutorial D.Heffernan 2000, 2001 2 Some reference material: Test books + MacKenzie Scott.

More information

ET2640 Microprocessors

ET2640 Microprocessors ET2640 Microprocessors Unit -2 Processor Programming Concepts Basic Control Instructor : Stan Kong Email : skong@itt-tech.edu Figure 2 4 Bits of the PSW Register 8051 REGISTER BANKS AND STACK 80 BYTES

More information

EXPERIMENT NO.1. A Microcontroller is a complete computer system built on a single chip.

EXPERIMENT NO.1. A Microcontroller is a complete computer system built on a single chip. EXPERIMENT NO.1 AIM: Study of 8051 Microcontroller TOOLS: 8051 kit THEORY: Salient Features of 8051 A Microcontroller is a complete computer system built on a single chip. It contains all components like

More information

8XC51RA RB RC Hardware Description

8XC51RA RB RC Hardware Description 8XC51RA RB RC Hardware Description February 1995 Order Number 272668-001 Information in this document is provided in connection with Intel products Intel assumes no liability whatsoever including infringement

More information

C H A P T E R 1 INTRODUCTION

C H A P T E R 1 INTRODUCTION C H A P T E R 1 INTRODUCTION The mentioned project is based on the worlds most powerful intel controller 8051. Most of the services provided in todays world are voice interactive, you call up your bank

More information

Arithmetic and Logic

Arithmetic and Logic 8051 - Arithmetic and Logic EE4380 Fall 2001 Class 8 Pari vallal Kannan Center for Integrated Circuits and Systems University of Texas at Dallas Signed Arithmetic - Concepts Representation of the sign

More information

SOLUTION MANUAL FOR THE 8051 MICROCONTROLLER 4TH EDITION BY MACKENZIE AND PHAN

SOLUTION MANUAL FOR THE 8051 MICROCONTROLLER 4TH EDITION BY MACKENZIE AND PHAN SOLUTION MANUAL FOR THE 8051 MICROCONTROLLER 4TH EDITION BY MACKENZIE AND PHAN Chapter 1 - Introduction to Microcontrollers 1. (a)the first widely used microprocessor was the 8080. (b) The 8080 was introduced

More information

Lecture 1. Course Overview and The 8051 Architecture

Lecture 1. Course Overview and The 8051 Architecture Lecture 1 Course Overview and The 8051 Architecture MCUniversity Program Lectures 8051 architecture t System overview of C8051F020 8051 instruction set System clock, crossbar and GPIO Assembler directives

More information

Microcontroller and Applications

Microcontroller and Applications S.Y. Diploma : Sem. IV [DE/EJ/ET/EN/EX/EQ/IS/IC/IE] Microcontroller and Applications Time: 3 Hrs.] Prelim Question Paper Solution [Marks : 70 Q.1 Attempt any FIVE of the following : [10] Q.1(a) Define

More information

Principle and Interface Techniques of Microcontroller

Principle and Interface Techniques of Microcontroller Principle and Interface Techniques of Microcontroller --8051 Microcontroller and Embedded Systems Using Assembly and C LI, Guang ( 李光 ) Prof. PhD, DIC, MIET WANG, You ( 王酉 ) PhD, MIET 杭州 浙江大学 2014 Chapter

More information

PGT302 Embedded Software Technology. PGT302 Embedded Software Technology

PGT302 Embedded Software Technology. PGT302 Embedded Software Technology PGT302 Embedded Software Technology 1 PART 4 Hardware Platform 2 2 Objectives for Part 4 Need to DISCUSS and ANALYZE the following topics: Board (GTUC51B001) specifications startup sequence, bootloader

More information

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT- IV

MAHALAKSHMI ENGINEERING COLLEGE TIRUCHIRAPALLI UNIT- IV UNIT- IV PART A (2 MARK QUESTIONS) 1. What is the need for de-bouncing the keyboard? (AUC NOV 2012) Debouncing is any kind of hardware device or software that ensures that only a single signal will be

More information

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS

MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS MASSEY UNIVERSITY PALMERSTON NORTH CAMPUS EXAMINATION FOR 159.233 COMPUTER SYSTEMS Semester One June 2008 Time allowed: THREE (3) hours This exam contains THREE (3) questions ANSWER ALL THREE (3) QUESTIONS

More information

MICROPROCESSOR LABORATORY MANUAL

MICROPROCESSOR LABORATORY MANUAL MICROPROCESSOR LABORATORY MANUAL T.C. AYDIN ADNAN MENDERES UNIVERSITY ENGINEERING FACULTY ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT Prepared by: Res. Asst. Abdullah GÜLDEREN Aydın 2019 Contents 1.

More information

Contents. Join the Technical Community Today!

Contents. Join the Technical Community Today! Contents CHAPTER 1: INTRODUCTION... 5 1. WELCOME... 5 1.2 PS 8051 BOARD OVERVIEW... 6 1.3 PS 8051 SPECIFICATIONS... 7 CHAPTER 2: SYSTEM DESCRIPTION... 9 2.1 HARDWARE... 9 2.2 MAPPING OF DEVICES... 11 2.2.1

More information

8-BIT MICROCONTROLLER

8-BIT MICROCONTROLLER 8-BIT MICROCONTROLLER Table of Contents- 1 GENERAL DESCRIPTION... 4 2 FEATURES... 5 3 PARTS INFORMATION LIST... 6 3.1 Lead Free (RoHS) Parts information list... 6 4 PIN CONFIGURATIONS... 7 5 PIN DESCRIPTIONS...

More information

Microcontrollers. Fig. 1 gives a comparison of a microprocessor system and a microcontroller system.

Microcontrollers. Fig. 1 gives a comparison of a microprocessor system and a microcontroller system. Syllabus: : Introduction to, 8051 Microcontroller Architecture and an example of Microcontroller based stepper motor control system (only Block Diagram approach). (5 Hours) Introduction to A microcontroller

More information

Application Brief D-005

Application Brief D-005 Interfacing the Avago HDSP-2xxx LED Alphanumeric Displays with the Intel 8751H Microcontroller Application Brief D-005 Introduction The HDSP-21xx/-25xx series of products is ideal for applications where

More information

MICROPROCESSOR & MICROCONTROLLER

MICROPROCESSOR & MICROCONTROLLER a) From road north to East From road east to north From road south to west From road west to south From road west to north b) From road north to East From road south to west From road south to north From

More information

Figure Programming model

Figure Programming model LAB 1: Intel 8051 CPU PROGRAMMING DATA TRANSFER INSTRUCTIONS OBJECTIVES At the end of the laboratory works, you should be able to write simple assembly language programs for the Intel 8051 CPU using data

More information

Chapter Addressing Modes

Chapter Addressing Modes Chapter 5 8051 Addressing Modes 1 Sections 5.1 Immediate and register addressing modes 5.2 Accessing memory using various address modes 2 Objective 程式中的資料可能是放在 Register 中, 或在 RAM 中某一位址上, 或在 ROM 一塊特殊區域放置資料,

More information

ELEG3923 Microprocessor Ch.4 I/O Ports

ELEG3923 Microprocessor Ch.4 I/O Ports Department of Electrical Engineering University of Arkansas ELEG3923 Microprocessor Ch.4 I/O Ports Dr. Jingxian Wu wuj@uark.edu OUTLINE 2 8051 I/O programming I/O bit manipulation programming I/O PORT

More information

CPEG300 Embedded System Design. Lecture 6 Interrupt System

CPEG300 Embedded System Design. Lecture 6 Interrupt System CPEG300 Embedded System Design Lecture 6 Interrupt System Hamad Bin Khalifa University, Spring 2018 Correction Lecture 3, page 18: Only direct addressing mode is allowed for pushing or popping the stack:

More information

DR bit RISC Microcontroller. Instructions set details ver 3.10

DR bit RISC Microcontroller. Instructions set details ver 3.10 DR80390 8-bit RISC Microcontroller Instructions set details ver 3.10 DR80390 Instructions set details - 2 - Contents 1. Overview 7 1.1. Document structure. 7 2. Instructions set brief 7 2.1. Instruction

More information

ENE 334 Microprocessors

ENE 334 Microprocessors Page 1 ENE 334 Microprocessors Lecture 7: MCS-51 Architecture I : Dejwoot KHAWPARISUTH http://webstaff.kmutt.ac.th/~dejwoot.kha/ ENE 334 MCS-51 Architecture I Page 2 Outlines: 8051 Microcontroller Hardware

More information

ENE 334 Microprocessors

ENE 334 Microprocessors Page 1 ENE 334 Microprocessors Lecture 10: MCS-51: Logical and Arithmetic : Dejwoot KHAWPARISUTH http://webstaff.kmutt.ac.th/~dejwoot.kha/ ENE 334 MCS-51 Logical & Arithmetic Page 2 Logical: Objectives

More information

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE:

1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE: 1. INTRODUCTION TO MICROPROCESSOR AND MICROCOMPUTER ARCHITECTURE: A microprocessor is a programmable electronics chip that has computing and decision making capabilities similar to central processing unit

More information

Microcontroller and Embedded Systems:

Microcontroller and Embedded Systems: Microcontroller and Embedded Systems: Branches: 1. Electronics & Telecommunication Engineering 2. Electrical & Electronics Engineering Semester: 6 th Semester / 7 th Semester 1. Explain the differences

More information