PIC16F877a/PIC16F887/PIC18/16F**** L293D/L298N motor driver IC interface using MikroC

preview_player
Показать описание
Hello guys,
Welcome to Learning Microcontrollers youtube Channel,

Guys I have also compiled course on Udemy as well. Where you will learn under my direct supervision in a more supervised way.
Here is the links to the courses I have on Udemy, By taking any of these courses you will be supporting my channel aswell.
This will help me to make more videos with better hardware in the future. I hope you look forward to it.
Courses Links:

I hope you all guys are great. This is my new video on PIC microcontroller series. In this video I will teach you how to interface an L293D IC using MikroC for PIC.
Here is the code:
void main() {
TRISB = 0x00; // It makes PortB a digital Port as output means it can only send either 0 or 1 from each pin

PORTB = 0x00; // Intital state must be stop of motor. So we keep H-brdige at 0 value mean stop.

while(1) // Coding inside while(1) repeats itself while above dont
{
PORTB.B0 = 1;// Sw 1 will send 1 to H bridge
PORTB.B1 = 0;// Sw 2 will send 0 to H bridge
Delay_ms(1600); // Keep the brdige in same state for 1000 ms. means motor will remain on for 1600 ms
PORTB.B0 = 0;// Sw 1 will send 1 to H bridge
PORTB.B1 = 1;// Sw 2 will send 0 to H bridge
Delay_ms(1600); // Keep the brdige in same state for 1000 ms. means motor will remain on for 1600 ms
}

}
Рекомендации по теме
Комментарии
Автор

How to turn off the motor? I'm working on a transformer winding machine project, as per the user input of bobbin size, coil size and required number of turns, the motor should turn on and after winding the motor should turn off, total time will be calculated by time per turn * total number of turns. I am not able to turn off the motor, please help me...

anithak
Автор

Is it possible to attach the motor to PORTA or PORTC to make it go different directions

Blitzmeister
Автор

Can you help make any changes or additions to increase and decrease speed of rotation?

haziqdzulfadhly
Автор

Leave a comment if you have any problems

learningmicrocontrollers