Вы находитесь на странице: 1из 11

LCD interfacing

• LCD => (i)character LCD (ii) Graphics LCD


• We shall do programming of character LCD

Dr. Z.M.Patel, NIT Surat 1


LCD Display
• You may choose one strategy for displaying character on LCD
(i) Check busy flag i.e. D7 of LCD before sending next data or command
OR
(ii) Wait for some time (about 250ms) before sending next data or command
• To check busy flag, make R/W=1 and RS=0 and give positive edge to EN
• To write Data into LCD, make EN=1 and then EN=0 (negative edge)
• In 4-bit mode, only four lines D7-D4 are used. Higher order four bits are
transferred before Lower order four bits

Dr. Z.M.Patel, NIT Surat 2


Note: For more information, refer to data sheet of HD44780 (LCD controller)

Dr. Z.M.Patel, NIT Surat 3


• Example – Display message on LCD with Busy Flag checking

Dr. Z.M.Patel, NIT Surat 4


Dr. Z.M.Patel, NIT Surat 5
Matrix Keypad Interface

• Mechanical key bounces when pressed and when released


• Bouncing signals can be avoided with hardware (using FF) or with software
• Software should detect, debounce and encode the pressed key

Dr. Z.M.Patel, NIT Surat 6


Algorithm – Matrix Keyboard

• Two key lock-out : When


multiple keys are pressed
simultaneously only one is
recognized
• N-key Roll over : when N keys
are pressed simultaneously, all
are recorded

Dr. Z.M.Patel, NIT Surat 7


Stepper Motor
Basics:
• Stepper motor rotates in discrete steps
• Driven by voltage pulses generated from microcontroller/computer
• Types of stepper motors (i) Permanent Magnet (ii) Variable Reluctance

• Stator pitch θs
360 0
S 
No. of stator poles
• Rotor pitch θR

360 0
R 
No. of rotor poles

• Full Step angle θFS


θFS = | θs -θR |

• Half step angle θHS =θFS /2

Dr. Z.M.Patel, NIT Surat 8


Stepper Motor

Unipolar
• Ceter-Tap winding is used. Current in winding is not reversed (less complex drive circuitry)
• Less torque since only half winding is energized
Bipolar
• Current in winding needs to be reversed (complex drive circuitry e.g. H Bridge)
• Since entire winding is energized, it produces higher torque than Unipolar

Dr. Z.M.Patel, NIT Surat 9


Stepper Motor - Unipolar

Full stepping (in Unipolar):


• In full stepping, number of energized phases remains constant at each step
• In above figure, Two phases remain ON at each step
• Total number of steps is half of the half stepping method
• Four MOSFET switches can be used to turn ON and OFF the phases

Dr. Z.M.Patel, NIT Surat 10


Stepper Motor - Unipolar

Half Stepping (in Unipolar):


• Drive alternates between one phase on and two phase on
• Number of steps are doubled (higher angular resolution) as compared to full stepping
• Suffers from variation in torque

Dr. Z.M.Patel, NIT Surat 11

Вам также может понравиться