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.

[Moved] Understanding the PIC and H-Bridge

Status
Not open for further replies.

aredhel_vlsi

Member level 4
Joined
Aug 21, 2009
Messages
72
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
2,013
Hello guys, I am also a beginner in PIC, and I've made some things work, but I have questions.

There's something I haven't understood regarding the H bridge . I use a full bridge which I made with 4 npn transistors. Well, the two diagonal transistors are triggered with the same input signals (PWM0 ie) coming from the PIC. The other two diagonal transistors are not triggered. Thus, I made the motor turning with a half bridge. Ok until here.

Now I want to make my motor turn and reverse too, so I have to use the second input (PWM1 ) that triggers the two left transistors.
I've thought of a solution but I'm not very sure about it, and my motor doesn't work at all.

My code is something like this :

Code:
if (vel_reference < vel_feedback) {
// Define quadrant of H-bridge operation
RD4 = 0; // FLTA complementary =0 , FLTA=1 (FLTA is active low)
OVDCOND = 0b11111110; // Output overide control register
OVDCONS = 0b00000001; // Output State register
RD0 = 1; (T5CKI=1 )
do something 
}

else if (vel_ref > vel_fb) {
// Define quadrant of H-bridge operation
RD0 = 0; 
OVDCOND = 0b11111101; // Output overide control register
OVDCONS = 0b00000010; // Output State register
RD4 = 1; // FLTA = 0 , PWM output is deactivated
do something else
}

Actually , this way , I think the motor turns reverse or forward, but it seems it can't work. I ve misunderstood something for sure. Could somebody explain to me how we can implement this, or how the FLTA and T5CKI works? It's related to Timer 5 but I can't understand how.

Thank you very much in advance
 
Last edited by a moderator:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top