PICAXE 08M use of pin [leg] 3

Logic Rules

New Member
Hi guys,
I have been using Picaxe 28A, and 18X but I just got around to the 08M. Either I'm having a brain freeze or the manuals are not quite clear.
In testing the 08M I tried to change the output to pin 3 but the syntax check says that I can't use this pin (3) for an output??? All other pins (0, 1, 2, 4) worked fine.
Please free my brain.
 
Last edited:

BeanieBots

Moderator
The 08M pin 3 in INPUT ONLY.
Also, it does not have an internal clamp diode, so if you want to connect a signal higher than Vcc (eg +/-12v RS232) then you must fit an external clamp diode.
 

Dippy

Moderator
Well, without wishing to sound cheeky, it does clarify in Manual 1 page 22 "PICAXE 08/08M pinout...."

Are you getting Pin number and Input/Output Number muddled?
 

Logic Rules

New Member
At this point I am very confused; Manual 1 does show Pin 4 as being the Infrain/In3 but Manual 3 page 27 shows what does not comply with that.
Page 27 - Input Device 2 - Potentiometer

main: readadc 0,b1 ' read value on pin0 into variable b1
if b1<75 then light1 ' if b1 is less than 75 then light 1
if b1<175 then light2 ' if b1 is less than 175 then light 2
goto light3 ' if b1 is greater than 175 then light 3
light1: high 1 ' switch on LED 1
low 2 ' switch off LED 2
low 3 ' switch off LED 3
goto main ' loop
light2: low 1 ' switch off LED 1
high 2 ' switch on LED 2
low 3 ' switch off LED 3
goto main ' loop
light3: low 1 ' switch off LED 1
low 2 ' switch off LED 2
high 3 ' switch on LED 3
goto main ' loop

----------------------------------------------------------------------

If I change it as follows the Syntax Check is OK.

----------------------------------------------------------------------

main: readadc 1,b1
if b1<75 then light1
if b1<175 then light2
goto light3
light1: high 0
low 2
low 4
goto main
light2: low 0
high 2
low 4
goto main
light3: low 0
low 2
high 4
goto main


readadc 0,b1 is wrong, and other assignments had to be changed as well. There is definitely something wrong here. Is it the manuals or the terminology?
I haven't even tried to run thiis yet; as the matter, so simple, is so confusing.
Thank you for you replies
P.S. Cheeky is alright as long as it's the top cheek :)
 

Dippy

Moderator
Well, in fairness, I don't see "This is an example for a PICAXE 08M" mentioned in Man3 P27, though a little note to the unwary would be handy.

On the other hand you noticed it, worked it out and learned, that's good huh?

I guess the lessons learned re: 'example code' are:
A) One size doesn't fit all.
B) You can't always get the exact code you want from the book. This also applies to circuit design and maybe even bee keeping :) (Stan?)
 
Top