M Asim Khan, asimkhan@sat.net.pk
Build a simple 9600 BAUD 8n1 LCD terminal for debugging and testing the projects having RS232C output.
This LCD terminal provide two modes of operation by selecting jumper J1. When J1 is open the terminal operate as a normal ascii display terminal, when J1 is closed the terminal displays the input serial data in hexadecimal format. This mode is useful for viewing raw data from the serial port output.
IntroductionHardware
Figure 1 shows the circuit diagram of the Easy Debugging Terminal. IC U2 a PIC16F84 micro controller is used to control the operation of the terminal. Input signal is applied to connector K1. The circuit can be powered either by 9V dc adapter or by using a 9V battery. Jumper J1 select the operating mode of the terminal, J1 open for ascii terminal mode, closed for hexdecimal display mode. LED D3 can be controlled by software command provided in ascii mode. This LED output can also be used (with buffer circuit) to control the backlight of the LED backlit display. Variable P1 is used to adjust the contrast of the display. The circuit uses a 16x2 line LCD module, while a 16x1 module can also be used.
Figure 1: Circuit Diagram of Easy Debugging Terminal
Constructing the Circuit
The prototype board may be built using universal PCB having the same size as of LCD module so that LCD module can be mounted on top of universal PCB using SIP connectors.
For the parts list of the circuit view the file Lcdbom.txtSoftware
The software of the project was developed using PIC C compiler from CCS. The source code of the project is available in the file Lcd_Dtm.c, there are two types of hex files are available Lcd_Dtm.hex is used for 16x2 lines LCD module, while Lcd1.hex is used for 16x1 line LCD module. The user can easily modify the source file for other types of Lcd modules.Following software commands are available when using the terminal in ascii mode.
Clear display 0x0C
Go to start of first line 0x0D
Go to start of second line 0x0A
Move back one position 0x08
Turn on LED 0x0E
Turn off LED 0x0FIt is better to use a delay of 100 usec after sending commands to the terminal except for the clear display command which will require a minimum delay of 2 msec. Also after power up a delay of 120 msec is required before sending the commands or data to the terminal.
This Debugging Terminal was designed by M Asim Khan. Revised 11-nov-2000
Any bug reports or suggestion of using the Debugging Terminal are welcome.