Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PICAXE not working?

Status
Not open for further replies.
Okay to remove all confusion about the operation of the LM-311 and got the following results:

**thermistor cold**

pin2 (V+) = 1.51v (low)
pin3 (V-) = 1.79v (High)
pin7(Output) = 0.10v (Low)

**thermistor hot**
pin2 (V+) = 3.74v (High)
pin3 (V-) = 1.79v (Low)
pin7(Output) = 4.43v (High)


Obviously when it was hot it started cooling down and the values kept going down slowly to their previous numbers.

So assuming it works this way then we have to program the 08M so that when In4 = 1 and In3 = 1 Out2 = 1 (after 12s).
 
so what needs to be done it program the chip so when In4 and In3 are High , wait 12s and Out2 is High. else Out2 is Low.

Think you are wrong again, what it needs is

if IN4 is high and IN3 is high (switch is on and thermister is cold)
Then wait 12 seconds and check if the thermister is hot (IN4 high and IN3 low)
If thermister is hot then OUT2 will remain low,
If the thermister is cold (IN4 high and IN3 high) then OUT2 should be high to switch the motor on to turn the gas off.
If IN4 is low (switch off) then OUT2 should be low to switch the motor off.
If IN4 is low and IN3 is high (switch off and thermister cold) then OUT2 = low

Pete.

EDIT........ this one is wrong see below
 
Last edited:
OK so it is the opersite to what i just posted above, and needs to be.....

if IN4 is high and IN3 islow(switch is on and thermister is cold)
Then wait 12 seconds and check if the thermister is hot (IN4 high and IN3 high)
If thermister is hot then OUT2 will remain low,
If the thermister is cold (IN4 high and IN3 low) then OUT2 should be high to switch the motor on to turn the gas off.
If IN4 is low (switch off) then OUT2 should be low to switch the motor off.
If IN4 is low and IN3 is low (switch off and thermister cold) then OUT2 = low
 
You turn the gas on by the switch dont you, and the whole purpose of this circuit is to turn the gas off if the thermister is cold..........is that correct.
 
Once you put a wire across to pin1 (input1) from pin4 (input4) then this code should work correctly.

Pete.

Code:
'THIS VERSION 0007 BY SABORN
 
#picaxe 08m
 
symbol switch_1 = pin1
symbol C_311 =    pin3
symbol motor =    2
symbol Y =        b1
 
main:
 
	if C_311 = 0 AND switch_1 = 1 then Delay 
 
 
	if C_311 = 1 OR switch_1 = 0 then 
	low motor  ; gas OR switch OFF, Motor OFF - if the flame is on in the middle 
	endif 
 
	goto main
 
Delay:
	for Y = 0 to 11
	wait 1
	if C_311 = 0 AND switch_1 = 1 then
	next Y
	endif
 
 
	if C_311 = 0 AND switch_1 = 1 then 
	gosub Gas_off
	endif
 
	goto main 
 
 
Gas_off:
 
	high motor  ;gas and switch ON, wait 12s and Motor ON
	return
 
Once you put a wire across to pin1 (input1) from pin4 (input4) then this code should work correctly.

Pete.

Code:
'THIS VERSION 0007 BY SABORN
 
#picaxe 08m
 
symbol switch_1 = pin1
symbol C_311 =    pin3
symbol motor =    2
symbol Y =        b1
 
main:
 
	if C_311 = 0 AND switch_1 = 1 then Delay 
 
 
	if C_311 = 1 OR switch_1 = 0 then 
	low motor  ; gas OR switch OFF, Motor OFF - if the flame is on in the middle 
	endif 
 
	goto main
 
Delay:
	for Y = 0 to 11
	wait 1
	if C_311 = 0 AND switch_1 = 1 then
	next Y
	endif
 
 
	if C_311 = 0 AND switch_1 = 1 then 
	gosub Gas_off
	endif
 
	goto main 
 
 
Gas_off:
 
	high motor  ;gas and switch ON, wait 12s and Motor ON
	return

Yea what you said in post #43 is correct. I am confused about this wire going from pin1 to pin4... whats the point of this? pin1 of the 08M is just V+ and pin4 is the input connected to the output of the Lm-311...

I cant see why we would need to put a wire?
 
You are talking the wrong pin number again. Use the numbers on the outside of the drawing

What i was trying to get you to do was instead of the 08m using the broken pin which you said was pin3, is to get you to move what is conected to pin3 (the broken pin) to pin1 which is a input pin that is not being used.
Then the chip with the broken pin can still be used, and we just change the program to suit the new pin change.

