Page 1 of 1
Communication betewwen Zx24 and Zx1281 question
Posted: 13 May 2010, 9:55 AM
by hakha4
I have a project with multiple relay's,sensor's and Ds1820's for reading temp's. I want to offload the Zx1281 from reading temp's since it takes quite a lot of time for conversion and use a Zx24 for that job. On demand I then get temp stored in variable's from zx24. I want to use Com1 on zx24 to communicate to a port on Zx1281. I'm a bit confused about the hardware bit. Can Com1 on zx24 ('slave') communicate directly without converting to Rs232 to my 'master' micro ? If conversion is a must what method is easiest and reliable ( I've seen suggestions using 74hc04,just resistors or Max232)
Any help is appreciated
Regards Hucke
Re: Communication betewwen Zx24 and Zx1281 question
Posted: 13 May 2010, 10:33 AM
by dkinzer
hakha4 wrote:Can Com1 on zx24 ('slave') communicate directly without converting to Rs232 to my 'master' micro ?
Whenever you want to connect two devices using asynchronous serial communication you have to ensure that the signals are compatible. This includes
- ensure that the signals have compatible logic level (i.e. 0 to Vcc or +V to -V)
- ensure that the signals are the same logical sense (inverted or non-inverted)
- ensure that the UARTs are configured for the same baud rate, number of data bits, parity, number of stop bits, etc.
Your question, I believe, relates to the first two items.
On all 24-pin ZX devices, the Com1 signals are inverted and have a voltage range of 0 to Vcc. If you want to connect those signals to a "software UART" port on the ZX-1281, you could connect the ZX-24 Com1 signals directly to the ZX-1281 pins but you would need to configure the software UART on the ZX-1281 to use inverted mode. If you prefer, you could also use external inverters and configure the software UART for non-inverted mode. Direct connection at "TTL" levels should work reliably over short distances (up to a few feet) in a relatively "quiet" environment. The noisier the environment, the shorter the maximum distance.
If you want to connect two devices that are farther apart (perhaps up to a few hundred feet) you would need to use RS-232 level converters on each end. (Since level converters generally invert, the end-to-end result is no inversion.) For even longer distances, RS-485 would be more appropriate.
Posted: 13 May 2010, 11:07 AM
by hakha4
Thank's. Is schematic below correct for noninverted mode ?
Posted: 13 May 2010, 11:23 AM
by dkinzer
hakha4 wrote:Is schematic below correct for noninverted mode ?
There isn't enough information to say for certain. If the ZX-24 pins are 1 (Tx) and 2 (Rx) and the pins on the ZX-1281 are SW UART pins, then you would configure the SW UART for non-inverted mode. It would also work if the ZX-1281 pins are HW UART pins (directly connected, no inverters or level shifters).
Are you using a ZX-1281, ZX-1281n, ZX-1281e or ZX-1281ne?
Posted: 13 May 2010, 11:49 AM
by hakha4
I'm using ZX-1281e . In schematic Pin1 = Tx and pin 2 = Rx on ZX-24. Com1 on ZX-1281e is used for communication with a pc so I'll use either a SW Comport or HW Com 2 to communicate with Zx-24p. Did I understand You right ? If using HW port2 I get non-inverted mode without the 74Hc04?
Posted: 13 May 2010, 12:03 PM
by dkinzer
hakha4 wrote:If using HW port2 I get non-inverted mode without the 74Hc04?
Hardware UART channels are always non-inverted
except for Com1 on the 24-pin ZX devices. Except for the USB devices, Com1 on Oak Micros ZX devices is inverted with RS-232 levels but in most cases there is access to the TTL level (non-inverted) signals.
With the external inverters on the ZX-24 Com1 signals, you'll have non-inverted signals at the ZX-1281. Consequently, you can connect them directly to the HW UART pins (which are never inverted) or to the pins for a SW UART configured for non-inverted mode.
Posted: 13 May 2010, 13:28 PM
by mikep
hakha4 wrote:I'm using ZX-1281e . In schematic Pin1 = Tx and pin 2 = Rx on ZX-24. Com1 on ZX-1281e is used for communication with a pc so I'll use either a SW Comport or HW Com 2 to communicate with Zx-24p. Did I understand You right ? If using HW port2 I get non-inverted mode without the 74Hc04?
If you are using a ZX-24P then you can connect COM2 on the ZX-24P to COM2 on the ZX-1281e without the need for any inverters.
<<Fixed negation as noted by Don below>>
Posted: 13 May 2010, 14:19 PM
by dkinzer
mikep wrote:If you are using a ZX-24P then you cannot connect [...]
Did you mean
can connect? I believe that the statement would be correct with that change.
Posted: 14 May 2010, 7:18 AM
by hakha4
Thank's for help,I think I've got the idea now.
Regards Hucke