Driving ONE Xbee with several PICAXE's...

Grogster

Senior Member
Hi all.
:)

I want to be able to send data across an Xbee link, using several different PICAXE chips.
Each "Node" consists of an 18X chip, programmed with a text message depending on which door has been opened.
The Xbee transmitts the text message across the link, and the receiving end pops up with the message on an LCD. That's a rather simplistic description - there's more to the system and each node then that, but that is it as far as the Xbee link is concerned.

A one-way link works beautifully like this.
2400 baud at all times.

I was thinking along the lines of just paralleling up the serout pins via a passive resistive mixer, the output of which, is then connected to the DIN pin of the Xbee.

My concern is that if 18X chip #1 transmitts it's serial message, this message will appear on the serout pins of all the other 18X nodes(as this is essentially now a serial data-bus arrangement), so I guess what I am trying to ask, is if the PICAXE cares about serial comms present on an output pin from a device OTHER then itself.

Hope I am making some sort of sense here...

I ask at all, as I am just curious if the PICAXE might throw a hissy fit if I connect them together like this, and not really that keen to kill several 18X chips just to find out!!! :D

ADDITIONAL: I have added a wee GIF of what I am wanting to do...
 

Attachments

Last edited:

Dippy

Moderator
Too scared to try it?

I would imagine the other PICAXEs would detect it.
Maybe a combination of pullups on the PICAXE pins would help.
Just guessing, and you'd have to experiment with values.

Or you could try diode mixing.
 

hippy

Ex-Staff (retired)
Yes, PICAXE's will object ( potentially disapperaing in a puff of magic smoke ) if you connect their outputs together directly. Using current limiting resistors for mixing prevents that but messes up the voltages; if one is output high, another output low, the two R's act as a potential divider, output voltage = 2V5. The solution is to use diode mixing.

www.hippy.freeserve.co.uk/picaxeio.htm

Note that XBee is a 3V3 device expecting 3V3 input.
 
Last edited:

Dippy

Moderator
I'm a bit out of prctice with 18Xs, so this is a question/suggestion...

If you could POKE the 18X outputs to make them inputs by default , then you could set i/o before and after the Serout - then diode mixing not needed.
Thus the outputs become inputs and have a high impedance whilst 'not in use'.

If you can do this then 3 'safety' resistors are all that is required.

But I don't know if this can be done on 18X ???

(Obv. in any case you would have to ensure that only one Serout at a time was done.)
 

hippy

Ex-Staff (retired)
Dippy's right, that would work for the 18X, and current limiting R's would prevent damage from having two as outputs at the same time ( such as during download / after reset ).

Using 10K series limiting R's all joined, with a 22K pull-down and that point taken to an XBee it also gives 5V to 3V3 conversion.
 

BCJKiwi

Senior Member
Problem with that is bus contention - what if two or more of the 18X's are trying to send at the same time - safer to stick with the diode mixing.
 

Dippy

Moderator
BCJ: I don't follow your thinking over what has already been said.

The resistors would limit current and even diode mixing wouldn't prevent screwing up the data if two or more did their stuff at the same time ?????

In actual fact the resistor method with a little drop of cunning code could be used to sense the line level before Serouting.....
 

hippy

Ex-Staff (retired)
10K will limit the current to 500uA at 5V, well below the 25mA rating of the PICAXE I/O drivers.

That protects the PICAXE's but does nothing for solving providing the XBee with a less than 3V3 input signal ( all PICAXE's outputing low will put their R's in parallel with the 22K pull-down, reducing the signal voltage ).
 

Grogster

Senior Member
Thanks to all for the comments thus far. :)

@ Dippy: Not scared to try it, if the 18X's were only $5 or $6, but they are $27 each here, so not wanting to cook about $100 worth of 18X's just to find out I am wrong - hense my asking about it here... :D

Yes, PICAXE's will object ( potentially disapperaing in a puff of magic smoke ) if you connect their outputs together directly. Using current limiting resistors for mixing prevents that but messes up the voltages; if one is output high, another output low, the two R's act as a potential divider, output voltage = 2V5. The solution is to use diode mixing.

www.hippy.freesere.co.uk/picaxeio.htm

Note that XBee is a 3V3 device expecting 3V3 input.
Your link does not work for me - it comes back saying this page cannot be found, and drops me at a generic search-engine type thing.

Yep, know about the 3v3 thing - my wee diagram attached to the first post mentions that the 18X's output is at 3v3 logic level, but it was very wise of you to mention it, as without making sure... ;)

EDIT: @ hippy: Found a missing letter v in your link, and now the link works, and I am reading it. :)
 
Last edited:

BCJKiwi

Senior Member
@ Dippy
Just following first principles here.

Figured that Hippy's Post #3
"Yes, PICAXE's will object ( potentially disapperaing in a puff of magic smoke ) if you connect their outputs together directly. Using current limiting resistors for mixing prevents that but messes up the voltages; if one is output high, another output low, the two R's act as a potential divider, output voltage = 2V5. The solution is to use diode mixing."

