08M & LCD?

SD2100

New Member
Yes have a look at <A href='http://www.rev-ed.co.uk/docs/axe033.pdf' Target=_Blank>External Web Link</a>

 

thelabwiz

Senior Member
If you have a serial interface board (sample: <A href='http://www.picaxe.us/9600-baud-lcd.html' Target=_Blank>External Web Link</a>), you can drive almost any LCD display that uses the HD44780 controller chip.

John

 

picaxester

Senior Member
I use a 74hc164 shift register. It's cheap but it uses 3 pins to run it and something like 30 lines of code:

init:
let b0 = 0
gosub shft
low 1 'DATA(74hc164)/RS(LCD)
low 4 'ENABLE (LCD)
pause 200
let b0 = 56
gosub wrins
pause 10
pulsout 4,1
return

wrchr:
gosub shft
high 1
pulsout 4,1
return

wrins:
gosub shft
low 1
pulsout 4,1
return

shft:
for b1 = 0 to 7
low 1
if bit7 = 0 then zero
high 1
zero: pulsout 2,1 'CLOCK(74hc164)
b0 = b0 * 2
next b1
return

eric
 

wilf_nv

Senior Member
This circuit uses just one output pin to control a parallel type LCD and two auxillary outputs with just one chip or more auxilary outputs using two chips.
<A href='http://www.user.dccnet.com/wrigter/picaxe/1wire_LCD_Controllers.gif ' Target=_Blank>External Web Link</a>

The two versions show examples of a 4 bit and an 8 bit interface.
The 100K pots were used during development to fine tune the decoding of the PWM data/clock signal. They can be replaced with fixed 5% resistors values as the timing is relatively non-critical.


Edited by - wilf_nv on 04/01/2007 09:08:33
 

w7ky

New Member
Thank you for all the information and code. I've just ordered a display &amp; driver board from 'wulfden' and will be able to experiment in a couple days. w7spy
 

wilf_nv

Senior Member
<i>
picaxeter penned:

do you have more info on circuit? </i>

Here is an updated schematic for expanding a picaxe 08M using one wire with a LCD interface and six auxilary outputs.

<A href='http://www.user.dccnet.com/wrigter/picaxe/1_wire_LCD2.gif' Target=_Blank>External Web Link</a>

The 1 wire 15 bit SPI design has sufficient number of output pins to control a character type LCD in the 8 bit mode to optimize for speed and simplified code.

It uses an novel LCD control interface that generates the E signal automatically at the end of the 16 bit &quot;shiftout&quot; routine.

The listing below includes typical LCD initialization and displays a short message on a 2 line LCD.

<code><pre><font size=2 face='Courier'>

'08M 1 WIRE LCD CONTROLLER
'wilf rigter (c) Jan 12, 2005

SYMBOL get = b9
SYMBOL byte = b10
SYMBOL dataOut = b11
SYMBOL bitNumber = b12
SYMBOL pulse_width = b13
SYMBOL PWMDATA= 1 ; Pin1 1 Wire Dataline
SYMBOL xword = w0 ; hexport word
SYMBOL xlbyte = b0 ; hexport LSB
SYMBOL xhbyte = b1 ; hexport MSB


PowerOnReset:

Initialise_hexport:

xword = 00 ; 595 Output Register STARTUP
state
HIGH PWMDATA ; initialize PWMDATA state
PULSOUT PWMDATA,10 ; initialize 595 Shift
Register
GOSUB SendPulseData ; now update 595 Output
Register

PAUSE 200

GOSUB InitialiseLcd

; User Program Here

DisplayTopLine:

EEPROM 6,(&quot;HELLO WORLD! HELLO LCDPORT! &quot;)

FOR get = 6 TO 17
READ get,xlbyte
GOSUB SendDataByte
NEXT


MoveCursorToStartOfSecondLine:

xlbyte = 192
GOSUB SendCmdByte

DisplayBottomLine:

FOR get = 19 TO 37
READ get,xlbyte
GOSUB SendDataByte
NEXT


END

InitialiseLcd:

FOR get = 0 TO 3
READ get,xlbyte
GOSUB SendInitCmdByte
NEXT
; LCD Configuration
EEPROM 0,( $38 ) ; %001LNF00 2 Line Display
EEPROM 1,( $0C ) ; %00001DCB Display On
EEPROM 2,( $06 ) ; %000001IS Cursor Move

EEPROM 3,( $01 ) ; Clear Screen

RETURN

SendInitCmdByte:

PAUSE 15 ; Delay 15mS

SendCmdByte:

bit14=0 ; Send to Command register

SendDataByte:

GOSUB SendPulseData
bit14 = 1 ; Send to Data register next
RETURN

SendPulseData:

; xword / xhbyte

pulse_width=1 ; START = bit 15
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit14 ; LCD RS BIT
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit13 ; aux output 6
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit12 ; aux output 5
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit11 ; aux output 4
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit10 ; aux output 3
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit9 ; aux output 2
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit8 ; aux output 1
PULSOUT PWMDATA,pulse_width

; xword / xlbyte

pulse_width=2 - bit7 ; LCD DATA MSB
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit6
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit5
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit4
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit3
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit2
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit1
PULSOUT PWMDATA,pulse_width
pulse_width=2 - bit0 ; LCD DATA LSB
PULSOUT PWMDATA,pulse_width ; Update both 74HC595 outputs
PULSOUT PWMDATA,10 ; LCD E pulse and clear 595s

RETURN
</font></pre></code>

----------end of listing--------------

The 4 bit LCD version is shown here:

<A href='http://www.user.dccnet.com/wrigter/picaxe/1_wire_LCD5.gif' Target=_Blank>External Web Link</a>



Edited by - wilf_nv on 06/01/2007 20:54:52
 
Top