Source: http://www.edsim51.com/8051Notes/interfacing.html#motors Motor Source: http://www.edsim51.com/8051Notes/interfacing.html#motors.

Slides:



Advertisements
Similar presentations
Chapter 3 INSTRUCTION SET SUMMARY
Advertisements

Week10 Boolean Instructions on the Boolean Instructions  Boolean (or Bit) addressable capability is unique to the 8051  Enables efficient handling.
1 Chapter 3 Jump, Loop, and Call Instructions. 2 Sections 3.1 Loop and Jump Instructions 3.2 Call Instructions 3.3 Time Delay Generation and Calculation.
Msc. Ivan A. Escobar Broitman Microprocessors 1 1 The 8051 Instruction Set.
CSC Timers Since this is a microcontroller it mainly finds itself in embedded devices Quite often embedded devices need to synchronize events The.
8051 ASSEMBLY LANGUAGE PROGRAMMING
Microcontroller Intel 8051
MICROCONTROLLER INSTRUCTION SET
Microprocessor Programming II
Prof. Cherrice TraverEE/CS-152: Microprocessors and Microcontrollers The 8051 Assembly Language.
Computer Architecture Lecture 13 – part 2 by Engineer A. Lecturer Aymen Hasan AlAwady 7/4/2014 University of Kufa - Information Technology Research and.
MICROCONTROLLERS 8051.
The 8051 Assembly Language Branching & Subroutines
Prof. Cherrice TraverEE/CS-152: Microprocessors and Microcontrollers The 8051 Assembly Language.
The 8051 Microcontroller and Embedded Systems
Lecture Set 4 Programming the 8051.
Ass Prof Dr Masri Ayob TK 2633: Microprocessor & Interfacing Lecture 6: Control Instructions.
EE/CS-352: Embedded Microcontroller Systems Part V The 8051 Assembly Language Interrupts.
JUMP, LOOP, AND CALL INSTRUCTIONS
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني 8085 Instruction Set logic group. Branch group. Stack memory and machine control. Addressing modes.
Microprocessor Systems Design I
Gursharan Singh Tatla INSTRUCTION SET OF 8085 Gursharan Singh Tatla Gursharan Singh Tatla
Unit 1 Instruction set M.Brindha AP/EIE
Assembly Language Programming of 8085
Microprocessor T. Y. B. Sc..
Source: Serial Port Source:
Detailed Review of the 8085 Instruction Set.
Homework Reading Labs PAL, pp
3.Instruction Set of 8085 Consists of 74 operation codes, e.g. MOV
Interfacing of LCD with µP
Lecture Set 5 The 8051 Instruction Set.
Instruksi Set Prosesor 8088
Subroutines and the Stack
Microprocessor and Assembly Language
Introduction to 8085 Instructions
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 3 & 4 Part 2
Source: Motor Source:
ECE,JYOTHI ENGG COLLEGE
INSTRUCTION SET.
More on logical instruction and
Assembly Language Programming Part 2
Data Processing Instructions
Boolean Operations This group of instructions is associated with the single-bit operations of the This group allows manipulating the individual bits.
SCHOOL OF ELECTRONICS ENGINEERING Electronics and Communication
8051 Single Board Computer (SBC) Version 1.0
Timer.
(Electrical Engg 6th Semester)
Branching Instructions
Introduction to Micro Controllers & Embedded System Design Instruction set Department of Electrical & Computer Engineering Missouri University of Science.
Source: Motor Source:
Detailed Review of the 8085 Instruction Set.
Subroutines and the Stack
Microcontroller 8051 Made By: Arun Branch. 4th Sem. I&C Engg.
Conditional Jumps and Time Delays
DC motor.
Introduction to Micro Controllers & Embedded System Design Instruction set Department of Electrical & Computer Engineering Missouri University of Science.
Homework Reading Machine Projects Labs PAL, pp
Conditional Jumps and Time Delays
DMT 245 Introduction to Microcontroller
First Design Key board R L S.
EE6502/MPMC/UNIT II/STACK AND SUBROUTINE/T.THARANKUMAR
Conditional Jumps and Time Delays
8051 Micro Controller.
Source: Serial Port Source:
8051 ASSEMBLY LANGUAGE PROGRAMMING
Subroutines and the Stack
ARITHMETIC, LOGIC INSTRUCTIONS, AND PROGRAMS
Some Assembly (Part 2) set.html.
Chapter 8: Instruction Set 8086 CPU Architecture
Branching Instructions By Dr. S. N. Sampat, Team leader Ms. R. P
Presentation transcript:

