Here is a simple serial LCD and 8 key user I/O designed to interface with a robot or other projects with TTL level serial capability. The basic board is simple enough to interface with a robot or other project without the Radio Shack project box enclosure. The board is designed so that the serial interface can also be used for in circuit programming using a normal PIC programmer. The board uses only 2 IC’s, a PIC 16F628 using internal RC clock and a parallel to serial 74LS165 chip for the 8 button key interface. Three pins of the PIC are still available for use. B1 and B2 are a hardware USART and could be used for RS232 with a MAX232 IC. A7 could be connected to a external clock for higher speed.
The prototype was made with a CNC and all the files are available in DanCad’s format for those who use this motion control code. Also some of the files are in HPGL plotter file and DXF for possible CNC use. The project box holes and panel cut out on the “bottom” of the box were with a .125” end mill. The “top” was with a .089” drill for the taped 4-40 mount holes for the control board. The contrast pot hole was enlarged more with a bigger drill by hand on a drill press. The buttons are activated by using 6-32 pem nuts going through the holes milled in the case. 6-32 button head screws then hold the pems in place and look very nice on the out side as push buttons. The pem nuts slide in and out of the case to make contact with the PC board mounted buttons.
The LCD and IO board is enclosed in a Radio Shack 6”X2”X1” project box
part #270-1804.
Be sure to note that there are 6 jumper wires. Use the text side to see where each of the wires go when assembling.
The push buttons are PC board mount right angle type.
Resistors R1 to R8 are 10K ohm 1/8 watt for pull-ups for the buttons. The spacing is really close but with care in staggering them back and forth its possible to position them so there will be no shorts.
R9 is 1K ohm to help protect the TX line from a short.
R11 is 10K ohm is used to keep B4 from causing problems during ICSP (In Circuit Serial Programming).
R12 is 22K ohm is to keep the RX line from floating to a unknown state.
C1 is .1uf ceramic cap.
The headers for installing in the project box were right angle, normal straight headers will work fine for the board if it's directly installed in a robot project.
The LCD in this case was a 2 X 20 character. Up to a 4 line display can be used. This particular LCD module is the Sunlike model SC2002A. However any module that uses the Hitachi HD44780 LCD control IC will work. Just make sure the pin out’s is in agreement with the control board header.
The board may have the traces too close for home iron on transfer and etch methods. However mail order board houses should have no problem. Perhaps someone could run a few extra off for others when having other boards made and have some PC board space left over?
When clicking on the file names be sure to Left click, and Save As, most of the files are text files and if you Right click them most web browser's will simple show you the contents.
Files to make your own boards via home etch or mail order board service.
LCDKEYIO.LYT is the Cadpak layout file. Very old DOS program if you have a copy you could look and modify the design if you want.
LCDKEYIO.CPR is a HPGL plotter file. You can use this file to print out on any drawing program such as CoreDRAW or PhotoShop for photo etch resist of the copper side.
LCDKEYIO.TXT is a plotter file of the text side of the board.
LCDKEYIO.C10 is a Gerber file of the copper side, used by PC board shops to produce PC boards.
LCDKEYIO.C1 is a Gerber file of the top side copper in case you have to use double sided PC boards.
LCDKEYIO.DRL is a Excelon drill file, standard for the PC board industry for drilling all the holes.
LCDKEYIO.INF is a file to tell the mail order PC board shop how big to make the pads and traces.
DanDad Files for making the board on a CNC.
LCDKEYIO.OUT is the mechanically mill out of the copper side if you have a CNC.
LCDKEYIO.ENG is the side to mechanically cut the text side of the board.
LCDKEYIO.HED is the drill file to drill .032” holes for the headers, IC’s and passive components.
LCDKEYIO.BTN is the drill file to drill .050” holes for the push buttons.
LCDKEYIO.MNT is the drill file to drill .125” holes to mount the boards.
DanDad Files for cutouts for the module enclosure on a CNC.
LCDPANL.OUT is a file to mill out the holes for the LCD display .125” end mill, assuming your LCD is of a similar design.
LCDMODBK.MNT file for .089” drills for mounting the control board.
LCDBNT.OUT .125” end mill to cut out the holes on the “side” top of project box for the push buttons.
Files for more standard CAD systems, to perhaps convert for use in a G code CNC.
LCDKEYIO.DXF is the copper side, should be able to import in AutoCad or other CAD programs.
LCDKEYTX.DXF is the text side in DXF file format.
Photo above is of the finished module board and box enclosure before
assembly.
The back of the finished LCD module with the Radio Shack AAA battery box. This type of battery box is handy because the power switch is build into the box. Also the battery box is held with Velcro, so by shifting it up it makes the module tilt for easy viewing on a table.
Pic Basic Pro demo program
Here is a simple program for the board, LCDMOD.PBP , which is written in Pic Basic Pro. Also included are the assembler and HEX files. If you don’t have Pic Basic and want to write a program for the board in Pic Basic, a free on the Web service is available where you can write the code and download the results. The web address is www.CompileSpot.com/ .
LCDMOD.PBP file can be read by any text editor or word processor
LCDMOD.ASM assembler file generated by PBP, for those folks that like working in assembly
LCDMOD.HEX is the file to download into the pic
The program and the setup of the LCD saves pins by loading the bytes into the LCD in 2 separate nibbles thus using only ½ the data lines.
Pinouts for I/C's and Plugs
LCD header
Pin # Pin Name Function
1 Ground
Ground
2 +5 volts
Power
3 Vee
Contrast
4 RS
Register Select
5 R/W
Read / Write
6 E
Enable
7 D0
Data bit 0
8 D1
Data bit 1
9 D2
Data bit 2
10 D3
Data bit 3
11 D4
Data bit 4
12 D5
Data bit 5
13 D6
Data bit 6
14 D7
Data bit 7
ICSP header with TTL serial via same plug
Pin 1 ground
Pin 2 HV ser program init
Pin 3 ICSP pgrm clock or TX to host for LCD key serial from pin
B6
Pin 4 ICSP prgm DATA or RX from host for LCD key serial to pin
B7
Connections For Pic 16F628
Pin # Pin Name Connection
1 A2 LCD pin 13 Data bit 6
2 A3 LCD pin 14 Data bit 7
3 A4 LCD pin 4 Register Select
4 A5 High Voltage Program ICSP pin 2
5 Ground
6 B0 74LS165 pin 1 SH/LD Shift
Load
7 B1 Unused but with pad possibly for
hardware RX serial I/O
8 B2 Unused but with pad possibly for
hardware TX serial I/O
9 B3 LCD pin 6 Enable
10 B4 74LS165 pin 15 Clock Inhibit
11 B5 74LS165 pin 2 Clock
12 B6 ICSP & TTL serial header pin 3 Program
Clock or TX com
13 B7 ICSP & TTL serial header pin 4 Program
Data or RX com
14 +5 volts
15 A6 74LS165 pin 9 QH
16 A7 Unused but with pad possibly for external clock
17 A0 LCD pin 11 Data bit 4
18 A1 LCD pin 12 Data bit 5
When a button is pushed, a bit value is produced. The pattern doesn't have a particular arrangement. However as long as you know what value is produced you can have your program respond to the activity the button is assigned to.
Bare board only, button # 1
2 3
4 5
6 7
8
Bit Value out
247 251 253
254 127 191
223 239
Box enclosure, button #
1 2
3 4
5 6
7 8
Bit Value out
239 223 191
127 254 253
251 247
Have fun with your new display I/O module!
- Edward Rupp
Loveland Colorado USA