Solder a small wire to the bottom of the board connecting the 2 pins like this in the image.

Then you will need this code with the pin changes made to it.

Code:
'THIS VERSION 0008 BY SABORN
 
#picaxe 08m
 
symbol switch_1 = pin4
symbol C_311 =    pin1
symbol motor =    2
symbol Y =        b1
 
main:
 
	if C_311 = 0 AND switch_1 = 1 then Delay 
 
 
	if C_311 = 1 OR switch_1 = 0 then 
	low motor  ; gas OR switch OFF, Motor OFF - if the flame is on in the middle 
	endif 
 
	goto main
 
Delay:
	for Y = 0 to 11
	wait 1
	if C_311 = 0 AND switch_1 = 1 then
	next Y
	endif
 
 
	if C_311 = 0 AND switch_1 = 1 then 
	gosub Gas_off
	endif
 
	goto main 
 
 
Gas_off:
 
	high motor  ;gas and switch ON, wait 12s and Motor ON
	return


If you could stop posting all the code in your quotes when you reply to a post it would be good, as there is so many lots of code posted now its getting hard to know what is what.
Edit your quotes as in the last quote, the code has nothing to do with your comment and it just makes this thread very messy.
Pete.
 

Attachments

  • 08m pinouts.JPG
    08m pinouts.JPG
    26.9 KB · Views: 161
Last edited:
You are talking the wrong pin number again. Use the numbers on the outside of the drawing

What i was trying to get you to do was instead of the 08m using the broken pin which you said was pin3, is to get you to move what is conected to pin3 (the broken pin) to pin1 which is a input pin that is not being used.
Then the chip with the broken pin can still be used, and we just change the program to suit the new pin change.

Solder a small wire to the bottom of the board connecting the 2 pins like this in the image.

Then you will need this code with the pin changes made to it.


If you could stop posting all the code in your quotes when you reply to a post it would be good, as there is so many lots of code posted now its getting hard to know what is what.
Edit your quotes as in the last quote, the code has nothing to do with your comment and it just makes this thread very messy.
Pete.

You are talking the wrong pin number again. Use the numbers on the outside of the drawing

Well, I thought its pretty clear what we say if we say inputs/outputs we are talking about the numbers outside. If we say pins then its the numbers on the inside. I mean the pin numbers never change, the inputs/outputs do.

So in your picture, I would have said connect pin4 to pin6 or input4 to input1 (not pin1).

Anyway, I think its pretty clear what I have to do, so I will connect the wire as you said and test it.
 
Last edited:
Actually now that I think about it, I'l just wait for the new chips to arrive. It was dispatched today so should be here on Monday or something. I will then test out the code again :)
 
With every picaxe forum and discussion i have ever been involved with it is always reserved that the word PIN is only used to denote refference to a input or output pin, if you want to talk about the physical IC pin numbers than that is expressed as LEG 1, leg2 etc.

This solve a large confusion problem and we all know what is being reffered to.

The later model chips (M2 and X2 chips) use a bank letter (A, B, C) prior to the pin number which makes it easier to know what is being reffered to, but the earlier chips only used the number that was derived from the raw PIC used as labelled by microchip.

Pete.
 
Last edited:
With every picaxe forum and discussion i have ever been involved with it is always reserved that the word PIN is only used to denote refference to a input or output pin, if you want to talk about the physical IC pin numbers than that is expressed as LEG 1, leg2 etc.

This solve a large confusion problem and we all know what is being reffered to.

The later model chips (M2 and X2 chips) use a bank letter (A, B, C) prior to the pin number which makes it easier to know what is being reffered to, but the earlier chips only used the number that was derived from the raw PIC used as labelled by microchip.

Pete.

Ah I see, alright. When the new PIC arrives I will just refer to it by A1, B1 etc
and the old ones by LEG 1, LEG 2 etc so we have no confusion :) (thanks for the info though!)
 
Finally! IT WORKSSS!!! I just tested everything with the motor and it all works as predicted! thank you SOOOOOO much for your help!!! I actually tried re-writing the code that you gave me just so that I can do it myself, but found the way you did it the most logical way ( as I wrote my code it just become more and more similar to yours lol).

I after I do all the mechanical stuff (shouldnt be too hard as I only need a few cogs etc) I might post a video on youtube to show it all working!

Thanks again!

Fouad.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top