1 / 17

Microprocessor and Microcontroller Based Systems

بسم الله الرحمن الرحيم. The Islamic University of Gaza Faculty of Engineering Electrical Engineering Department. Microprocessor and Microcontroller Based Systems. ECOM 4315 — Fall 2008. Instructor: Eng.Moayed N. EL Mobaied. Lecture 16. Look Up Table.

conan-ortiz
Download Presentation

Microprocessor and Microcontroller Based Systems

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. بسم الله الرحمن الرحيم The Islamic University of Gaza Faculty of Engineering Electrical Engineering Department Microprocessor and Microcontroller Based Systems ECOM 4315 — Fall 2008 Instructor: Eng.Moayed N. EL Mobaied Lecture 16

  2. Look Up Table Look Up Table: • The LUT is used when being disable to find a special relation between the input and the output in any way. • LUT can be used in: ? ? ? • Seven segment • LCD • CODE

  3. Example Look Up Table: • Seven segment( 0 9) using indirect addressing • Seven segment ( available characters)

  4. EXAMPLE SEVEN segment

  5. EXAMPLE SEVEN segment

  6. EXAMPLE SEVEN segment

  7. Macros Macros Macros are a very useful element in assembly language. They could briefly be described as "user defined group of instructions which will enter assembler program where macro was called". It is possible to write a program even without using macros. But with their use written program is much more readable, especially if more programmers are working on the same program together. Macros have the same purpose as functions of higher program languages.

  8. Macros How to write macros? From the way they were written, we could be seen that macros can accept arguments, too which is also very useful in programming. Whenever argument appears in the body of a macro, it will be replaced with the <argumentN> value. In order to use a macro in the program, it is necessary to include macro file in the main program with instruction include "macro_name.inc".

  9. What's the difference between macro and subroutine? Macros • In execution stage, the subroutine puts the address of the called function in PC and hide the original value of PC (before calling) in the stack. • 2) The macro in compilation process (not in execution), copies the macro in the place where it is called. It doesn't put address on stack. • 3) The subroutine can be written or called in any place, but the macro must be declared before calling. • 4) The subroutine takes more time in execution, but the macro doesn't take time. This can be considered as an advantage to the macro. • 5) The subroutine doesn't take size in the program, but the macro takes as it is copied in the program during calling. It is considered as disadvantage to the macro.

  10. Types for using of Macros: (Using Macros internally )

  11. Types for using of Macros: (Using Macros internally )

  12. Types for using of Macros: (Using Macros externally )

  13. Types for using of Macros: (Using Macros externally )

  14. Types for using of Macros: (Using Macros externally )

  15. Notes Macros • Notes: • The first Macro is declared internally in the same file, but the second Macro is declared externally. • In calling Macros, we didn't write the command call or other commands. We call it by writing its name directly. • The program with internally or externally macro is the same size. • Externally macros must be included in the same folder of the main program in which it is called,or writing its extension in the include statement.

  16. H.W#7 Deadline: second week (2/11/2008 Tuesday) Write two programs ( internally macro ,externally macro) 1) BANK0 BANK1 2) Macro for reading from EEPROM Macro for Writing to EEPROM 3) Macro to perform multiplication process ( one digit) then (two digits) Macro to perform division process (one digit ) then ( two digits)

  17. Design problems Design # 2 ( DC motor with optical encoder) • Design controller for DC motor • Switch for on/off • Switch for right/left rotation • Switch for speed control. • speed level (8 led’s) • Close loop with k controller.

More Related