AN510 |
|
Product: Domino 1 and 2 |
|
Using P1.7 to Print |
Date: 10/3/00 |
Introduction: The Domino 1 and 2 has 1 full-duplex serial port and one half-duplex serial printer port. Both ports are programmable. The pins to access the full-duplex serial port are labeled Tx-, Tx+, Rx-, and Rx+. The P1.7 pin is the half-duplex and is only used to transmit serial data. |
|
Background: Having the ability to print serial data out P1.7 can be very useful when using more than one serial device. The Domino could be networked using RS485 and still have the ability to print to an RS232 Serial LCD. |
|
How it works: Since the P1.7 pin is shared with the ADC and I2C bus there needs to be a way to break the connection to the serial device that P1.7 is printing to or the serial device will get confused whenever the ADC and I2C bus is accessed. A great way to accomplish this is to use a 75176 driver chip. The following schematic demonstrates how to connect the chip to a Domino 1 or 2. The program in the Program Listings section takes a reading of ADC0 and prints the conversion count out P1.7 at a baud rate of 9600. The Domino sets P1.4 when ever it prints out P1.7. When the Domino is not printing out P1.7, P1.4 must be cleared thus disabling the driver. The program demonstrates this by printing out on P1.7 in line 160 while P1.4 is low. The following text is what gets printed out on the serial printer port. ADC0's conversion count is 389 ADC0's conversion count is 389 ADC0's conversion count is 389 ADC0's conversion count is 389 ADC0's conversion count is 389 As you can see "Demonstrating that the driver is disabled." never gets printed to the serial device. |
|
Program Listing: 10 REM *** This program demonstrates how to print out |