Would still be applicable if more than one chip was poked to output at the same time.
 

Dippy

Moderator
But hippy was warning (I assume to onlookers) about the hazards of direct conenction.
Diect connection was never in question.

The original post and all other posts stated that resistors would be used. So, if POKEable the problem of simultaneous Serouts would only have the corrupting effect that diode mixing gives.

$27 !! Blooming heck. I didn't know that.
Anyway, if you can absorb all the 'Absolute Maximum' figures then you can have confidence with your design.
... and it saves me breadboarding your design and blowing my PICAXEs :)
 

Grogster

Senior Member
Have been working on a diode gate/diode mixer as discussed.
I have changed the 18X juice to 5v instead of 3v3, and put one common resistive divider(potential divider) on the output of the diode-gate. I did this, to avoid the 0.6v drop across each 914/4148 diode from affecting the final voltage to the Xbee.

Due to the global credit crunch, the price of the chips has rocketed up from about $19 per 18X, to $24.50 per 18X. OK, so I was $3 out in my calculations... :p

I will let you know what happens in the next few daze...
:)

EDIT: plus GST(our VAT), comes out as $27.60 per 18X, so I was right. :p
 
Last edited:

kranenborg

Senior Member
Hello,

The bus contention issues could be resolved by using the diode-mixing version of the SerialPower network as it provides for separate timeslots for each of the nodes while using hippys diode-mixing.

You could simplifiy the design further by reducing network traffic: instead of letting each node send a full text message via the network and the Xbee link you could store all text messages at the receiver side (makes editing much simpler as well) and send a byte ID instead (you could even use the SerialPower process ID for each node)

/Jurjen
 

Grogster

Senior Member
Hello,

The bus contention issues could be resolved by using the diode-mixing version of the SerialPower network as it provides for separate timeslots for each of the nodes while using hippys diode-mixing.

You could simplifiy the design further by reducing network traffic: instead of letting each node send a full text message via the network and the Xbee link you could store all text messages at the receiver side (makes editing much simpler as well) and send a byte ID instead (you could even use the SerialPower process ID for each node)

/Jurjen
A great idea, and one I had TOYED with, but not really considdered.
One concept was to send two or three byte commands, which are read by a main processing chip at the receiving end, which then sends out the message - just as you have suggested. I most likely will go down this road, if my experiments do not prove sucessful...
 

moxhamj

New Member
Re "Have been working on a diode gate/diode mixer as discussed.
I have changed the 18X juice to 5v instead of 3v3, and put one common resistive divider(potential divider) on the output of the diode-gate. I did this, to avoid the 0.6v drop across each 914/4148 diode from affecting the final voltage to the Xbee."

Is there a problem dropping the picaxe power supply to 3v3? That simplifies a lot of things as you don't need voltage translation.

Is the 0.6V drop a problem? Would an xbee still consider 2.7V to be a logic High? It probably would, but if you are really worried you could always use 74HC32 OR gates instead of diode mixing. They will run from 2V to 6V so you could run them at 3.3V. US25c from futurlec.

You can do a quick test with one 18X and one xbee and run the output into a diode with a 10k pull down on the input of the xbee and see if the data goes through. That is a safe test and it will check out of the 2.7V is high enough.
 
Last edited:

kranenborg

Senior Member
Just some info in case the issue pops up:

Regarding the 18X at different voltage levels: I have found the 18X oscillator frequency to be rather dependent on Vcc and because of this I found it not possible to program at 3.3V (since the programming editor baudrate cannot be changed: at some point in the download process it failed). You will probably have to program at 5V. Running the 18X at very low voltages though is not a problem at all, but calibfreq might be necessary when using sertxd/serout to a PC (inter-18X acommunication at low voltages probably not a problem, but check what happens with 18X to Xbee comms). I have the experience that for example the 08M is much easier on this one

/Jurjen
 

hippy

Ex-Staff (retired)
While most PICAXE / PICmicro will run well below their minimum recommended voltages ( 4V to 5V5 for 18X ) both Flash and Data Eeprom require 4V minumim for reliable programming on 18X. It may be that the PICmicro cannot generate enough voltage internally to program rather than a widely off-spec oscillator frequency or baud rate.

The 08M operates down to 2V, and can be downloaded to reliably at that voltage.
 

kranenborg

Senior Member
Hippy, in my PongSat app I noted that at Vcc = 3.3V the baudrate of the 18X at sertxd was changed to such an extent that a strong adjustment via calibfreq (value 14) was necessary, while the latter command was not at all necessary at all at Vcc = 5V. Therefore I think that the 18X is somewhat picky regarding oscillator frequency.
For what it is worth, it is not a big issue and can always be circumvented with some calibfreq experimentation.

/Jurjen
 

Andrew Cowan

Senior Member
That's internal resonators for you (RC resonators). An external resonator will be much stabler over temperature and voltage.

A
 
Top