For sale.Cold fusion reactor.Home made.Not working.$2000 ONO

120ThingsIn20Years

Senior Member
No, but if the led is connected to C.0 it will flash when Debug is in the program as there is data going out the serial out pin which is C.0, are you 100% sure there is no small solder bridges between C.0 and C.1 tracks anywhere, as this is the first time you have used debug and pin C.0 to see if there is a problem with the circuit and a short between the tracks somewhere.
I replaced the chip with one of the ones you gave me, and the LED on C.1 stopped flashing, but perhaps it was just a loose connection or a shi(pp)y solder joint that I repaired accidentally.

Either way it works now, but tomorrow I'll be going to that parts store to get some leads that have nice pins attached to them for breadboard work. It's difficult stuffing a frayed wire into a breadboard. And it turns out you can waste a day or more to a lose connection

thanks again for all the diagrams and help

What the hell did people do before the net.

Mmm I guess they went to uni or got an apostleship :)
 

John West

Senior Member
Saying, "use pwm" is not always the same thing as saying, "use the pwm command." PWM simply means Pulse Width Modulation, a specific sort of modulation. The PICAXE chips have a few different commands that generate pulse width modulated outputs, from versions to control motors or light dimming to ones used to generate sound. It's best to read up on what each one does in order to decide which to use in your code.
 
Last edited:

120ThingsIn20Years

Senior Member
I got my motor controlled via the 12 volt circuit.

I think A lot of my problems are coming from unreliable contacts on the breadboard.

I'll buy some of the wires with pins attached.


My little motor has a 30:1 reduction gearbox, and as a result behaves a bit like a servo, but with the added advantage that once power is off, it remains rock solid in place. Its almost impossible to turn from the shaft. It's obvious that that's the case, but it wasn't to me :)

I think I'll use that fact at some stage.
 

120ThingsIn20Years

Senior Member
Those breadboard wires are totally worthwhile.

Everything either works first time, or I can see where everthing is to the point where I can track down any mistakes I've made.

I'm currently working on trying to understand inputs, and what the chip thinks of them.

If inputs are 0 volts is 0 and 5 volts is 255, does that mean outputs can be the same? Or are outputs always at 5 volts and controlled only by duty cycle?
 

120ThingsIn20Years

Senior Member
I bought several sets of the Dick Smith breadboard wire kits before they stopped doing things but even they get a bit of a pain after a while.

The ones below are even better although not as neat on the actual breadboard.

http://www.ebay.com.au/itm/Solderless-Breadboard-Jumper-Cable-Wires-Kit-Qty75-/300553677041?pt=AU_B_I_Electrical_Test_Equipment&hash=item45fa6528f1#ht_1226wt_905
They were the ones I was actually looking for, but I suspect that for me, at least for the time being, the ones that sit flat against the breadboard and actually look a bit like the circuit diagram make it a little easier to follow.

I think I'll get some of those though. I'm sure this stuff gets easier to follow eventually.

Much of this stuff I'm learning is turned on its head a bit. Even things that everybody else finds intuitive like (and I may well have this wrong) being able to place a resistor after the thing it needs to control flow to, freak me out a little.

Even placing a component like a motor simply in series seems counter intuitive. As a kid a motor was connected one end to a battery, the other end to a battery ( realise that is simply in series). In the circuit where I'm controlling a 12 volt motor with a chip, the circuit looks a lot like I've got both motor wires connected to the same point. It works and is all correct, but I'm struggling to look at in and just "read" the circuit. I have to work out why it works every time I look at it.

That all makes it very difficult when I'm trying to learn something new like adding input from a pot, because I can never be sure if I have interpreted the diagram correctly even though it only has one component and a + and -.

Does it matter which is + and which -, should the thing get hot enough to burn me, should I be using it as a pot or a rheostat, how do I know if I'm "resisting" enough to get a reading, why am I not getting a reading, why does debug show 255 then my reading, and flash between the two, etc etc etc etc etc

It's the first time, in as long as I can remember, that I'm learning something that seems to require a paradigm shift in the way I think rather than just learning some stuff and thinking more.
 

Dippy

Moderator
Have you checked the actual REAL value of pot resistance with a multimeter?

