StudentShare
Contact Us
Sign In / Sign Up for FREE
Search
Go to advanced search...
Free

Interface: 8255 and 8051 Micro Controllers - Coursework Example

Cite this document
Summary
"Interface: 8255 and 8051 Micro Controllers" paper provides the keypad and display of the interface between 8255 and 8051 microcontroller systems. The paper illustrates a blinking LED program, in which the LED bulbs are joined directly to the 8255 port labeled A…
Download full paper File format: .doc, available for editing
GRAB THE BEST PAPER91.1% of users find it useful
Interface: 8255 and 8051 Micro Controllers
Read Text Preview

Extract of sample "Interface: 8255 and 8051 Micro Controllers"

Registration Number Logic and programming 8051 with 8255 interface (micro controllers) PART A: 8255 AND 8051 INTERFACE This projectprovides the keypad and display of the interface between 8255 and 8051 microcontroller systems. The circuit diagram is shown in Appendix 1.1 in the Figures File. The project illustrates a blinking LED program, in which the LED bulbs are joined directly to the 8255 port labeled A. The code works in a way that as the lower 4 nibbles of port A of the 8255 goes high; the 4 upper nibbles goes low. After a given delay, the lower nibbles turns low as the upper nibbles goes up and glows. The process goes on repeatedly. In the circuit, Port A0 of 8255 microcontroller is connected with port 1 of 8051 microcontroller at pin 0, and port A1 is connected with port 1 at pin 1. The delay () function produces a certain amount of delay. Inside the main function, we make port 2 and port 3 the output ports. Then the rd (read) is set to rd =1, to prevent it from reading any data from 8255. The WR (write) is also set to WR = 0, to enable it write to the 8255 microcontroller. The 0x80 is sent to the data pins of 8255 as the control word to set all 8255 ports as the output ports. The control register is selected since so that the control word can be written on it. Then the while loop makes port A nibbles alternatively high and low, and blinks the LEDs alternatively. The flowchart is shown in Appendix 1.2, in the Figures File. How the Code Works The code loads the augend in the DE pair through the HL pair. It also loads the addend in the HL pair. The next process is to initialize register A for carrying the results and adding the contents of the HL Pair to the DE pair. In the absence of carry instruction, it moves to LOOP to increment the register “reg A”. The final task of the code is to store the content of the HL Pair in the 8051H and the carry in 8051H. Code Explanation MVI C, 00 - Initializes the C register LHLD 8051H - Loads the subtrahend in the DE register pair through the HL register pair. LHLD - 8051H Loads minuend in the HL register Pair MOV A, L - Moves the contents of the register L to Accumulator SUB E Subtract the values of the register E from the contents of the accumulator. MOV L, A Moves the values contained in the Accumulator to the register L MOV A, H Moves the values of register H to the Accumulator SBB D Subtracts the values contained in the register D from the values in the Accumulator. MOV H, A Transfers the values contained in the accumulator to register H SHLD 8255H - Stores the values contained in the HL pair in the memory position 8255H JNC NEXT goes to the instruction “NEXT” when borrow is present INR C – Increments the register C MOV A, C - Transfers the values contained in register C to the Accumulator STA 8051H - Store the content of acc. to the memory location 8051H HLT Stops the running of the program Explanation of the Code LHLD 8051 loads the first value on the stack pointer via the HL register pair LXI H, 0000H Loads the second value in the HL register pair and Exchanges with the DE register pair LXI B, 0000H - Clears the HL and the DE register pairs DAD SP Adds the SP with the HL pair JNC NEXT – goes to instruction “NEXT” when there is no carry INX B – Does incrementing of the BC register pair DCX D – does decrementing of the DE register pair MOV A, E - Moves the values contained in register E to the Accumulator ORA D – does the ORing of the Accumulator with the D register JNZ LOOP - goes to the “Loop” instruction when there zero is not found SHLD 8255 - Keeps the values of the HL register pair in the memory positions 8050 & 8055 MOV A, C - Moves the values contained in register C to the Accumulator STA 8255 – keeps the values contained in the Accumulator in the memory position 8056. MOV A, B - Moves the values contained in register B to the Accumulator STA 8255 – Keeps the values contained in the Accumulator in the memory position 8056. HLT – Ends the running of the program Method Providing Key Debounce The method is Mode 0 interrupt on the terminal. The initial output is low. After the loading of the counter, the results remain while counting continues on the terminal count. The results go high until the next reloading. This requires changing of jumper 3 and connecting of the CLK 0 to the debounce before the program execution. When depressing and releasing a key, there is no permanent break of contact. The frequency of making and breaking contact is several times in a millisecond. The flow chart is presented in the Appendix 1.4 in the Figures File. How to ensure a Flicker Free Display Flickering takes place because of the Pulse Width Modulation, working at a constant frequency. It keeps the backlight turning on and off and makes the backlight on the LED dim. The flickering effect eliminated or reduced by introducing back light of high-frequency. The illustration is seen in Table 1 in the Appendix 1.5. How to Handle Concurrent Key Presses The codes for the keys to be pressed can be stored in rows in the memory. When the first Key is pressed, the row number and the column number are used to identify the position. The key codes are then derived from the table 2 in Appendix 1.6 in the Figures file and applied in the program. Potential Use of Interupt In the interface between 8255 board to the 8051, the interrupt verifies the operation of the 8255 in different modes. The first mode is the Interrupt on the count of terminals. This makes the output initially low after the operation to set the mode. The output remains low after the load of the counter and when and goes high when on the terminal count. The CLK 0 is linked to the debounce circuit by altering the jumper J3 and executing following program. The appendix 1.7 in figure 5 shows the flow chart of the same, in the Figures File. PART B: ARITHMETIC CALCULATOR The codes for arithmetic operations codes and results are shown in Appendix 1.8 in the Figures file, including addition, multiplication, subtraction and division. How The Codes works Addition (+) The code loads the augend in the DE pair through the HL pair. It also loads the addend in the HL pair. The next process is to initialize register A for carrying the results and adding the contents of the HL Pair to the DE pair. In the absence of carry instruction, it moves to LOOP to increment the register “reg A”. The final task of the code is to store the content of the HL Pair in the 8051H and the carry in 8051H. Subtraction (-) The code begins by Clearing the C register and Initializing the HL register to 4500.It then Transfers the first data to the accumulator and Increments the HL register to point the next memory Location. The nest operation is to Subtract the first number from the accumulator Contents and to jump to the location if the result does not produce a “borrow”. The next operation is to Increment the C register and Complement the Accumulator contents. It then adds the 01H to the Accumulator content and Moves carry to the memory. Finally, it Stops the execution of the program. Multiplication (*) The code Initializes the HL register to 4500 and Transfers the first data to the register B. It then Increments the HL registers to point the next memory Location and clears the accumulator. The code then clears the C register for carry and Adds the multiplicand multiplier times. It then Jumps to the NEXT if it finds no carry, and Increments the C register but Decrements the B register. The next step is to Jump to the L1 if the value of B is not a zero. The code Increments the HL register to point the next memory Location. It transfers the values from the accumulator to the memory. It Increments the HL register to point the next memory Location. It Transfers the values from the C register to the memory and finally stops the program. Division ÷ In division, the code Clears the B register for quotient and then initializes the HL register to 4500H. The next operation is to transfer the dividend to the accumulator and to Increment the HL register to point to the next memory Location. The next operation is to subtract the divisor from the dividend. The next operation is to Increment the B register and to Jump to the LOOP when the result fails to produce a “borrow”. It then adds divisor to the accumulator and to decrement the B register and to increment the HL register to point the next memory Location. It then moves the remainder from the accumulator to the memory. It increment the HL register to point the next memory Location. It finally moves the quotient from the B register to memory and ends the program execution. Read More
Cite this document
  • APA
  • MLA
  • CHICAGO
