Connecting several Zn-328n

Discussion specific to the DIP and TQFP packaged ZX devices like the ZX-40, ZX-44, ZX-32 and ZX-328 series. The differences between these devices is primarily the packaging and pinout so most issues will apply to all devices.
Post Reply
vesteve
Posts: 3
Joined: 09 October 2009, 4:40 AM
Location: Spain
Contact:

Connecting several Zn-328n

Post by vesteve »

How I can connect several Zn-328n?
I have a Zn controlling a machine with it PCB in each machine.
Now I must to connect all machines (60 machines) to a PC.
Pc must send/receive signals to power On the machine and receive data about the machines sensor and control I/O
How I can add an address to differentiate the orders from one machine to another one?
Which method I must use to communicate with all machines? RS232?
Or I must to use another Processor model.

Thanks
mikep
Posts: 796
Joined: 24 September 2005, 15:54 PM

Post by mikep »

RS-232 is a point to point network i.e. 2 machines communicate. What you need is a bus network where multiple devices (including the PC) can share a common bus. Bius networks either have one master (e.g. the PC) and multiple slaves or can have multiple masters. Common examples of bus networks are I2C, RS485, CAN, LIN, and Ethernet.

If the machines are very close together then you could see I2C. More than likely they are tens if not hundreds of feet apart. RS485 is generally simpler and easier than CAN, LIN or Ethernet. There is a RS485 application note for ZBasic devices.

I2C can have up to 128 addresses and RS485 can have 254. The master talks to the slave using its address. Each slave is assigned (hardwired) with a unique address.

You could also use a wireless network such as Zigbee. Note that RS485 interface chips cost $0.50 and Zigbee costs tens of dollars.
Mike Perks
stevech
Posts: 715
Joined: 22 February 2006, 20:56 PM

Post by stevech »

I would think that those machines have Ethernet connectivity.
If only RS232, then an RS232 from Ethernet per machine, or a terminal server that does ethernet to 8 or 16 RS232 would do. Boxes that do this are on eBay used, such as Lantronix, Digi/Edgeport, and many others. Blackbox makes a lot of these. Moxa Nport too.

(postscript: The earlier comment on ZigBee: I preach that ZigBee and IEEE 802.15.4 are two different beasts, as TCP is not IP is not Ethernet). I would never suggest using of wireless of any kind if it's practical to use wire.
dlh
Posts: 395
Joined: 15 December 2006, 12:12 PM
Location: ~Cincinnati

Post by dlh »

Mike's RS485 app note says only 32 nodes for RS485. This actually depends on the chip used and some allow 256.

There's an excellent article on RS485 at At the PC you need an RS232 to RS485 adapter. B&B Electronics is one source. They also have good white papers on RS485.
Post Reply