Does it read correctly? e.g. 10K (approx) across the main pins.
NEVER assume wiper is the middle pin/leg (it usually is).
Is this some cheapo 1penny pot?

Have you connected it properly?
Or do you have the wiper connected to power/ground?

I hope you bought more than one because serious abuse will shag it.
 

120ThingsIn20Years

Senior Member
Have you checked the actual REAL value of pot resistance with a multimeter?

Does it read correctly? e.g. 10K (approx) across the main pins.
NEVER assume wiper is the middle pin/leg (it usually is).
Is this some cheapo 1penny pot?

Have you connected it properly?
Or do you have the wiper connected to power/ground?

I hope you bought more than one because serious abuse will shag it.
Hmmm... I thought I had checked it properly, but I now see a reading of 10k to .01k between the two outside pins, and the centre and right pins, but the centre and left pins show a temporary resistance of up to 1k that disappears after I stop turning it.

This is what I was seeing in debug. A temporary value that would vanish by the next cycle.

So I guess that means it's either fried, or the left pin is the wiper.

I have a few, because SABorn gave me some in his startup, charity bag of goodies he gave me.
 

120ThingsIn20Years

Senior Member
I replaced it, and I'm seeing across the pins 1 2 3

1 to 2 = full range (0k to 10k approx)
1 to 3 = 9.8 to 9.9 k
2 to 3 = full range

So this must mean I fried the other one or it never worked.

I also assume that means the wiper is the centre, so Ill try again.

thanks Dippy,

"Does it read correctly? e.g. 10K (approx) across the main pins."

is just what I needed.
 

120ThingsIn20Years

Senior Member
Yay me.

I can adjust the speed of my motor with my pot.

Thanks again everyone.

Code:
Main:

     readadc c.2,b1
     pwm c.1,b1,10
     goto main

end
I think I'll try an "and" situation now. ie the pot only works if the lights are on.

You people are great, and I really cant express just how much I appreciate all your help.
 

eclectic

Moderator
Perhaps modify the pwm to Pwmout using one of these two:

Code:
Main:

readadc C.2,b1
pwmout C.1 , 63, b1
goto main

;OR ***************

pwmout C.1, 63,0

Main:

readadc C.2,b1
pwmduty C.1 ,  b1
goto main
 

120ThingsIn20Years

Senior Member
Perhaps modify the pwm to Pwmout using one of these two:

Code:
Main:

readadc C.2,b1
pwmout C.1 , 63, b1
goto main

;OR ***************

pwmout C.1, 63,0

Main:

readadc C.2,b1
pwmduty C.1 ,  b1
goto main
OK thanks eclectic, I'll give it go.

and this...

I just accidentally invented a wife proof switch.

I added a thermistor and set a threshold to allow the rest of the program to run or not, and Mrs. 120ThingsIn20Years hands are too cold to operate it :)
 

120ThingsIn20Years

Senior Member
Perhaps modify the pwm to Pwmout using one of these two:

Code:
Main:

readadc C.2,b1
pwmout C.1 , 63, b1
goto main

;OR ***************

pwmout C.1, 63,0

Main:

readadc C.2,b1
pwmduty C.1 ,  b1
goto main
pwmout C.1 , 63, b1 spat out "Error: Invalid pwmout pin!"

But c.2 works with c.1 as the readadc pin

What's the advantage of using pwmout over pwm?
 

eclectic

Moderator
pwmout C.1 , 63, b1 spat out "Error: Invalid pwmout pin!"

But c.2 works with c.1 as the readadc pin

What's the advantage of using pwmout over pwm?
1. Which Picaxe are you using?

2. Pwmout is "background".

Set it running, and it stays on .

Pwm needs constant updating (and therefore hogs the program)

e
 

120ThingsIn20Years

Senior Member
So far all I've used is 08M

"Pwm needs constant updating (and therefore hogs the program)"

ahh! thats the period setting. I read it all in the manual but didnt put the two bits of info together in my head.

Thanks yet again
 

eclectic

Moderator
Look at these two programs:

Code:
#picaxe 08M2

main:
pwm C.2,150,100; After this is fished, the next line starts
Stop

THEN ******

Main:
Pwmout C.2, 63, 200
stop
Watch what happens to the motor or LED on pin C.2

e
 

120ThingsIn20Years

Senior Member
I'm running this with a LED on both c.1 and c.2...

Code:
main:
     pwm c.2,255,255          'lights my first LED which stays lit for 2 seconds then goes off
     high c.1                       'lights my second LED
     pause 3000            
     low c.1                         'Kills my second LED

     pause 1000

     pwmout c..2, 63, 200     'lights my first LED which stays on forever (which is cool)
     high c.1                       'lights my second LED
     pause 3000
     low c.1                        'Kills my second LED

     pwmout c.2, OFF           

end
How do I turn it off? The program wont end. I thought pwmout c.2, OFF would do it but it doesn't.
 
Last edited:

120ThingsIn20Years

Senior Member
low c.2 seems to work, but I cant really tell if the program has ended.

Which begs the question...

If you do ...

Code:
Main:

high c.1
low c.1

end
Is the chip actually off, even though power is still going to it? Is the boot code (OS?) doing anything? Is it still using batteries or is it just as off as if I turned off the power?
 

eclectic

Moderator
1. Try

Code:
#picaxe 08M2
Main:
Pwmout C.2, 63, 200 ; Duty at ~75%
pause 3000
pwmout C.2,  OFF
stop
2. Re. post #302
The Picaxe stays ON, and connected,

It will still use a couple of milliamps
(which can be reduced to microamps)

e
 

Dippy

Moderator
120... , re: "END".
What does the Manual (number2 BASIC Commands) say?

Have a read and come back and let us know if it is clear.
 

120ThingsIn20Years

Senior Member
120... , re: "END".
What does the Manual (number2 BASIC Commands) say?

Have a read and come back and let us know if it is clear.

oops :) sorry. All that power stuff is explained nicely. For some reason I thought I understood the end command. Total mastery was assumed :)


from manual 2 page 61 - "The end command switches off internal timers, and so commands such as servo
and pwmout that require these timers will not function after an end command
has been completed"

That bit seems to indicate that my code in post 301 should have switched off the LED on c.2
 

SAborn

Senior Member
According to the manual either a "off" or 0,0 can be sent to switch off the pwm.
To stop pwmout issue a ‘pwmout pin, off’ (=pwmout pin,0,0) command
I have always used " pwmout C.2, 0,0 so try that and see if it works for you.
 

westaust55

Moderator
[
This has me thinking, if energy is lost as heat in a resistor, what happens in a tap? I think the answer is exactly the same - energy is lost as heat as well. The heat ends up in the water. Normally you wouldn't notice the slight temperature rise but I have seen it in a very dramatic form with a pump that got an airlock and so the water went round and round through the small gaps inside the pump and eventually boiled (I burnt my hand on the case).

A tap is very much like a resistor. You can even set up a tap as a variable load on a pump to check the maximum efficiency point (or at least check that the graphs that came with the pump are correct).

Current is water flow and in a circuit you can't remove any water from the circuit so it is not like a leaking pipe. The current must go around and around. (same as electrons don't leak out of a wire).
On a much larger scale (and reverse concept) we use hollow copper tubes (about 50mm OD and 10mm wall thickness with say 8 per phase) as electrical connections and then pump deionised water through them to keep them cool.

Otherwise when pumping 50 kA through the circuit they will vaporise just like that under rated resistor!
 

eclectic

Moderator
according to google books, "[h=1]Programming and Customizing the Picaxe Microcontroller[/h] By David Lincoln" says the "OFF" bit of the command ...

PWMOUT pin, OFF

should have turned my c.2 LED off (but didnt)

http://books.google.com.au/books?id=YULl8nyRj8QC&lpg=PA64&ots=e3KxIC2Jya&dq=PWMOUT pin%2C OFF&pg=PA64#v=onepage&q=PWMOUT pin, OFF&f=false



There doesn't seem to be any reference to what that command does within any of the manuals
1. Please see the program in post #303

2. Manual 2, page 167

e
 

120ThingsIn20Years

Senior Member
According to the manual either a "off" or 0,0 can be sent to switch off the pwm.


I have always used " pwmout C.2, 0,0 so try that and see if it works for you.
Where did you find that?

I did a search on all 3 manuals for pwmout pin, off and got only the hit from where it mentions it within pwmout in manual 2. and there it just lists it but doesnt tell me what it does.

