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.

PIC 16f877a Interface with l293D Probem

Status
Not open for further replies.

ankit35

Newbie level 4
Joined
Mar 6, 2013
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,320
Interfacing-DC-Motor-with-PIC-Microcontroller.png
I am using this Circuit to interface between Mc and motor driver Ic. But In proteus it doesnot work. can u please tell where is the problem? my Mc code :
Code:
char uart_rd;
void main() {
     TRISB = 0;
     PORTB=1;

     UART1_Init(9600);
     DELAY_MS(100);

     while(1)
     {
             if(UART1_Data_Ready())
             {
              uart_rd=UART1_Read();

              if(uart_rd=='w')
              {
               PORTB.F0=1;
              }

              if(uart_rd=='s')
              {
              PORTB.F1=1;
              }

              if(uart_rd=='x')
              {
              PORTB=0;
              }
             }

     }



}
I am Using Micro C pro
 

By F0 and F1, i believe u mean RB0 and RB1. So, remember when u make RB0=1, make sure u do RB1=0, to run the motor and vice versa to reverse the direction. If both RB0 and RB1 are either 0 or 1, the motor won't start. If u r just looking to run the motor as in normal operation without any control, u can even use PIC10F series, it will be cost effective and will be cheap.

But, if u want to control the motor parameters like speed, direction etc., u need to generate PWM for that. U can always go for traditional PWM in CCP module or can generate complementary PWM using ECCP in some PIC's like PIC16F1507 etc.
If u want absolute motor control for almost all kinds of motor, there is pretty low cost 8-bit PIC for that with impressive PWM capabilities i.e. PIC16F1782/3. The microcontroller has peripheral called PSMC which can generate any kind of PWM for every kind of PWM control application starting from motor control to power control and etc etc. Just one IC can serve u every kind of motor control, after generating PWM as u needed, u can send it to MOSFET switch drivers.

hope that helps.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top