Hi All!
Hope I can get a litlle help.
I'm trying to make a DC12V to 230V inverter by a transformer switching two separate windings on the secondary side. Driven by 2 mosfet. By this way I get 230V out of the Primary side. I've done a flip flop in a Pic 12f675 very simple program, but how do I get the outputs to switch to 50hz without using the delay between the outputs as they have to switch on off like a flip flop with duty cycle 50%.
Thank´s in advance
jgu1
Flip flop 50HZ
Moderator: Benj
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Flip flop 50HZ
Hi jgu1,
This might be what your after?
I have used timer0 interrupt to flip bits 0 and 1 at 50Hz. There should be no delay with 1 bit on and the other bit off
Martin
This might be what your after?
I have used timer0 interrupt to flip bits 0 and 1 at 50Hz. There should be no delay with 1 bit on and the other bit off
Martin
- Attachments
-
- DC_AC1.fcf
- (14 KiB) Downloaded 316 times
Martin
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Flip flop 50HZ
Hi Martin!
I am very greatfull, thank´s I will test it later today, and you get a reply.
Best regard.
jgu1
I am very greatfull, thank´s I will test it later today, and you get a reply.
Best regard.
jgu1
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: Flip flop 50HZ
Your welcome jgu1.
I have got a 16F883 in my EB006 programmer, so only selecting a different target device, I sent to chip and here is a screen shot with target device running with internal osc at 4MHz: When posted flowchart had not tested on hardware, so was a bit of guess work.
As you can see, frequency is spot on without making any tweaks, but that will depend on your internal osc precision.
You can also see that there is no delay between one pin on, and the other pin going off.
So across both pins you should get a good square wave 10V pk to pk
If you were wondering where I got the value of from, It was from this excel sheet:
http://www.matrixmultimedia.com/mmforum ... 571#p15894
Alternatively if not got excel then you could use this:
http://eng-serve.com/pic/pic_timer.html
Martin
I have got a 16F883 in my EB006 programmer, so only selecting a different target device, I sent to chip and here is a screen shot with target device running with internal osc at 4MHz: When posted flowchart had not tested on hardware, so was a bit of guess work.
As you can see, frequency is spot on without making any tweaks, but that will depend on your internal osc precision.
You can also see that there is no delay between one pin on, and the other pin going off.
So across both pins you should get a good square wave 10V pk to pk
If you were wondering where I got the value of
Code: Select all
tmr0=178;
http://www.matrixmultimedia.com/mmforum ... 571#p15894
Alternatively if not got excel then you could use this:
http://eng-serve.com/pic/pic_timer.html
Martin
Martin
-
- Posts: 1333
- Joined: Tue Oct 06, 2009 9:39 am
- Has thanked: 1135 times
- Been thanked: 299 times
- Contact:
Re: Flip flop 50HZ
Hi Martin!
As promised, hereby a reply, of course your program work, very nice
And of course using interrupt is the best way to do it. Once again thank´s.
Best regard
jgu1
As promised, hereby a reply, of course your program work, very nice
And of course using interrupt is the best way to do it. Once again thank´s.
Best regard
jgu1
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact: