摘要 |
A method for controlling a UART(Universal Asynchronous Receiver/Transmitter) is provided reduce a GPIO(General Purpose Input Output) terminal by enabling a receiving data pin to interrupt a controller to be awakened from a sleep mode. A method for controlling a UART includes the steps of: when a controller(20) and a bluetooth module(24) are connected, checking whether a receiving interrupt occurs for a predetermined time at a UART(22) of the controller(20); when the receiving interrupt does not occur in the bluetooth module(24) for the predetermined time, disabling a clock of the UART(22); when the controller(20) transmits data to the bluetooth module(24), enabling the clock of the UART(22) to transmit data; and when the UART(22) is disabled, operating the controller(20) in a sleep mode, and when a receiving data pin of the UART(22) is in a low state, interrupting the controller(20).
|