Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

DC Motor Drive L293D

Status
Not open for further replies.
here is my schematic... and program... and can i use it in the RF... now i have made this to work with HT12D and HT12E...

my task is 16 buttons and for each button the value assigned is 0001 to 1111... and ht12E will encode this... but i could not make it work....


I can't open DSN files but the software looks OK although it could be much shorter! Look-up tables for the key number and 7-segment patterns would be faster and more code efficient than lots of switch/case statements.

As I can't see the schematic, can you confirm you are using a common cathode display with the cathode pin grounded and a series resistor in each anode connection please.

Brian.

- - - Updated - - -

these files are my part of the project...
 

Attachments

  • rf pic.rar
    195.8 KB · Views: 85
Last edited:

I used L293D to run Stepper motor and i did it with Bipolar Stepper Motor successfully... Then i came to know that is Dual H-Bridge Ic that can run DC motor in both directions... then i connected as like the diagram... logic input of 5V and motor supply of 12V with 7805 and 7812 regualtor respectively from 12V 5Ah battery... but the problem is the IC heating very hot within secods...





L293D input pin IN1=HIGH and IN2=HIGH is invalid condition [short circuit].
 
The schematic isn't correct so your simulation won't work.

Resistors R6, R7, R8 and R9 are joined together at one end and go nowhere else. Also R2, R3, R4 and R5 are joined and go nowhere else.

You do not need pull-up or pull-down resistors on the DRIVING side of the key matrix because the PIC pulls them one way or the other anyway. On the READING side of the matrix you should have pull-down resistors so the lines do not float when the switches are open. It's a good idea to put low value (220 Ohms will do) resistors in series with the PIC pins DRIVING the matrix so that if more than one key is held down at the same time there is no risk of two or more PIC pins being direcly shorted together.

Brian.
 
I solved that problem... pls help me with the latest problem... thnx for you reply...

L293D input pin IN1=HIGH and IN2=HIGH is invalid condition [short circuit].

- - - Updated - - -

i removed the switches and used the keypad then also not working..... ??????

i dnt know wheres the problem....

pls help me....'

The schematic isn't correct so your simulation won't work.

Resistors R6, R7, R8 and R9 are joined together at one end and go nowhere else. Also R2, R3, R4 and R5 are joined and go nowhere else.

You do not need pull-up or pull-down resistors on the DRIVING side of the key matrix because the PIC pulls them one way or the other anyway. On the READING side of the matrix you should have pull-down resistors so the lines do not float when the switches are open. It's a good idea to put low value (220 Ohms will do) resistors in series with the PIC pins DRIVING the matrix so that if more than one key is held down at the same time there is no risk of two or more PIC pins being direcly shorted together.

Brian.
 

Ok, if you have an oscilloscope, try connecting it between ground and the PIC pins driving the keypad to see if it is being scanned. If you don't have one there is a trick you can use which is 'dirty' but works: Connect a headphone/earphone with a 1K resistor in series with it (don't use a lower value) across ground and each of the drive signals. You should hear a tone on each pin which is the pulse going out to the keys. If it's there, move the connection to the signals FROM the keypad back to the PIC and check there is no tone on any of them unless keys are pressed.


Brian.
 

i am trying in proteus only... i didnt made hardware once i got fine in proteus i planned to mov on hatdware....

Ok, if you have an oscilloscope, try connecting it between ground and the PIC pins driving the keypad to see if it is being scanned. If you don't have one there is a trick you can use which is 'dirty' but works: Connect a headphone/earphone with a 1K resistor in series with it (don't use a lower value) across ground and each of the drive signals. You should hear a tone on each pin which is the pulse going out to the keys. If it's there, move the connection to the signals FROM the keypad back to the PIC and check there is no tone on any of them unless keys are pressed.


Brian.
 

