08m2 i/o


I think I know the answer to the following question, but feel obliged to ask on here to ensure I have investigated all options.

From the Microchip datasheet for the 08M2

Peripheral Highlights:
• 5 I/O Pins and 1 Input Only Pin:
I concluded I could use c.5 as an output pin (c.3 is the input only pin)

However, the 'PICAXE M2 chip summary' sheet dashed this hope as, in there, c.5 is input only:(

I confirmed this with
output c.5
high c.5
both returning compiler errors

dirsc = %00110111
does not return a compiler error, which initially gave me some hope)

I am so close to completing this project with an 08M2, but need one more output.

My I/O requirements are:
DS18B20 - currently connected to c.4
Bit bang serial input/output - currently connected to c.1
Serial clock output - currently connected to c.0
Serial strobe output - currently connected to c.2

I need one more digital output for a relay. There are two I/O pins still available on the 08M2 but both seemingly input only.

I know I can move up to an 18M2 and the problem would be solved. But, I just wanted to check with the experienced hands on here there is no way to keep this project in a 08M2?


Technical Support
Staff member
Pin C.5 ( leg 2, Download Serial In ) is input only for the PICAXE. Altering bit 5 in dirsC ( or dirC.5 ) won't generate a compile error but won't make the pin an output either.

You might be able to make some pins multi-function - control more than one thing at a time - but that would depend on what you actually have which is being controlled. Some more detail on what C.0, C.1 and C.2 connects to may help. Perhaps post a circuit diagram as that's often worth a thousand words.

An RC circuit added to an output pin may allow pulses for clocking through and not affect a relay etc.

There was a clever trick given on the forum for turning the internal pull-up on and off to use C.5 as an output which might be worth investigating but may be more complicated than using a larger PICAXE.