create Bus for 1040 microcontroller

danics
Hi all!

i m a beginner in FriendlyArm and i want to know how can i create a Bus
system for connect 1040 Avr or PIC microcontrollers to my Friendly Arm
whats your idea , you think i must use RS485 or another system please guide
me?

my big project is control of opening and closing 1040 doors that every door
have a serial number and my user enter door number and his password to open
his door.what system is better here, my distance from doors is at most 20
to 30 meters thanks alot.

andrés barré
you can use protocol of 9 bits serial . using the ninth active bit when it
is direction. and deactivating to send the data corresponding to which you
finish indicating in the direction. thus you can. to both use first bytes
of the chain to send with the ninth active bit. " 65535 devices " 0000,
until FFFF

andrés

davef
1040 doors within 20 to 30 metres radius?  RS485 seems reasonable.  Maybe,
search <ModBus> to see that is appropriate.

Play close attention to how the system is wired and how the individual
units are terminated (for RS485).

Vladimir Fonov
How about ethernet? Then you can use commonly available hubs, switches etc.


Something similar to this: ATMEGA32u4 + ENC28J60 : 
http://code.google.com/p/uhttpd-avr/

andrés barré
MODBUS, is very interesting… only that has a limitation. it only allows to
accede to 63 directions. then nonserious the recommended thing to work with
1044 directions. , . 


but the base of modbus as protocol is very good. you use it adapting it to
9 bits. using the ninth bit like flag to indicate. directions active flag.
instructions deactivated flag .

danics
Hi everybody thanks a lot for your answers, my project is opening of
deposit safe boxes in Bank ,i want to ask if i don't use 1040
microcontrolers whats the best option to open and close the doors with low
cost wiring ,i cant use wireless too. thanks again

Sanish P S
No need to use each MCU for each unit. Just group each MCU to multiple door
units. for ex. pic16f877 have more than 30 IO pins. connect each door
control unit to each pin with unique ID. Pic16f877 also have 9bit master/
slave communication feature using USART. Use this feature, and for
communication data bus you can use RS485 protocol. For it use MAX485(half
duplex), or MAX488,MAX490(full duplex) hardware chip.

danics
thanks Sanish but how can i be sure that doors is open?

Sanish P S
For controlling each door u can use relay controlled circuit. and for
monitoring each one you have to provide a door monitoring circuit consists
of door sensors(ex.hall effect sensor). so at least 2 pins needed for a
single door unit one for controlling and one for monitoring. 

Combining these two we will get a close loop connection.

andrés barré
if you can use Hall effect sensors, and can use at89c51ed2 plcc68. it has
two doors extra of eight 8051 bits that normal. besides owning, as far as
wirless. you can use Xbee in way API is very safe. There are two models
that work to 2.4ghz normal and pro the pro has but of power in RF besides
being able to form it like stad alone to digipiter to extend the network if
it is necessary