Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PIC16F628A - Single Master to Many Slaves on Tx / Rx

Status
Not open for further replies.

fenderman

Member
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
 
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.
 
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
 
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:
fenderman said:
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.?
 
fenderman said:
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)
 
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
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top