Connecting two 18x's together

superbee383

New Member
I know I seen this post somewhere here, but I cannot find it.
What is the easiest way to connect the 18x together? The main reason I'm doing this is because I have no more input/outputs available on my one 18x and I do have another 18x.

Thanks
 

moxhamj

New Member
Using serin and serout. Connect an output pin on one picaxe to an input pin on the other.

Then you can get comms going back the other way.

But there is a bit of a catch- when a picaxe runs serin, it hangs till it gets the data. So then you need a way of saying there is some data on the way.

Two possible options:

Send a high pulse first - eg for half a second, and check the input pin to see if it is high and only run serin if it is high ie some data is about to come through.

Or, you can use more pins - eg another pin that goes high to indicate serin data is about to go through. For two way comms though this does tie up 4 pins.

But then there may be other ways that are better than a second picaxe. Eg - if you want more inputs, have a look at the 4051. And if you want more outputs, look at the HC595.

What are you trying to do?
 

lahaye

Member
Hello

A Forum search with: connecting, Picaxe, 18X has yielded (amongst others):

Using the "search titles only" option might help getting the most relevant results
- Connecting two PICs to each other? [http://www.picaxeforum.co.uk/showthread.php?t=8517&highlight=Connecting+18X]

One answer in this thread goes like this:

Hello,

Let me first answer the questions directly, and then make a remark about your setup.

Ans1: In general, you can connect two picaxe i/o pins directly if at least one of them is always defined as an input. The PICAXE-18X has a predefined layout with fixed inputs and outputs so that will work in this case. However be aware that most picaxes have flexible I/O pins and thus there is always the risk that two outputs get connected (for example, you may make a mistake when programming). If then one output is low and the other gets high a short-circuit situation occurs destroying both output ports immediately. Therefore it is often wise to include a 1k resistor for safety reasons. [...]

- Connecting Picaxe chips together [http://www.picaxeforum.co.uk/showthread.php?t=5291&highlight=Connecting+18X]







I haven't read the threads completely so they might still be a catch that's mentioned somewhere down the line....

Also there are ICs that are designed to increase the available outputs, certainly they are MUCH cheaper then a PICAXE, but I guess you ain't got them at hand.

If I read one of the replies correctly "Multiplexing" might also be a search term for information to tackle this issue, not sure though.


Regards

Florian
 

hippy

Ex-Staff (retired)
Staff member
In http://www.picaxeforum.co.uk/showthread.php?t=9921 post #5 I suggested a means of connecting two 08M/14M together using just a single line. This could probably be modified to work with 18X's. It wil require extra I/O pins but should still mean just a single wire plus 0V connection between PICAXE's.

It's more complicated than other solutions in some ways, more elegant in others. It would need to be fine-tuned to work, and anyone using it would have to understand what it was doing.
 

superbee383

New Member
Really, all I'm trying to do is some data logging. All my inputs/outputs are used and not sure if I can use serin/serout in between the time data is being sent/received on these pins. For example, I'm using 'serout 0' for my LCD. Can I use this same pin for serout to my PC?

Thanks
Kerry
 

Texy

Senior Member
Really, all I'm trying to do is some data logging. All my inputs/outputs are used and not sure if I can use serin/serout in between the time data is being sent/received on these pins. For example, I'm using 'serout 0' for my LCD. Can I use this same pin for serout to my PC?

Thanks
Kerry
If its to connect to a PC, you could use sertxd and use the download cable, if that output is not being used?

Texy
 
Top