'This is a self contained SPI output demo. 'It runs a 16x1 display (Optrex DMC-16117A or equivalent). I do not detail how to run 'an LCD. This is covered in other examples here and elsewhere. It should run other 'displays with appropriate adjustments to InitLCD and LCDdata. 'Besides the display, a 74HC595 is used to convert serial to parallel data. 'The hookup uses NO standard BX24 pins, only the empty holes at the ends of the board. 'Soldering to these holes is unavoidable SO ONLY DO THIS IF YOU KNOW HOW TO SOLDER. 'I am not responsible for your errors in implementing this demo. If you mess up, you 'may not be able to access the eeprom - this is otherwise known as a dead bug. 'The BX24 is assumed to be running with power and a download cable. I won't disscuss 'those connections. Refer to the Hardware Reference Manual, especially to the chip 'pin descriptions. 'The 74HC595 is connected as follows: 'Pin: Other end of wire: ' 1 Display pin 8 ' 2 Display pin 9 ' 3 Display pin 10 ' 4 Display pin 11 ' 5 Display pin 12 ' 6 Display pin 13 ' 7 Display pin 14 ' 8 GND ' 9 no connection '10 +5 '11 SCLK (3rd from right at pin 1 end of BX24) '12 P25 of BX24 (right most of 3 in middle of pin 12 end) '13 GND '14 MOSI (3rd from left at pin 1 end of bx24) '15 Display pin 7 '16 +5 'The display pins not already mentioned are connected as follows: 'Pin: Other end of wire: ' 1 GND ' 2 +5 ' 3 Contrast adj. 5K pot with ends at +5 and GND and wiper to this pin. ' Grounding this pin gives legible but not perfect contrast. ' 4 BX24 P27 (left most pin in middle of pin 12 end) ' 5 GND ' 6 BX24 P26 (middle pin at pin 12 end) const LCDrs as byte=27 'selects data or command for LCD const LCDe as byte=26 'E clock to LCD const LCDoe as byte=25 'data strobe for 74HC595 dim temp1 as string dim chrs as string Sub Main() Call InitLCD Do chrs="This is a test." Call LCDstr(chrs) Call Delay(1.0) chrs="So is this." Call LCDstr(chrs) call Delay(1.0) Loop End Sub Sub InitLCD() Call OpenSPI(1,0,LCDoe) Call Putpin(LCDe,0) Call Putpin(LCDrs,1) Call Delay(0.015) Call LCDcmd(bx00110000) Call Delay(0.0041) Call LCDcmd(bx00110000) Call Delay(0.0001) Call LCDcmd(bx00110000) Call LCDcmd(bx00110000) Call LCDcmd(bx00001000) Call LCDcmd(bx00001100) Call LCDcmd(bx00000001) Call LCDcmd(bx00000110) End Sub Sub LCDdata(byval chr as Byte) dim dummy as byte Call SPIcmd(1,1,chr,0,dummy) Call Putpin(LCDe,1) Call Putpin(LCDe,0) Call Putpin(LCDrs,1) End Sub Sub LCDcmd(byval chr as Byte) Call Putpin(LCDrs,0) Call LCDdata(chr) Call Delay(0.0017) End Sub Sub LCDstr(chrs as string) dim temp as byte dim i as integer dim j as integer Call LCDcmd(bx00000001) j=1 For i=1 to Len(chrs) temp1=Mid(chrs,i,j) temp=Asc(temp1) Call LCDdata(temp) Next End Sub