EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Replies /  /*Connections: 1. Connect

 /*Connections: 1. Connect

|

Microcontroller › 8051 › Interface 8051 to a 12V dc motor ›  /*Connections: 1. Connect

March 31, 2012 at 6:24 pm #7370
Dinesh Kumawat
Participant

 

/*Connections:
 
1. Connect P2.0 to E1 pin of L293D Section on the kit
2. Connect P2.1 to I1 pin of L293D Section on the kit
3. Connect P2.2 to I2 pin of L293D Section on the kit
4. Connect VS pin of L293D section to Vcc Pin. The Vcc pin is the 1st pin on the 6 pin header (marked as ISP) just above the 89V51RD2 IC. This provides 5V to the DC Motor. In case your DC motor requires higher voltage (max 12V) then connect external DC power source to VS & GND pins of L293D section.*/
 
 
 
 
#include <REG52.H>                /* special function register declarations   */
                                  /* for the intended 8051 derivative         */
 
#include <stdio.h>                /* prototype declarations for I/O functions */
 
 
//L293D Pin Defines 
 
sbit E1 = P2^0;
sbit I1 = P2^1;
sbit I2 = P2^2;
 
void MSdelay(unsigned int rtime)
{
unsigned int r,s;
for(r=0;r<rtime;r++)
for(s=0;s<1275;s++);
}
 
 
  
void main (void) {
E1 = 1; //Set E1 pin High to Enable Channel of L293D
 
while(1) //End less while so that program never ends  
{
//Rotate in One Direction
I1 = 0;
I2 = 1;
MSdelay(500);
 
//Rotate in Other Direction
I1 = 1;
I2 = 0;
MSdelay(500);
}
}
 
 
 

RSS Recent Posts

  • parallel-to-serial problem May 23, 2025
  • 12v battery, 18v magic May 23, 2025
  • STM32 checking self-written delay function May 23, 2025
  • Behringer MX 1602 mixer - reading block diagram May 23, 2025
  • Reclaiming missing motherboard header May 23, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise