Connecting chips together

Hi guys!

If i wished to connect 2 chips together and send serial data between them using the serin and serout commands, whats hardware is involved.
Im assuming i cant just put a wire between them. Do i need a resistor in there etc

Thanks

Alex
 

eclectic

Moderator
Hi guys!

If i wished to connect 2 chips together and send serial data between them using the serin and serout commands, whats hardware is involved.
Im assuming i cant just put a wire between them. Do i need a resistor in there etc

Thanks

Alex
Quick anwer until of one the grownups arrive.

1. A Picaxe pin can sink / source 20mA
2. Put a 1000 Ohm resistor in-line. (1k)
At 5 volts, it will limit the current to 5mA.

e
 
Last edited:

fred9

New Member
Hi guys!

If i wished to connect 2 chips together and send serial data between them using the serin and serout commands, whats hardware is involved.
Im assuming i cant just put a wire between them. Do i need a resistor in there etc

Thanks

Alex
The I2c interface is much faster BTW, set one to "master" and the other to "slave". No code required for the slave, the master can read/write to the slave with no change/affect on the slave code/speed (background hardware operation). The scratch ram is used for data transfer.Very convienient.
 

westaust55

Moderator
First presumtion is that it is two PICAXE "chips" you wish to interconnect.

Assuming two PICAXE chips which are they?
You have started threads in the past for 28X1 and 40X2.

With respect to i2c comms as mentioned by Fred, if you have an X, X1, X2 or M2 part those chips can be used as a master.
Only X1 and X2 parts can be used as a slave device.

Even for the SEROUT - SERIN approach, note that only the M2, X1 and X2 parts have the ability to time out and proceed should no inpput be received in a given time frame. So if the receiving device is an "M" series chip it will effectively be "locked up" in the SERIN command until data is received.

The inclusion of a resistor between the two chips" could be seen as a recommended component when the receiving device is an X2 or M2 part. If by error the input pin for the SERIN function is changed to an output and then the you will have two outputs interconnected. If one output is high and the other low, then effectively you have a short with high currents and the demise (loss of magic smoke) from one or both chips.
So while it is not mandatory and if you ALWAY do everything correctly there is no need, the recommendation would be to include the resistor ( value recommended above by eclectic) as an insurance policy.
 
Last edited:

hippy

Technical Support
Staff member
If i wished to connect 2 chips together and send serial data between them using the serin and serout commands, whats hardware is involved.
Im assuming i cant just put a wire between them. Do i need a resistor in there etc
In the right circumstances you can simply connect SEROUT pin to SERIN pin with a wire but it would normally be recommended to use a 1K resistor rather than wire.
 
Hey guys! Im planning to join 2 28x1's and 1 28X to a 40X2 (the master) all to its hserout pin (apart from the 28x as this doesnt support hserout). The chips will then only recieve data down this line when prompted too by an input on a normal pin from the main chip.
Can an iC2 bus handle this and if so ... what is it ... as i havent ever touched on that subject.

This is a project just for fun btw :)
 

hippy

Technical Support
Staff member
Not quite sure exactly what you want to do but HSEROUT is an output; from a 40X2 that can drive any and all PICAXE inputs as slaves ( via HSERIN or SERIN on the slaves ), but it looks like you may be considering having the slaves talk to the master ?

Perhaps an I2C bus could handle what you want but I think we need to be clearer on exactly what you want to start with :)
 
Yes im looking at for examaple having the master confirm the slave is there, then send it instruction on what task to perform or data to read, and then the slave chip "feedback" as such, which can then be read into the computer.

Im just trying to create a basic "network as such with the picaxe chips, so i will have client lights to show what boards are connected, and each will have its own tasks it can perform. Then the main master chip can feed the data back to serial LCD or computer.

Im running out of idea's of what to build ... can you tell :)

Thnaks guys!
 

Dippy

Moderator
Alex, you really should help us with a sketch.

If you use I2C you need a Master + X number of slaves.

You can achieve a similar thing with Serial using 2 wires (1 wire if you are really clever). Plus ground of course.

BUT, you MUST have a little think about the Slaves comms back to the Master.
A standard USART serial out is a pin in 'output' mode.
And, also, non-USART pins sending Seriout will be in output mode.
So, ALL of the pins can drive the line high or low and will be fairly low impedance.
Question.
What happens if you connect a bunch of Serout 'output' lines together?
Once you have worked out the potential problem FOR YOURSELF , then we can give you the answer and the solution.
No doubt some smart ass will tell you the answer but it would be REALLY GOOD if you could work this out for yourself.
I find that if I can suss the problem then the solution follows it fairly quickly.


Which method is best? I2C if you can make it work. Either will be fine. Make your mind up :)


Blimey , if you are running out of ideas what to build now , then this school holiday is going to be pretty boring. I suggest going for a game of tennis or football with your friends. It'll give you a chance to think and burn off the Christmas Turky flab :)
 
Top