Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Thread Tools Display Modes
Old 9th May 2008, 08:19 AM   (permalink)
New Member
fenderman is on a distinguished road
Exclamation PIC16F628A - Single Master to Many Slaves on Tx / Rx

I'm looking to use a small Local Area Network System using PIC16F628A's as the Slaves, (and for the rime being, also a master).

The overall distance from the Master to the last Slave would be about 25 Metres, and the Number of Slaves I want to link is around 30.

I want to use the direct connection method of Master Tx line to ALL the Slave Rx lines, and ALL the Slave Tx lines back to the Master Rx line.

I know I can achieve this over very short distances (bench testing, below 1 metre between about 6 units).

I have already designed and manufactured some 'Units' that were for 'stand alone' operation, but in anticipation of this, left the Tx / Rx lines of ALL the units.

I have been looking for info on the following, any info would be helpful !

1. How many Slave unit Rx pins can I connect to the Master Tx pin ?
2. Would I need to use an 'end of line' termination pull up resistor (100R/1K)?
3. Is there a 'limit' to the length of the connections etc.

I appreciate that the Baud Rate has an implication on this, I would like to use the 'inbuilt' USART function, I am using the 4Mhz internal clock, and would like to run 'as fast as possible', but the lowest (9.615 kbaud) would still be acceptable.

If this is still found to be 'too fast', I can use the Tx/Rx pins on ALL devices as I/O pins and program up a software USART to run more slowely.
I want to avoid adding any extra components if I can.

Any help / suggestions would be greatly appreciated.
Roy
fenderman is offline   Reply With Quote
Old 9th May 2008, 10:07 AM   (permalink)
Super Moderator
 
Nigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to beholdNigel Goodwin is a splendid one to behold
Default

Why not simply connect the devices in a series ring, TXOUT to RXIN, and have each device forward packets to the next one, with each one checking for it's own packet ID.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is online now   Reply With Quote
Old 9th May 2008, 10:46 AM   (permalink)
New Member
neomech is on a distinguished road
Default

To get any kind of spped over that kind of distance you would need to use some form of differential siginaling system. such as rs-422.

See here:

http://en.wikipedia.org/wiki/Differential_signaling

&

http://en.wikipedia.org/wiki/RS-422
neomech is offline   Reply With Quote
Old 9th May 2008, 12:12 PM   (permalink)
New Member
fenderman is on a distinguished road
Default

Thanks for the quick reply Nigel,

Sorry, I should have also mentioned that the 'machines' may or may not be 'switched on ' as part of the network.

Hence I can't use the series links as suggested, as obviosly the first machine in the chain that is 'off' kills the rest of the network.
So this was the reason for using a 'dropper' approach.

Any idea's where I can get the info concerning the distance / no of devices etc.? I have searched the Microchip website and this forum, but without any real conclusion.


Roy
fenderman is offline   Reply With Quote
Old 9th May 2008, 12:18 PM   (permalink)
Experienced Member
 
ericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud of
Default

hi,

Look at these links:

From Googling for RS232 Standards

http://www.lammertbies.nl/comm/info/RS-232_specs.html

http://www.maxim-ic.com/appnotes.cfm/appnote_number/83/
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 9th May 2008, 12:43 PM   (permalink)
New Member
fenderman is on a distinguished road
Default

Hi guys,

I'm trying to avoid using any additional hardware interface additions (RS422/485/max232's etc) as I already have production boards working fine in very close proximity to each other, and just want to link direct from pin to pin of the chips for the longer distances.

If the 9600 baud is too fast for it, I'll code a software uart on the Tx/Rx pins as I/O pins, and run it at VERY slow speeds.

It doesn't matter how long the data takes to get accross, as each unit is only passing / receiving a maximum of about 32 bytes.

It looks like it's going to be a 'try it and see' situation. !

Last edited by fenderman; 9th May 2008 at 12:46 PM.
fenderman is offline   Reply With Quote
Old 9th May 2008, 12:48 PM   (permalink)
Experienced Member
 
Blog Entries: 4
blueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to beholdblueroomelectronics is a splendid one to behold
Send a message via Skype™ to blueroomelectronics
Default

