reconfigure 18x pins input to output

kranenborg

Senior Member
Hi,

You may change the confuguration of the Port B pins which in case of the 18X are the output pins. This means that you can turn them into input pins (see my code snippets contribution on this matter: http://www.picaxeforum.co.uk/showthread.php?t=9289 ). What you want (input pins to outputs) does not concern Port B and thus is most probably impossible, you may either select a larger picaxe or use a simple and cheap but flexible MCP23008 i2c port expander, for example

Another option is to wait for the announced PICAXE-18M2 which is expected to surface this quarter of the year, as it will be a drop-in replacement for all 18-pin picaxes ( see http://www.picaxeforum.co.uk/showthread.php?t=13938&highlight=18M2 for all details about this sexy and cheap chip) and will have fully configurable i/o pins similar to the X2 variants

Best regards,
Jurjen
 
Last edited:

fred_b

Member
Thanks. I am looking forward to the release.

The flyer said that almost every pin is configurable. Surely that would include 18 and 1?
 

hippy

Ex-Staff (retired)
"Almost every pin is configurable" will mean whatever we can make work which doesn't have hardware limitations and is sensible to do. For the 18M2 it likely means that pin 18 and 1 ( which are general I/O rather than power pins ) should be configurable.

The 18M2 pins will operate in two configurations, 'traditional mode' ( fixed inputs and outputs like the 18X, 18M ) and in a 'configurable mode' ( similar to how the X2's work ) so it will be easy for people to migrate from the 18X and 18M to 18M2 while also giving the flexibility the X2's have. This will be the same chip operating in whichever mode, not two separate chips. The 18M2 is pin compatible with the 18X and 18M so should be a drop-in for existing projects and 18-pin project boards will work with it ( unless something throws a spanner in the works which we're currently unaware of ).

I don't have the full details of exactly how this is being implemented but the above is how I understand it to be.
 
Top