Serial Ports and Power Management

The power requirements of a standard serial port can be significant. This topic describes the issues that can result from this.

The NS16550 UART, which is the standard component used for the serial ports on a PC, supplies a small 5.25V to the DTR and RTS modem control lines, which can draw up to 160mA each. The device is rated at 1W. Mobile device serial ports have to provide the same functionality, and can potentially draw a lot of power.

In order to conserve battery power the serial hardware is switched off until the port is actually used. To use a port a request is made to read from it or write to it. This means that even if the modem control lines have been explicitly set high (using RComm::SetSignals()), neither RTS nor DTR have been asserted when the call completes.

A situation could arise where deadlock occurs. A deadlock can be created when a remote device plugged in to a mobile device serial port is waiting for one of the remote device's input lines to go high before asserting the remote device's outputs, and an application on the mobile device is waiting for activity at the serial port before powering the port up.

The way to avoid this deadlock occurring is for the application to power the port up by issuing a dummy read or write request for zero bytes as soon as the port has been opened.