Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 09:42 26 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : RS 232 Network for Maximite

Author Message
marcwolf

Senior Member

Joined: 08/06/2009
Location: Australia
Posts: 119
Posted: 03:33pm 05 Sep 2012
Copy link to clipboard 
Print this post

Just looking for idea's here.

When compared to Picaxes and Arduino's the Maximite is limited in the number of serial ports that it has, espcially when you want it to read inputs for several other microcontrollers.

One idea I am thinking of is using a 'control' line which is High when a device is connected and wants to talk, and low when the bus is free

Each device (Picaxe) can then check this line and if it is low - raise it and then send a line of text to the Maximite. After sending the line is set low again.

The Maximite ca be set on a interrupt with this line so that it knows when a message has been sent.

Any suggestions
Dave
Coding Coding Coding..
Keep those keyboards coding..
RAW CODE!!!!!
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 03:37pm 05 Sep 2012
Copy link to clipboard 
Print this post

Called the I2C bus \
Also investigate RS485 / RS422 / CAN / SPI protocols
Edited by djuqa 2012-09-07
VK4MU MicroController Units

 
marcwolf

Senior Member

Joined: 08/06/2009
Location: Australia
Posts: 119
Posted: 05:47pm 05 Sep 2012
Copy link to clipboard 
Print this post

I2C bus is fine.. However

1. Not all PicAxe's can be made Slaves
2. There are issues when one has multiple Masters on one I2C bus


I will look at the others but I'd prefer not to Bit-Bang if necessary

Dave
Coding Coding Coding..
Keep those keyboards coding..
RAW CODE!!!!!
 
Greg Fordyce
Senior Member

Joined: 16/09/2011
Location: United Kingdom
Posts: 153
Posted: 11:36am 06 Sep 2012
Copy link to clipboard 
Print this post

  marcwolf said   Just looking for idea's here.


Dave, Here's a wacky idea I am working on. I've modified a RS232 bus that allows multiple devices to send data back to a master. The MM acts as a master and any number of slaves can be connected in a daisy chain fashion. What I have done is to connect the tx from the MM to the rs of the first slave. Then slave one sends on it tx to slave 2 rx, etc. (referred to as the slave bus). Then the rx on the MM is connected to all the slave tx pins and they take it in turns to transmit data referred to as the master bus). A max232 is used on every node, but the tx pin on the slaves goes through a diode to keep any slaves pulling the bus negative. Instead a 10k resistor tied to the V- pin on the MM max232 pulls the master bus low. So far testing at 9600 baud works flawlessly. More info and schematics here;
Lithium BMS thread

GregEdited by Greg Fordyce 2012-09-07
 
donmck

Guru

Joined: 09/06/2011
Location: Australia
Posts: 1313
Posted: 03:20pm 06 Sep 2012
Copy link to clipboard 
Print this post


Here is the reminisce of an RS-232 Serial Port network, I wrote a very long time ago:

http://www.dontronics.com/picex.html

It may give you some ideas.

Don...
https://www.dontronics.com
 
marcwolf

Senior Member

Joined: 08/06/2009
Location: Australia
Posts: 119
Posted: 06:01pm 06 Sep 2012
Copy link to clipboard 
Print this post

Many thansk all for your input

I have a far better idea of how to achieve what I need.

Dave


Coding Coding Coding..
Keep those keyboards coding..
RAW CODE!!!!!
 
graynomad

Senior Member

Joined: 21/07/2010
Location: Australia
Posts: 122
Posted: 03:06pm 07 Sep 2012
Copy link to clipboard 
Print this post

[quote]What I have done is to connect the tx from the MM to the rs of the first slave. Then slave one sends on it tx to slave 2 rx, etc.[/quote]
That's a ring network, quite a common topology and in fact I'm working on a spec for one right now.

It's potentially more robust that the standard multi-drop topology, especially if you have two rings running in opposite direction (redundant ring topology) which is what I'm doing. Edited by graynomad 2012-09-09
Rob Gray, AKA the Graynomad, www.robgray.com
 
bigmik

Guru

Joined: 20/06/2011
Location: Australia
Posts: 2914
Posted: 11:57am 09 Sep 2012
Copy link to clipboard 
Print this post

  marcwolf said   Just looking for idea's here.

One idea I am thinking of is using a 'control' line which is High when a device is connected and wants to talk, and low when the bus is free

Any suggestions
Dave


Hi Dave,

I work in the racing industry and we use an RS485 network that does something very similar to what you want...

But rather than your daisy chain idea which relies on all nodes being alive, (ok you are talking about a second string for redundancy) You could impliment a "parallel" idea. Its not parallel in it true sense but basically you run your cable from point to point but ALL nodes talk on the same line and listen to the same line and are given "drop IDs".

