aredhel_vlsi
Member level 4
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 :
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
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: