Picaxe 18 Bidir pin

fretei

New Member
Thanks for tip

Hi thanks for the tip, but Im also using the I2c, so I guess
this will get in conflict.
Is it possible to wire a input pin to a output pin via a Diod.??
 

westaust55

Moderator
Hi thanks for the tip, but Im also using the I2c, so I guess
this will get in conflict.
Is it possible to wire a input pin to a output pin via a Diod.??
The manuals will tell you which pins are used by i2c.
So read the register mentioned and just set the pins you need to alter to be changed to outputs while leaving the others alone.


or

Are you looking for a full 8-bit/pin wide port for parallel operations ?
 
Last edited:

hippy

Ex-Staff (retired)
Is it possible to wire a input pin to a output pin via a Diod.??
It's certainly possible to but whether it will work or even cause damage to your chips depends on how you do it and what you are trying to achieve.

Some more details on what you are trying to do will help people here give better advice.
 

kranenborg

Senior Member
Based on hippy's findings as referred to in the second post, I delivered some tested code snippets for bidirecional I/O as well as to additional ADC inputs on the 18X in the Code Snippets section of this forum ("Extending / reconfiguring Picaxe-18X I/O"): http://www.picaxeforum.co.uk/showthread.php?t=9289

Like mentioned by fretei, this option will probably not work if i2c is used, as I expect that the picaxe will then revert to the standard inputs and outputs configuration (I have not tested though)

@hippy: You mentioned in another thread that the 14M will have the potential for 8 ADC channels. Is there a similar "shadow" register for the 14M as there is for the 18X? In that case the same type of code could probably be used to enable all eight channels

/Jurjen
 

westaust55

Moderator
i2c keeps switching the data pin to be an input and an output - particularly for read comamnds. This is being done without affecting the other pins as inputs so seems possible that other non i2c pins can be made outputs and remain unaffected by i2c.

But fretei states "I need a bidirectional port"
Taking the word port literally he could be looking for 8-bit wide port as opposed to a single pin. Awaiting his clarification there.
 
Last edited:
Top