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
Communication betewwen Zx24 and Zx1281 question
Re: Communication betewwen Zx24 and Zx1281 question
Whenever you want to connect two devices using asynchronous serial communication you have to ensure that the signals are compatible. This includeshakha4 wrote:Can Com1 on zx24 ('slave') communicate directly without converting to Rs232 to my 'master' micro ?
- 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.
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.
- Don Kinzer
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).hakha4 wrote:Is schematic below correct for noninverted mode ?
Are you using a ZX-1281, ZX-1281n, ZX-1281e or ZX-1281ne?
- Don Kinzer
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.hakha4 wrote:If using HW port2 I get non-inverted mode without the 74Hc04?
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.
- Don Kinzer
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.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?
<<Fixed negation as noted by Don below>>
Last edited by mikep on 13 May 2010, 17:15 PM, edited 1 time in total.
Mike Perks