08M: Invalid readtemp pin!

e024576

New Member
Problem - Using 08m chip: 2 DS18B20 to read 2 temps, also have 2 outputs to control, plus need sertxd for outputting data.

So for reading temps, DS18B20 interfaced with pins 3, 4, but code

readtemp 3, b0 ' read temperature

gives error ... Invalid readtemp pin! (syntax error editor V 5.3.1.)

Q1: I did not know that pin3 can not be used with readtemp, is this in the manuals some place?

Q2: It now seems there is do way with an 08M to - read 2 temps, control 2 output pins and also have sertxd ... any suggestions?

Thanks for your help !!
 

hippy

Ex-Staff (retired)
Welcome to the PICAXE forum.

The reason is that Leg 4, Pin 3 is an input only pin by silicon design which Rev-Ed have no control over. To use READTEMP requires a pin which is capable of both input and output and this is not possible with Pin 3.

I don't off-hand know if / where this is detailed in the manuals. I have made a note that clarification on the issue may be required.

As to reading two temperatures, controlling two outputs and having SERTXD I cannot think of an easy solution with an 08M though it may depend on what your outputs connect to, what SERTXD is used for.
 

Dippy

Moderator
Oh, the Manual definitely requires clarification.

The BASIC Manual says:-
{Quote}
READTEMP pin,variable
- Pin is the input pin.

And the drawing/schematic at the bottom of the page says "Input Pin".
So, yes, needs a change or a little note added.
Five minutes work ;)

Are there are any other PICAXE instances where this could cause confusion?
 

Chavaquiah

Senior Member
The entries for owin and owout in Manual 2 mention a "One-Wire Tutorial Datasheet."

Information:
Use of one-wire parts is covered in more detail in the separate ‘One-Wire Tutorial’
datasheet.
Is there a link to this datasheet?
 

e024576

New Member
Thanks for the help.

Guess this means that no pins on 14M or 20M chips work with ReadTemp, so the next choice is 14M2 ?
 

westaust55

Moderator
Thanks for the help.

Guess this means that no pins on 14M or 20M chips work with ReadTemp, so the next choice is 14M2 ?
No!, READTEMP will work with ALL "M" series PICAXE chips.
Note also that the 14M2 has not yet been released.

The "pin" must normally be in input pin as normally set by the PICAXE firmware.
But . . . at the fundamental PIC chip level, the physical pin/leg must be capable of also being an output which most pins are capable of - it is the except that a pin on some chips is limited to being an input only.

The reason is that the 1-Wire network is a bi-directional comms bus over a single wire (as the name implies ;) )
The PICAXE firmware looks after changing the physical pin from being an input to being an output and back again as required to communciate with the 1-Wire devices.
 
Top