Digital MOSFET for power switcing form PIC

Thread Starter

G0JLB

Joined Sep 23, 2007
13
Hi All,

I am just looking for some basic advice.

I have developed a RS485 system based on one master controller and 32 slaves. Each slave uses a PIC18F1220 and the master uses a PIC18F4520.

The slaves are all conected serially using CAT5 cable which connects the RS485 lines and also uses the spare CAT5 wires to supply 12V power to the slaves.

What I want to do is search the RS485 bus and assign each slave with an ID. Eg 1 to 32.

My thoughts on this are:

Switch on a 12V output from the master which will supply the first slave.
The first slave can then talk to the master and assign its first ID. Eg. 01

Once complete the 1st slave will switch a 12V output which will supply the second slave. The 2nd slave will then talk to the master and assign its ID as 02. Then switch its 12 output to the 3rd slave.....

And so on.

When their are no more slaves present the last slave will switch in its 485 bus terminatior. ie a 120 Ohn resistor.

By doing this I can search the bus for 0 to 32 slaves and assign IDs to each one. The peak power up current will be less because each slave will be powered up in a controlled way and then put into sleep.

My question is what is the best way to switch the power to each slave.
I was thinking about using a digital FET driven directly from the PICs output but I need a robust solution that will prove to be reliable.

Each slave will draw no more than about 40mA so I need to FET which can switch about 1.5A and of course very low Rds because they will efectivly be in series.

Does this method sound ok or perhaps their is a better way of doing this.

Any thoughts, suggestions or advice about which method or FETS to use would be be helpfull.

Thanks

Paul
 

beenthere

Joined Apr 20, 2004
15,819
The PIC 18F1220 has both a standby and a sleep mode. As they are low power to begin with, you might just signal each to wake up in sucession as they get polled. Look for the spec's on current draw in each mode to see if that suits your energy budget.

Using a FET to switch power to each gets a bit elaborate, as the FET will have to be in the high side of the circuit. That might mean a purpose-made driver for each one.
 

Thread Starter

G0JLB

Joined Sep 23, 2007
13
Hi
Thank you for your reply
The power requirements of each slave PCB is well within my limits.
The main reason I was going to switch power to each slave in turn was to allow me to talk to each slave in turn to make sure it is there and then assign it an ID for its address.
This is because the user may plug in any number of slaves at any time from 1 to 32. These could be plugged in, in any order. Each slave will not have an ID when purchased (or maybe 0). A user could possibly plug in up to 32 new slaves. I then want the master to search th bus and assign each slave with an ID from 1 to 32. These also need to be in physical order from the 1st on the bus to the last. I thought that I could do this by powering up each one in turn under the control of the master.
I hope this makes sense.
Regards
Paul
 

beenthere

Joined Apr 20, 2004
15,819
I would think you could set up each slave to transmit it's ID when the wake-up signal arrives. I would be iffy about shutting down and powering up for each transmission because most failures typically occur at those times.
 

Thread Starter

G0JLB

Joined Sep 23, 2007
13
Hi,

Thanks for yuor reply.

I do agree with you about powering each slave in turn just to do a search and as you say this is normally when failures happen. The problem is that when each slave is new and fitted to the system it will not have an ID or perhaps a default ID of 0

So when a number of new slaves are fitted to the system I need to do a search and assign each slave an ID from 1 to 32. If I send a wake up to all slaves for them to request an ID from the master I will end up with bus conflicts as all slaves respond.

I suppose I could have each slave with a default ID of 0 but make sue that only one new slave is fitted at a time. The master could then detect any new slaves and assign an ID. But this would not detect where it physically is on the bus. eg which order from 1 to 32.

Thats the rason why I thought of powering up each slave in turn then I would know where the slave is on the bus and assign an accending ID from 1 to 32.

Anyway, back to the drawing board I think.

Thanks

Paul
 
Top