| An oUSART Object uses the PIC's Universal Universal Synchronous Asynchronous Receiver/Transmitter (USART) by setting the USART's registers in the way specified by the oUSART's properties and by responding to the interrupts generated by the USART. I/O Line 22 is is configured to be an output which is used for transmitting serial data and I/O Line 23 is configured to be an input which is used for receiving serial data. The USART provides a high-speed serial communication port capable of communicating at several different baud rates. It can be configured as full duplex asynchronous or synchronous and can communicate with serial devices such as CRT terminals and personal computers. It uses the standard non-return-to-zero (NRZ) format asynchronous mode (one start bit, eight data bits, and one stop bit). The USART transmits and receives the lowest significant bit first. The USART’s transmitters and receiver are functionally independent but use the same data format and baud rate. When the USART has received new data, the oUSART Object responds by storing the new value in the Value property and setting the Received property to cvTrue. The Value property has different functions depending on whether it is being read or written. When read, it returns the last value received. When a value is written to it, the value is not stored. Instead, the value is sent serially out I/O Line 22. The Baud property specifies at which baud rate to send and receive data. It can specify a baud rate of 1200, 2400, 4800, 9600, 19200, 31500, 38400, or 50000 Baud. Setting the Baud property will not only store the value written, but also cause the USART's Baud Rate Generator to be set to the value required to generate the specified Baud Rate. When the Baud property is read, the value previously written is returned. The serial input and output signals are TTL level signals providing 0 and 5 volts. Conversion to RS232 signals can be done with a TTL to RS232 signal converter chip such as the SN75188 or the MAX203 which will provide the voltage conversion to the RS232 levels of +12 Volts and - 12 Volts as well as providing the required signal inversion. CAUTION: do not connect RS232 signals lines directly to the PIC's TTL level I/O. The higher voltage of the RS232 lines will damage the TTL level circuitry. One physical USART is implemented within the PIC. Each dimensioned instance of the oUSART Object uses the USART and thus only one instance may be active at any given time. Setting the Operate property to 1 activates an instance of the oUSART Object and will deactivate any other oUSART Objects that were previously activated. Note that the PIC's USART does not provide flow control and therefore, neither does the oUSART Object. The oSerialPort Object which uses the oUSART Object adds flow control functionality. The oSerialL Object also has flow control but it is not based on PIC Hardware. |