MicroController Pros Home Page
My Account  Cart Contents  Checkout  
  Store » PCAM+ 8051 Tutorial 7 My Account  |  Cart Contents  |  Checkout   
Quick Find
 
Enter keywords to find the product you are looking for in the Quick Find field above

or use
Advanced Search
Categories
Accessory Boards->
8051->
ADI Blackfin
Arduino->
ARM->
Atmel AVR->
Cypress PSoC
Freescale->
FTDI->
Fujitsu
Locktronics
Maxim
Microchip PIC->
MIPS
National Semiconductor
Parallax->
Renesas->
Silicon Labs
ST Microelectronics->
Texas Instruments->
Tibbo->
Zilog
Books->
Displays->
E-Blocks
EEPROM/EPROM/FLASH
Embedded Ethernet->
Embedded Software->
I/O Modules->
Parts & Components->
Pick & Place Tools
Programmable Logic (PLD)
Prototype PCBs->
Robotics
ROM/Flash Emulators
Test & Measurement->
Tutorial CD-ROMs
Universal Programmers->
Wireless->
Information
Intro to Embedded Tools
Embedded News Digest
Useful Resources
Shipping & Returns
Warranty & Liability
Privacy Notice
Conditions of Use
Contact Us
PCAM+ 8051 Tutorial 7: L293D-Based DC Motor Driver

Back to PCAM+ page.


Back to Chapter 6

L293D DC Motor Driver Interface with 89S52

The L293D is mounted on the PCAM+ board and is ready to use with very few interface connections.

You can follow these steps to play with a DC Motor using your own microcontroller code. Note that while the motor driver IC is mounted on PCAM+, a DC Motor is not included with the kit. You will have to supply your own.

Start by making these connections:

  • Connect P2.0 to E1 pin of L293D section (Section 8) on PCAM+ Kit.
  • Connect P2.1 to I1 pin of L293D section on PCAM+ Kit.
  • Connect P2.2 to I2 pin of L293D section on PCAM+ Kit.
  • Connect VS pin from L293D section of PCAM+ Kit to a suitable voltage line e.g. 5V or 9V. For example, you can connect VS to the +5V pin located near the 7805 voltage regulator IC. See the mark of +5V near the two-pin male header on the extreme right-bottom corner of the PCAM+ board.
  • Connect GND pin from L293D section of the PCAM+ Kit to GND of the external supply (to which VS is connected above). If using the on-board 5V supply as suggested above, this can be skipped as there is no need for a common Ground connection.
  • Connect your hobby DC Motor pins to pins O1 & O2 of the L293D section on PCAM+.

Write the following code using 8051IDE, assemble it and download it to 89S52 on PCAM+ kit using HandyProgUSB programmer.

Main:
        SETB    P2.0               ; ENABLE L293D DRIVER

        ROTATE_LOOP:
        CLR     P2.1
        SETB    P2.2                ;01 COMBINATION WILL ROTATE MOTOR IN ONE DIRECTION
        LCALL   DELAY           ;LET THE MOTOR ROTATE IN ONE DIRECTION
        SETB    P2.1
        CLR     P2.2                ;10 COMBINATION WILL ROTATE MOTOR IN OTHER DIRECTION
        LCALL   DELAY         ;LET THE MOTOR ROTATE IN OTHER DIRECTION
        SJMP ROTATE_LOOP

DELAY:
        MOV R5,#200D
        LOOP1:
                MOV R6,#45D
        LOOP2:
                MOV R7,#100D
        DELAY_LOOP:
                DJNZ R7,$
                DJNZ R6,LOOP2
                DJNZ R5,LOOP1
RET

Proceed to Chapter 8


Back to PCAM+ page.

Shopping Cart more
0 items
What's New? more
LPC1850 Development Board, USB-H, 2x CAN, RS485, Audio, Ethernet
LPC1850 Development Board, USB-H, 2x CAN, RS485, Audio, Ethernet
US$145.00
Bestsellers
01. 2x10 Pin male header, 2.54mm, 7.5mm plastic spacer
02. 2x5 (10-pin) 0.1" pitch IDC Connector Flat Ribbon Cable, 15cm
03. 2x5 (10-pin) 0.05" pitch IDC Connector Flat Ribbon Cable, 20cm
04. 2x10 (20-pin) 0.1" pitch IDC Connector Flat Ribbon Cable, 15cm
05. PIC16F877A-I/P Microcontroller, 40 DIP, 20 MHz
06. USB-to-Serial Cable: 5V TTL, Audio Plug Connector, Reverse RX/TX
07. LCD 4-mux, 7.1 digits x 7 segments, progress bar, arrows
08. Power Supply 3-12V DC, U.S. plug, 6 connection tips
09. 2x3 (6-pin) 0.1" pitch IDC Connector Flat Ribbon Cable, 15cm
10. PIC16F628A-I/P Microcontroller, 18 DIP, 20 MHz
Specials more
STK300 ATmega128L-8AI Board, 3V
STK300 ATmega128L-8AI Board, 3V
US$25.00
US$19.00
Reviews more
32-pin QFP to DIP Adapter & Breakout Module
correct link is http://www.embe-
ddedmarket.com/-
storeresources ..

4 of 5 Stars!
  Thursday 17 April, 2014   List of all our Products

Copyright © 2003-2014 MicroController Pros LLC
Powered by osCommerce