The master unit sends a command out for a particular drop to do something and the relevant drop responds... Or conversely the Drop has something to communicate it sends a command to the master for response.

This is not quite what we use in the racing game as we have the Master POLLING each Drop to see if it needs anything and each drop in turn responds with either an acknowledge or a request.. this way the Master can keep track of all nodes status.

But you could use the same hardware without the polling.

How does it work with all transmits connected together.

Well the chips that we use for RS485 are 75174 and 75175 (very cheap) and they can be tri-stated so they dont hold the line down when they are not talking.

The advantage of RS485 over RS232 is its long drive capability over twisted pair (you can use CAT5, though we dont) we have runs that stretch up to about 1.5km (nearly 1mile) long.. I am not sure what the maximum run is but we drive that distance fine at 9600 baud.

It still only requires 2 pair of wires (4 wires total,2 for TX and 2 for RX, No GND needed) just a Dual differential (Data + and Data-) low voltage pair. There is a 2 wire RS485 standard but I admit to not knowing the basics behind that one)

Without checking the specs I think the chips work off only 5V. (I just checked the specs, Yes they are 5V powered)

Regards,

Mick



Edited by bigmik 2012-09-10
Mick's uMite Stuff can be found >>> HERE (Kindly hosted by Dontronics) <<<
 
djuqa

Guru

Joined: 23/11/2011
Location: Australia
Posts: 447
Posted: 12:04pm 09 Sep 2012
Copy link to clipboard 
Print this post

marcwolf
Why re-invent the wheel
RS-485 and other serial protocols have been used successfully for years.


VK4MU MicroController Units

 
marcwolf

Senior Member

Joined: 08/06/2009
Location: Australia
Posts: 119
Posted: 06:19pm 09 Sep 2012
Copy link to clipboard 
Print this post

HI Folks

I think things got a bit off track here. My original question was that the transmission be serial with an 'in use' or 'attention' line to stop other Picaxe's from sending information out of term.

I never intended to use a Daisy-Chain system and all nodes would be in essence parallel.

The runs will only be a couple of feet if that.

Thanks for all of the input anyway :)
Coding Coding Coding..
Keep those keyboards coding..
RAW CODE!!!!!
 
graynomad

Senior Member

Joined: 21/07/2010
Location: Australia
Posts: 122
Posted: 09:54pm 09 Sep 2012
Copy link to clipboard 
Print this post

[quote] check this line and if it is low - raise it and then send a line of text to the Maximite. After sending the line is set low again. [/quote]
[quote]transmission be serial with an 'in use' or 'attention' line to stop other Picaxe's from sending information out of term. [/quote]
There is always the potential for a race condition when you do that, especially with a slow processor like the Picaxe, one way around that is to add a variable delay (either random or based on the node address) after testing the signal.

Trouble is how do you then know you have the line?

The only way I know is to start transmitting then test for bit clashes, something well beyond the Picaxe I think.

It's for these reasons that master/slave and ring topologies are popular. Multi-master can be quite difficult to get right.

_____
Rob

Rob Gray, AKA the Graynomad, www.robgray.com
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 11:27pm 09 Sep 2012
Copy link to clipboard 
Print this post

You would almost think that a wireless solution would be easier and more flexible.
http://www.ebay.com/itm/2x-Mini-2-4Ghz-Wireless-NRF24L01-Tra nsceiver-Module-/320582783541#ht_3071wt_1163

I made something based on rs-232 a long time ago. After a long time thinking and experimenting i settled for a master that would request data from the attached 'nodes'.
In my case the nodes could not communicate with eachother so it was pretty easy.

If you want nodes to communicate also then one of the nodes should assume the role of a master and just have a go sending a request to the destination node. If no answer gets back it probably collided with another (or the destination node is offline). Use random timeouts to try again.
You would have to make the packets smart enough so that it can be validated upon receive. Some sort of checksum would be sufficient.
This would actually be easier then having a signal line, it would be impossible to check who was first.

Another way would be to allocate timeslots.
A master would send a broadcast message that is received by all nodes to synchronise time. From that moment each node can only transmit when it has its allocated timeslot.
Use large margins and broadcast a synchronisation message every minute or so.
Depending on the needs you could give each node one or more timeslots in that minute. With high baudrates, short messages and not too many nodes it could be fast enough.

Microblocks. Build with logic.
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 3801
Posted: 10:24pm 10 Sep 2012
Copy link to clipboard 
Print this post

I've used the NRF24L01 (from C, not Basic) and they seem OK. Slightly awkward because they either Tx or Rx at a given time so peer-to-peer is a little pesky.

The price is right, though!

John
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024