I want a new manual :)

/brain

/glasses

/search function
 

SAborn

Senior Member
Where did you find that?
I gave you the same Prog editor as i have and the line came from the help file under Manual2... pwmout. about 5 lines down.

Perhaps its the Russian Gingerbeer effecting your vision. :rolleyes:
 

westaust55

Moderator
Where did you find that?

I did a search on all 3 manuals for pwmout pin, off and got only the hit from where it mentions it within pwmout in manual 2. and there it just lists it but doesnt tell me what it does.
As eclectic mentions 2 posts above, PICAXE manual 2 (currently V7.7) page 167.

I do recall there was a problem with the "OFF' parameter and use of the PWMOUT <pin> 0, 0 was previously recommended.
Just tried in the PE V5.4.2 simulator and the "OFF" parameter is working there.

Which version of the PE are you using?
 

120ThingsIn20Years

Senior Member
I'm using ver 5.3.1

But I think I just discovered the problem.

When I highlight something from the pdf file and post it into the search box there is a crazy character that cant be seen...

IMG_3472.JPG

IMG_3473.JPG

but here's the cool thing.

The character changes.

But here's the really really cool thing.

...


It only happens when the picaxe project is running, and near my wireless mouse and keyboard!
 

120ThingsIn20Years

Senior Member
As eclectic mentions 2 posts above, PICAXE manual 2 (currently V7.7) page 167.

I do recall there was a problem with the "OFF' parameter and use of the PWMOUT <pin> 0, 0 was previously recommended.
Just tried in the PE V5.4.2 simulator and the "OFF" parameter is working there.

Which version of the PE are you using?
I might have been doing something strange as a result of general frustration.

I'll look at it again.

Sorry for $^$%^ everyone around with my claims of wacky manuals
 

120ThingsIn20Years

Senior Member
ok this is officially interesting

If it wasn't exciting enough that I discovered an entirely new letter of the alphabet as per my search in post 314, I have since discovered this...

doing this...

Code:
main: 
     pwm c.2,255,255          'lights my first LED which stays lit for 2 seconds then goes off 
     high c.1                       'lights my second LED 
     pause 3000 
     low c.1                         'Kills my second LED 
     
     pause 1000 
    
     pwmout c.2, 63, 200     'lights my first LED which stays on forever (which is cool) 
     high c.1                       'lights my second LED 
     pause 3000 
     low c.1                        'Kills my second LED 
     pwmout c.2, OFF 
          
end
leaves the LED on C.2 on for ever
but not when you run it in simulate

and...

changing the first line from
Code:
[FONT=monospace]pwm c.2,255,255 

to 

pwmout c.2,255,255
[/FONT]


sees the LED on c.2 go out at the "End" command


This is just a bizarre series of coincidences I really do look stuff up! :)

I'M NOT STUPID! :)
 
Last edited:

120ThingsIn20Years

Senior Member
So a tip to anyone unearthing this post in a backup pyramid in the year 4000, long after the PICAXE bots have destroyed the forum for their own protection.

If for some reason, on an 08M chip, you use

PWM PIN.#, #, #

dont expect PWMOUT PIN, OFF

or PWMOUT PIN.#,0 ,0

to work afterwards.

It will work in "simulate", but not in the real world

And don't run your project next to your wireless logitech MK320 keyboard and mouse whilst cutting and pasting text into a pdf search window. It could totally ruin your credibility as a serious student.
 

hippy

Technical Support
Staff member
If for some reason, on an 08M chip, you use

PWM PIN.#, #, #

dont expect PWMOUT PIN, OFF

or PWMOUT PIN.#,0 ,0

to work afterwards.

It will work in "simulate", but not in the real world
I'm not sure what you are trying to do ( other than exploring or randomly trying things ) but PWM and PWMOUT are two entirely different commands. PWM is software generation, PWMOUT is hardware background generation of a PWM signal.

What's happening is that when you issue a PWMOUT pin,OFF or PWMOUT pin,0,0 ( they are the same ) you are actually turning background PWM generation on in order to set it to 'off'.

I must admit I'm not clear on what you see happening which is wrong and I haven't tested it nor simulated it. Perhaps you could provide an example bit of code to demonstrate what the issue is ?
 
Top