Mike, K8LH
- 20th September 2009, 16:23
Someone on another Forum asked me if it's possible to use the LCDOUT function with my old Novelty Serial LCD Interface (a simple 1-pin interface experiment inspired by the Predko 2-pin shift-register interface).
http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3655&d=1253458266
The interface uses standard Async' Serial data but in a rather exotic format where each byte is sent as two bytes, one nybble per byte, along with the LCD 'RS' bit.
;
; host low level K8LH Novelty 12F635 Serial LCD Driver
;
LcdCmd
clrc ; C = RS = 0, 'command' |B0
skpnc ; |B0
LcdDat
setc ; C = RS = 1, 'data' |B0
movwf Temp ; save data in WREG |B0
swapf Temp,W ; swap nybbles -> WREG |B0
call LcdNyb ; send left nybble |B0
movf Temp,W ; send right nybble |B0
LcdNyb
andlw 0x0F ; mask off left nybble |B0
skpnc ; RS = 0? yes, skip, else |B0
iorlw b'11000000' ; set the RS bits |B0
btfss PIR1,TXIF ; transmit buffer empty? |B0
goto $-1 ; no, branch, else |B0
movwf TXREG ; send byte |B0
return ; |B0
Can the LCDOUT function use a custom driver like the one above (after being upgraded to catch the special $FE character)?
Kind regards, Mike
http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3655&d=1253458266
The interface uses standard Async' Serial data but in a rather exotic format where each byte is sent as two bytes, one nybble per byte, along with the LCD 'RS' bit.
;
; host low level K8LH Novelty 12F635 Serial LCD Driver
;
LcdCmd
clrc ; C = RS = 0, 'command' |B0
skpnc ; |B0
LcdDat
setc ; C = RS = 1, 'data' |B0
movwf Temp ; save data in WREG |B0
swapf Temp,W ; swap nybbles -> WREG |B0
call LcdNyb ; send left nybble |B0
movf Temp,W ; send right nybble |B0
LcdNyb
andlw 0x0F ; mask off left nybble |B0
skpnc ; RS = 0? yes, skip, else |B0
iorlw b'11000000' ; set the RS bits |B0
btfss PIR1,TXIF ; transmit buffer empty? |B0
goto $-1 ; no, branch, else |B0
movwf TXREG ; send byte |B0
return ; |B0
Can the LCDOUT function use a custom driver like the one above (after being upgraded to catch the special $FE character)?
Kind regards, Mike