I don't use Proteus so I can't advise on it's accuracy.
As it's a simulator, does it allow you to connect a 'virtual' oscilloscope to the circuit? If it does, try connecting it to the keypad lines as I described in post #45 and see if it shows a short pulse on each line.

Brian.
 
Okay i will try confirm me whether my code is fine...????


Code:
#include <htc.h>     

 
__CONFIG(0x3f72);  



 

void ScanCol(void);    //Column Scan Function
void ScanRow(void);    //Row Scan Function
void DelayMs(unsigned int);
void setout();
 
unsigned char KeyArray[4][4]= {   '1','2','3','4',     
                                   '5','6','7','8',
                                   '9','A','B','C',
                                   'D','E','F','0'};
int Col=0,Row=0,i,j;



void main()
{
  TRISD=0xFF;
  PORTD=0x00;
   DelayMs(50);

   nRBPU=0;    //Enable PORTB Pullup values
 
 
 
   while(1)
   {  
      TRISB=0x0f; // Enable the 4 LSB as I/P & 4 MSB as O/P
      PORTB=0x00;
      while(PORTB==0x0f);   // Get the ROW value
      ScanRow();
 
     TRISB=0xf0; // Enable the 4 LSB as O/P & 4 MSB as I/P
      PORTB=0x00;
      while(PORTB==0xf0);   // Get the Column value
      ScanCol();
 
      DelayMs(150);
   
      setout();
      DelayMs(200);
   }
}
 
void setout()
{
 switch(KeyArray[Row][Col])
 {
  case '1':
			PORTD=0x01;
            break;
  case '2':
			PORTD=0x02;
			break;
  case '3':
			PORTD=0x03;
			break;
  case '4':
                        PORTD=0x04;
			break;
  case '5':
			PORTD=0x05;
			break;
  case '6':
			PORTD=0x06;
			break;
  case '7':
			PORTD=0x07;
			break;
  case '8':
			PORTD=0x08;
			break;
  case '9':
			PORTD=0x09;
			break;
  case 'A':
			PORTD=0x0A;
			break;
  case 'B':
			PORTD=0x0B;
			break;
  case 'C':
			PORTD=0x0C;
			break;
  case 'D':
			PORTD=0x0D;
			break;
  case 'E':
			PORTD=0x0E;
			break;
  case 'F':
			PORTD=0x0F;
			break;
  case '0':
			PORTD=0xFF;
			break;
  default:
			PORTD=0xFF;
			break;
 }
 return;
}
void ScanRow()       // Row Scan Function
{  
   switch(PORTB)
   {
      case 0x07:
         Row=3;      // 4th Row
      break;
      case 0x0b:
         Row=2;      // 3rd Row
      break;
      case 0x0d:
         Row=1;      // 2nd Row
      break;
      case 0x0e:
         Row=0;      // 1st Row
      break;
   
}
return;
}
 
 
 
void ScanCol()    // Column Scan Function
{  
     TRISB=0xf0; // Enable the 4 LSB as O/P & 4 MSB as I/P
     switch(PORTB)
   {
      case 0x70:
         Col=3;   // 4th Column
      break;
      case 0xb0:
         Col=2;   // 3rd Column
      break;
      case 0xd0:
         Col=1;   // 2nd Column
      break;
      case 0xe0:
         Col=0;   // 1st Column
      break;
   }
return;
}
 
void DelayMs(unsigned int Ms)
{
   int delay_cnst;
   while(Ms>0)
   {
      Ms--;
      for(delay_cnst = 0;delay_cnst <220;delay_cnst++);
   }
}

I don't use Proteus so I can't advise on it's accuracy.
As it's a simulator, does it allow you to connect a 'virtual' oscilloscope to the circuit? If it does, try connecting it to the keypad lines as I described in post #45 and see if it shows a short pulse on each line.

Brian.
 

i made it.. now it is working fine... i changed the TRISD=0xoo;
now i need to configure USART... please help me that too.... I need to send the 4 bit via RF module please help me...
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top