Continue to Site

Welcome to

Welcome to our site! 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.

URGENT: 12V DC motor speed control using PIC16f877a

Not open for further replies.


Newbie level 2
Jun 9, 2011
Reaction score
Trophy points
Activity points

I'm doing my final project for my diploma. My project title is DC motor speed control using PIC16f877a. Currently, I faced some problem in how to interface the PC-PIC-Tx/Rx.....Tx/Rx-PIC-L293D-Motor. And how to do the feedback result of optical encoder to PIC.

Basically, my project consists of 2 PIC, 433MHz RF Module with PT2262 & PT2272-L4 (Cytron), Max232, RS232 cable, 12V DC motor, Optical encoder.

I'm using assembly lang and Visual Basic.

Thank you...

You need to work them out part by part. Try do loop back from PIC to PC then controlling motor with L293D, then acquire data from opto isolator to PIC, then RF modules. Then, only combine all together. I would recommend you to use C. It will be easier compared to asm

Hi, do you have any reference or example? Because i'm not familiar with C language. By the way, I'm using MPLAB and PIC kit2 Programmer.
Thanks for your help....^^
Last edited:

You can try this: Microchip PIC micros and C - source and sample code

there are 3 types of c compiler that you can choose from mikroC, C18 and hi tech c

---------- Post added at 14:41 ---------- Previous post was at 14:38 ----------

For L293D :**broken link removed**

---------- Post added at 14:42 ---------- Previous post was at 14:41 ----------

and Google of course
While C is certainly appropriate, you mentioned in your first post that you were using Assembly. That is what I use with the 8-bit chips. Microchip has many application notes using Assembly code for motor control. I assumed your motor was brushed rather than brushless. Here is a **broken link removed** to the Microchip site with several additional links to help you.

As for the wireless control that you mention, I suggest you visit this group (). Bigdogguru has put a lot of effort into assembling resources on that subject. The ones on Manchester coding may be most applicable for your project, but that is based only on a guess as to what RF links you plan to use.

Not open for further replies.

Part and Inventory Search

Welcome to