(Interface: 8255 and 8051 Micro Controllers Coursework Example | Topics and Well Written Essays - 1500 words, n.d.)
Interface: 8255 and 8051 Micro Controllers Coursework Example | Topics and Well Written Essays - 1500 words. https://studentshare.org/logic-programming/1854344-8051-with-8255-interface-micro-controllers
(Interface: 8255 and 8051 Micro Controllers Coursework Example | Topics and Well Written Essays - 1500 Words)
Interface: 8255 and 8051 Micro Controllers Coursework Example | Topics and Well Written Essays - 1500 Words. https://studentshare.org/logic-programming/1854344-8051-with-8255-interface-micro-controllers.
“Interface: 8255 and 8051 Micro Controllers Coursework Example | Topics and Well Written Essays - 1500 Words”. https://studentshare.org/logic-programming/1854344-8051-with-8255-interface-micro-controllers.
  • Cited: 0 times

CHECK THESE SAMPLES OF Interface: 8255 and 8051 Micro Controllers

“authority”, “responsibility” and “accountability”

Every manager delegates work wherein terms such as authority, responsibility and accountability become the basic concepts that can be described as essential of the process of… Delegation involves actions such as assigning duties to subordinates, delegating the required authority to the subordinate to enable them to discharge the duties assigned to them and the assumption of responsibility by the subordinate for the word delegated to One of the candidates who were contesting for captainship of school head girl, due to her wealth and power was stating that the other girl was wasting her time campaigning, for she was sure to win the elections....
5 Pages (1250 words) Essay