Source: http://www.edsim51.com/8051Notes/interfacing.html#motors Motor Source: http://www.edsim51.com/8051Notes/interfacing.html#motors

An interfacing method for turning on and off a DC motor via a microcontroller is shown below. However, the above circuit will only work for a 5 V motor. If the supply voltage is changed (for example, if the supply is changed to 12 V to run a 12 V motor) then the motor will be on all the time because 5 V applied to the base of the p-n-p transistor is not enough to turn it off.

To interface to larger motors the following circuit may be used.

Bi-directional DC Motor P3.1 P3.0 A (P3.1) B (P3.0) Motor off 1 (5 V) On, reverse On, forward This configuration allows the controller to not only turn on and off the motor but also to set the rotating direction.

To select a 7-segment display SW0

The subroutine setDirection setDirection: PUSH ACC ; save value of A on stack PUSH 20H ; save value of location 20H (first bit-addressable ; location in RAM) on stack CLR A ; clear A MOV 20H, #0 ; clear location 20H MOV C, P2.0 ; put SW0 value in carry MOV ACC.0, C ; then move to ACC.0 MOV C, F0 ; move current motor direction in carry MOV 0, C ; and move to LSB of location 20H (which has bit address 0) CJNE A, 20H, changeDir ; | compare SW0 (LSB of A) with F0 (LSB of 20H) ; | - if they are not the same, the motor's direction needs to be reversed JMP finish ; if they are the same, motor's direction does not need to be changed changeDir: CLR P3.0 ; | CLR P3.1 ; | stop motor CALL clearTimer ; reset timer 1 (revolution count restarts when motor direction changes) MOV C, P2.0 ; move SW0 value to carry MOV F0, C ; and then to F0 - this is the new motor direction MOV P3.0, C ; move SW0 value (in carry) to motor control bit 1 CPL C ; invert the carry MOV P3.1, C ; | and move it to motor control bit 0 (it will therefore have the opposite ; | value to control bit 1 and the motor will start ; | again in the new direction) finish: POP 20H ; get original value for location 20H from the stack POP ACC ; get original value for A from the stack RET ; return from subroutine

The subroutine setDirection Subroutine name: setDirection Function: Check the status of SW0 at P2.0. If SW0 is closed, Variables: F0: The current motor direction. = 0 for reverse (anticlockwise) rotation; = 1 for forward (clockwise) rotation P2.0: The open/closed status of SW0. = 0 if SW0 is closed; = 1 if SW0 is open. P2.0: The new motor direction. (P3.1, P3.0): To control the motor direction. = (0, 1) for reverse (anticlockwise) rotation; = (1, 0) for forward (clockwise) rotation

Instruction description: MOV 0, C ; To move C to LSB of location 20H (which has bit address 0)

ICP-W11-01 = motor direction control with simplified instruction sequence In ICP-W11-011, instead of using CJNE, use other branching control instructions for the subroutine “setDirection”. This may simplify this subroutine as well as making it easier to be understood. Some Branching Control Instructions Function JB Jump if the bit (specified by the first operand) = 1. JBC Same as JB, except that the bit is clear. JNB Jump if the bit (specified by the first operand) = 0. JC Jump if the carry flag = 1 JNC Jump if the carry flag = 0 JZ Jump if the accumulator = 0 JNZ Jump if the accumulator = 1

Aliasing What causes aliasing? Ans: Source: https://en.wikipedia.org/wiki/Aliasing

Wagon wheel effect