Flip flop 50HZ

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Flip flop 50HZ

Post by jgu1 »

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
Attachments
DC_AC.fcf
(7.5 KiB) Downloaded 288 times

medelec35
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

Post by medelec35 »

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
Attachments
DC_AC1.fcf
(14 KiB) Downloaded 313 times
Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Flip flop 50HZ

Post by jgu1 »

Hi Martin!

I am very greatfull, thank´s :D I will test it later today, and you get a reply.

Best regard.

jgu1

medelec35
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

Post by medelec35 »

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:
Screen_S Scope 50Hz 1.jpg
Screen_S Scope 50Hz 1.jpg (71.96 KiB) Viewed 5049 times
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;
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
Martin

jgu1
Posts: 1333
Joined: Tue Oct 06, 2009 9:39 am
Has thanked: 1135 times
Been thanked: 299 times
Contact:

Re: Flip flop 50HZ

Post by jgu1 »

Hi Martin!

As promised, hereby a reply, of course your program work, very nice :D :D

And of course using interrupt is the best way to do it. Once again thank´s.

Best regard

jgu1

medelec35
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

Post by medelec35 »

Hi jgu1,
Glad Flowchart works for you.

Thanks for the update :)

Martin
Martin

Post Reply