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
20 REM *** on the serial printer port (P1.7).
30 REM *** Setting P1.7's baud rate to 9600
40 BAUD 9600
50 REM *** Taking a reading on ADC0
60 CALL 0F000H
70 POP C
80 REM *** Setting Domino's P1.4 high to enable the driver,
90 REM *** while masking PORT 1.
100 PORT1 = PORT1.OR.10H
110 REM *** Printing ADC0's conversion count out P1.7.
120 PRINT#"ADC0's conversion count is",C
130 REM *** Setting Domino's P1.4 low to disable the driver,
140 REM *** while masking Port 1.
150 PORT1 = PORT1.AND.0EFH
160 PRINT#"Demonstrating that the driver is disabled."
170 GOTO 60