Confused

Discussion about the ZBasic language including the System Library. If you're not sure where to post your message, do it here. However, do not make test posts here; that's the purpose of the Sandbox.
Post Reply
dlh
Posts: 395
Joined: 15 December 2006, 12:12 PM
Location: ~Cincinnati

Confused

Post by dlh »

From DefineCom in the current documentation:
If the specified channel is a hardware UART (e.g. Com1), the rxPin and txPin parameters must both be zero. Otherwise, if they are valid, the pins specified by rxPin and txPin are automatically configured as input and output, respectively. However, if the rxPin and txPin parameter values are equal and non-zero, the pin is initially configured as an input to support half-duplex, bussed operation. In this mode, the the pin will be made an output when transmitting a zero bit if configured for non-inverted operation or when transmitting a one bit if configured for inverted operation. A pull-up resistor (noninverted mode) or pull-down resistor (inverted mode) is required for bussed operation since the pin will only be actively driven in one of the two output states.
:? Does otherwise refer to hardware UART or to non-zero rxPin & txPin?

If I use a software channel for inverted TX only with TTL levels, do I need a pull-up?
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: Confused

Post by dkinzer »

dlh wrote:Does otherwise refer to hardware UART or to non-zero rxPin & txPin?
Stated differently, for a HW UART, both pins must be zero. For a software UART, at least one of the pins must be non-zero and the non-zero pins will be prepared for input or output as appropriate.
dlh wrote:If I use a software channel for inverted TX only with TTL levels, do I need a pull-up?
For the ZX itself, you don't need a pullup/pulldown on the TX line but it might make sense to add one if the receiving device will be confused by the TX line floating during reset and continuing until the OpenCom() is executed. We recommend a pullup/pulldown on the ZX receive pin to avoid reception of spurious characters during times when the line *might* be floating.
- Don Kinzer
Post Reply