User Interface

If a user Answer In order to ensure that the Trader shall not be able to overlook the Special Instructions intentionally or mistakenly, the following changes shall be made to the user interface of ETT:1.... A text area shall be added in the ‘Selected Order' area to display the value of the ‘Special Instructions' column of the selected order in the ‘Open Orders' grid....
1 Pages (250 words) Case Study

Brain Computer Interfaces

But with EEG, communication with out the use of muscles and nerves is achieved with the help of brain computer interface.... BCI records the brain signals, and allows it to communicate and manage its environment.... The brain signals were first discovered in animals by… It was in 1929 that Hans Berger recorded these signals from human brain....
2 Pages (500 words) Term Paper

Unit 1 Micro

micro Introduction In common, anytime unrestricted market is banned from setting charges in symmetry, supply and demand will not equal, and excesses or deficiencies will transpire.... In common, anytime unrestricted market is banned from setting charges in symmetry, supply and demand will not equal, and excesses or deficiencies will transpire....
2 Pages (500 words) Assignment

Risk Characterization and Management

This is because an established Program 10 January micro The ment, ‘the enemy with us: Lessons from the European Escherichia coli 0102:H4 outbreak,' is the title of an article that Karch et al.... The statement, ‘the enemy with us: Lessons from the 2011 European Escherichia coli 0102:H4 outbreak,' is the title of an article that Karch et al....
2 Pages (500 words) Essay

Interfaces, Database Integration, and Controls

Interfaces can be divided into numerous types starting with the hardware… Hardware interfaces are the logical, mechanical and electrical signals within the interface and the procedure for classifying them at times known as signalling.... This hardware interfaces are present in multiple Interfaces, database integration, and controls management affiliation Interfaces, database integration, and controls managementA boundary through which different constituents of the computer system can exchange data can be referred to as an interface....
2 Pages (500 words) Essay

Micro, Midrange and Macroissues: Polifact

For example, the site informed its readers that there are no documents proving the statement of Scott Walker who said that: "Documents released from the Soviet Union show "the Soviet Union started treating President Ronald Reagan more seriously after Reagan fired the air traffic controllers”.... micro Issues1....
2 Pages (500 words) Assignment

Programmable Logic Controllers

This research paper "Programmable Logic controllers" presents a Programmable Logic Controller (PLC) that is a computer used in industries to supervise input variables and give corresponding outputs based upon the computational logic stored in it.... 4) Power supply: Most PLC controllers work either at 24 VDC or 220 VAC....
2 Pages (500 words) Research Paper
sponsored ads
We use cookies to create the best experience for you. Keep on browsing if you are OK with that, or find out how to manage cookies.
Contact Us