Read up on 1-wire bus. Single pin network.
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline   Reply With Quote
Old 9th May 2008, 01:02 PM   (permalink)
Experienced Member
 
ericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud ofericgibbs has much to be proud of
Default

Quote:
Originally Posted by fenderman
Hi guys,

I'm trying to avoid using any additional hardware interface additions (RS422/485/max232's etc) as I already have production boards working fine in very close proximity to each other, and just want to link direct from pin to pin of the chips for the longer distances.

If the 9600 baud is too fast for it, I'll code a software uart on the Tx/Rx pins as I/O pins, and run it at VERY slow speeds.

It doesn't matter how long the data takes to get accross, as each unit is only passing / receiving a maximum of about 32 bytes.

It looks like it's going to be a 'try it and see' situation. !
hi,
What type of environment is the system going to be working in.?

What type of cabling between modules.?
__________________
Eric
"Good enough is Perfect"

PIC tutorials:
Gramo's: www.digital-diy.net/
Bill's: www.blueroomelectronics.com/
ericgibbs is online now   Reply With Quote
Old 9th May 2008, 02:52 PM   (permalink)
Experienced Member
 
geko is just really nicegeko is just really nicegeko is just really nice
Default

Quote:
Originally Posted by fenderman
I appreciate that the Baud Rate has an implication on this, I would like to use the 'inbuilt' USART function, I am using the 4Mhz internal clock, and would like to run 'as fast as possible', but the lowest (9.615 kbaud) would still be acceptable.

Roy
You can set the baud rate generate down to 300 baud with a 4Mhz clock (Set BRGH bit to 0)
__________________
Pete
picprojects.org.uk
geko is offline   Reply With Quote
Old 9th May 2008, 03:18 PM   (permalink)
New Member
fenderman is on a distinguished road
Default

Its not a very electrically noisy environment, just the usual fluorescent lighting, general 13 amp plugs with 'bits' plugged in like kettles, lamps, the odd computer, printer, etc.

The Slave units are divided (not equally) between a number of 'station positions' (about 7 in all).

Each Station has a series of 'modules' that collect the local data, and pass to a 'Station' handler module .... this will be on the network.

The cabling between the slave stations and the master will be in 2 core screened cable (using the Screen as the 'Ground') - or would it be better to use a 3 core screened cable, as Tx, Rx, Gnd and Screen as Earth (at the master end only) ?

The only other cables that 'could' be near to the comms cable would be 20vdc, 15vdc, and 7.5vdc .... there will be NO Mains or AC circuits within about 2 meters of cable ...... quit a nice 'electronic friendly' area.

I indicated in my original post that the last slave is a maximum of about 25 metres away .... I was thinking that I could split the network into 2 completely seperate networks, and cable them in both directions.

Its basically an area 7 meters by 5 meters square, and I was baseing the comms link on going right round, hence 24 meters (not as a ring, just end to end) ... I can't cable as 'star' from point to point as there is equipment in the middle, the cabling MUST go round the sides.

If I split it into 2 networks, the max lenght of either network would only be 12 meters ..... Hmm or could I just cable it that way anyway, and then place the master half way along the 25 metre network ? ... there's a thought !

I've done plenty of Ethernet, Modbus, Profibus .... but not too clued up on network wiring of this 'hybrid' type, all suggestions greatfully received.
Roy
fenderman is offline   Reply With Quote
Old 9th May 2008, 03:20 PM   (permalink)
New Member
fenderman is on a distinguished road
Default

Cheers geko,
did'nt notice that in the data sheet (its that Friday feeling !)
fenderman is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Latest
Master and Slave LCD sim? RobertS Micro Controllers 5 6th January 2008 02:09 AM
opamp audio mixer - single supply fvnktion General Electronics Chat 7 11th July 2007 07:16 PM
Three Phase Versus Single Phase For EV fzn10 General Electronics Chat 4 31st July 2006 08:38 AM
uC 'network' reset circuitry rockin_rick Electronic Projects Design/Ideas/Reviews 8 30th May 2006 01:03 AM
I2C Master write problem using SSP (here's code) Oznog Micro Controllers 1 16th October 2004 05:47 AM



All times are GMT. The time now is 06:47 PM.


Electronic Circuits  |  Radio Controlled
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.