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.

output gate drive code for quasi sine inverter with 16F72

Status
Not open for further replies.

spiba

Junior Member level 2
Joined
Feb 1, 2010
Messages
23
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Location
india
Activity points
1,477
i want to write a code for outputing two gate drive pulses for a quasi sine inverter using PIC 16F72.
i am confused how to start to get 50 HZ drive pulses with pwm . do i have to use timer or pwm module or both ?for getting the two outputs . I am very familiar with the hardware part as earlier i have been using SG3524 IC for PWM .Now i want to omit the IC and proceed directly with PIC 16F72. Also can i use any two of the port B or c pins for outputing the 2 gate drives ?
 

i want to write a code for outputing two gate drive pulses for a quasi sine inverter using PIC 16F72.
i am confused how to start to get 50 HZ drive pulses with pwm . do i have to use timer or pwm module or both ?for getting the two outputs . I am very familiar with the hardware part as earlier i have been using SG3524 IC for PWM .Now i want to omit the IC and proceed directly with PIC 16F72. Also can i use any two of the port B or c pins for outputing the 2 gate drives ?
You can use Rc7 and Rc8 ie.pin 17 and 18 as outputs to drive the gates of the switches because i have already done the quasi sine wave but i don't know the code etc.You may get the more information if required.Regards
 

Dear spiba, this is not the practical way of writing a code for 50hz inverter, it involves much more critical math calculation and different technique to perform the job properly. As you ask how to start, this is an example to get 50hz squire wave with 50% duty cycle. On the second question, no you do not have to used pwm/ccp but most people will use it because you’ll lot more extra benefit to using it. The example I wrote for you where I’ve used timer to count on and off time.
Best regards,
M Rahman.


#include <16F72.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)

void main() {


while (TRUE) {
output_high(PIN_B1);
output low(PIN_B2);
delay_ms(10); // Compiler’s built in function;
output_low(PIN_B1);
output high(PIN_B2);
delay_ms(10);
}
}
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top