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] Direction control of dc motor using pic microcontroller and dpdt relay 12v

Status
Not open for further replies.

Yacer

Newbie
Joined
May 11, 2020
Messages
5
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
55
Hello everyone,

Would you please recommend me an appropriate code using "mikroC PRO for PIC" to control this 220V dc motor shown in the schematic below.

What i want to do is to switch in between its two spin directions (either clockwise or counter-clockwise) by pressing and releasing the push button.

I've tried mine using while statement, but it doesn't work the way I actually want,
When I press the push button the motor doesn't change the direction.
I should be most grateful if you would give me some help
Thanks in advance
 

Attachments

  • ISIS.JPG
    ISIS.JPG
    59.2 KB · Views: 104
  • mikroC prog.JPG
    mikroC prog.JPG
    126.2 KB · Views: 105

Hi,

please, when posting code, then insert it as text and use CODE tags.
Currently it takes about 100 times the memory space, and we can´t copy and paste your code lines.

****
I´m not familiar with PIC.
But afaik PORTx is used as output. But you use it as input in your WHILE... line.

Klaus
 

Your code don't have any infinite loop to keep the execution line within, I wuld expect to see it running just once. Another issue is that thare is no if...else statement anywhere, one would expect to see it evaluating the button state.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top