Overunity.com Archives is Temporarily on Read Mode Only!



Free Energy will change the World - Free Energy will stop Climate Change - Free Energy will give us hope
and we will not surrender until free energy will be enabled all over the world, to power planes, cars, ships and trains.
Free energy will help the poor to become independent of needing expensive fuels.
So all in all Free energy will bring far more peace to the world than any other invention has already brought to the world.
Those beautiful words were written by Stefan Hartmann/Owner/Admin at overunity.com
Unfortunately now, Stefan Hartmann is very ill and He needs our help
Stefan wanted that I have all these massive data to get it back online
even being as ill as Stefan is, he transferred all databases and folders
that without his help, this Forum Archives would have never been published here
so, please, as the Webmaster and Creator of these Archives, I am asking that you help him
by making a donation on the Paypal Button above.
You can visit us or register at my main site at:
Overunity Machines Forum



BroMikey's Capacitor Dump Circuit

Started by SeaMonkey, March 12, 2014, 12:38:02 AM

Previous topic - Next topic

0 Members and 2 Guests are viewing this topic.

Farmhand

SeaMonkey, I quoted your posting over to EF and rambled on a bit myself to try to help a bit.

..

Oh I worked out there is a function to copy the code to a forum,  :-[ I had trouble trying to post code before.

Anyway just to show how dodgy my code writing ability is here is the code I developed to run the solar setup I posted above.

There is likely a lot of stuff that is redundant and others may not be able to understand it together with the drawing because there are no labels ect. in the code. To understand the code people would need to know the pinout and stuff for the 08M2 picaxe. Or look it up.  :D

..


main:
pause 1
readadc C.1,b1
if b1 => 152 then goto char
if b1 > 20 then goto boost
if b1 < 20 then goto humm
wait 1
goto main

humm:
do
low 2
pause 100
readadc C.1,b1
if b1 > 125 then low 2 goto boost endif
readadc C.4,b4
if b4 > 173 then pulsout 0,5 endif
if b4 > 173 then pulsout 0,5 endif
pause 100
loop

boost:
do
readadc C.1,b1
if b1 < 95 then low 2 pwmout 2, off goto humm endif
if b1 => 139 then low 2 pwmout 2, off goto char endif
if b1 < 130 then pwmout 2, 49, 50 endif
if b1 => 130 then pwmout 2, 49, 60 endif
readadc C.4,b4
if b4 => 149 then low 2 pulsout 0,3 pauseus 1 endif
if b4 => 150 then low 2 pulsout 0,3 pauseus 1 endif
if b4 => 151 then low 2 pulsout 0,4 pauseus 1 endif
if b4 => 152 then low 2 pulsout 0,4 pauseus 1 endif
if b4 => 153 then low 2 pulsout 0,4 pauseus 1 endif
if b4 => 154 then low 2 pulsout 0,4 pauseus 1 endif
inc b9
if b9 = 250 and b4 => 162 then low 2 high 0 readadc C.4,b5 low 0 let b9 = 0
elseif b9 = 250 and b4 < 162 then let b9 = 0 goto boost endif
if b5 => 143 then low 2 pwmout 2, off low 0 goto float endif
loop

char:
do
inc b9
readadc C.1,b1
if b1 < 138 then low 0 goto boost endif
if b9 = 252 and b1 => 140 then high 0 pauseus 1 readadc C.4,b5 low 0 let b9 = 0
elseif b9 = 252 and b1 < 140 then let b9 = 0 endif
if b5 => 140 then low 2 low 0 goto float endif
if b1 => 144 then high 0 pauseus 160 low 0 pauseus 100 goto char endif
if b1 => 143 then high 0 pauseus 140 low 0 pauseus 120 goto char endif
if b1 => 142 then high 0 pauseus 100 low 0 pauseus 180 goto char endif
if b1 => 141 then high 0 pauseus 60 low 0 pauseus 220 goto char endif
if b1 => 140 then high 0 pauseus 15 low 0 pauseus 285 goto char endif
if b1 => 139 then high 0 pauseus 4 low 0 pauseus 298 endif
loop

float:
do
pause 50
high 0 pauseus 1 readadc C.4,b5 low 0
pause 50
if b1 > 148 and b5 < 142 then pulsout 0,3 pauseus 2 endif
if b1 > 148 and b5 < 142 then pulsout 0,3 pauseus 2 endif
if b1 > 148 and b5 < 142 then pulsout 0,3 pauseus 2 endif
if b1 > 148 and b5 < 142 then pulsout 0,3 pauseus 2 endif
readadc C.1,b1
if b1 < 115 then goto humm
if b5 < 138 then goto char
loop


..

SeaMonkey

Writing "Code" for a microprocessor or a
microcontroller is indeed a learned skill
and it can be daunting in the beginning.

If the Code fits into the available system
memory and does what it is intended to
to then it is Good Code.

If the initial effort is tightened up a bit
by modifying the algorithm and using
instructions which are more economical
of code space then it becomes Elegant
Code.

In the old days it was often necessary to
reduce the Code in a program to the
barest minimum because of ROM and RAM
limitations so some programmers got really
good at finding the most economical way to
accomplish almost any task.  They were
the ones who got the Big Bux.

Your Code is an excellent example of how
a fairly complex job is done;  the thought
processes which enter into the solution and
the sequence of events necessary to make
things happen when they should.

Any Code that does what it is supposed to do
is Good Code...

MileHigh

I can do 8086 and 6502 assembler!  lol

I _hate_ the 80X86 instruction set.  The 680X0 lost out, it's a shame.

So Farmhand, is it you that wrote the nasty script that's crashing on OU recently?  lol

Farmhand

 ??? Hilarious, it would take me years to even entertain the thought of being able to do such things. If anything I am a victim there as well. I must check for any developments over there. Might be something interesting.

To write the code above I had to refer to the picaxe pdf every time I needed to do something different and look for a way to do it. I just made the circuit with a pretty good idea of what the chip could do and then worked out the code later. Took a while, no interrupts used, still haven't worked that out yet. I've got Arduino now too but haven't even used it yet.

The 08M2 chip is good for beginners, it's small, cheap and can do basic stuff with simple code.
..

SeaMonkey

Quote from: MilesHigher
The 680X0 lost out, it's a shame.

Aye, it did and I thought so too.

The Commodore Amiga and the Atari ST series
did mighty fine with it and were quite advanced
for their time.  Ah, those were the days!

Quote from: FarmHand
I quoted your posting over to EF and rambled on a bit myself to try to help a bit.

Your "ramblings" added a great deal to the discussion.
You did well.