So, the code looks like this now:
Code:
include "16F88-FUSES.BAS"
'PIC 16F88 - 4MHz
' LCD circuitery
'23,24,25,26,32,33,34,35,40 - Vdd (+5V)
'27,38 - Vss (GND)
'31 DB0 - PORTB.0
'30 DB1 - PORTB.1
'29 DB2 - PORTB.2
'28 DB3 - PORTB.3
'39 RS - PORTB.4
'36 E - PORTB.6
'37 R/W - PORTB.7
DEFINE LCD_DREG PORTB 'LCD data port
DEFINE LCD_DBIT 0 'LCD data starting bit 0 or 4
DEFINE LCD_RSREG PORTB 'LCD register select port
DEFINE LCD_RSBIT 4 'LCD register select bit
DEFINE LCD_EREG PORTB 'LCD enable port
DEFINE LCD_EBIT 6 'LCD enable bit
DEFINE LCD_RWREG PORTB 'LCD read/write port
DEFINE LCD_RWBIT 7 'LCD read/write bit
DEFINE LCD_BITS 4 'LCD bus size 4 or 8
DEFINE LCD_LINES 2 'Number lines on LCD
DEFINE LCD_COMMANDUS 2000 'Command delay time in us
DEFINE LCD_DATAUS 50 'Data delay time in us
' Register settings
OSCCON = %01100000 'Internal RC set to 4MHZ
ANSEL = %00000000 'Disable Analogue Inputs
OPTION_REG = %01000000 'Enable PORTB pullups
ManualLCDInit:
FLAGS=2 ' Void PBP lcd initialisation... it's a nice feature !!!
PAUSE 500
Lcdout $FE, $33
Lcdout $FE, $33
Lcdout $FE, $20 ' official 4 bit mode
@ bsf LCD_EREG, LCD_EBIT
PAUSEUS 20
@ bcf LCD_EREG, LCD_EBIT
Lcdout $FE, $28 ' Function Set
Lcdout $FE, $14 ' Bias
Lcdout $FE, $78 ' Contrast set
Lcdout $FE, $5E ' Power/Icon/Contrast
Lcdout $FE, $6A ' Follower control
Lcdout $FE, $0C ' Display ON
Lcdout $FE, $01 ' Clear display
Lcdout $FE, $06 ' Entry mode Set
' --------------------------------- End LCD init!
LCDOUT $FE,1,"Line1",$FE,$C0,"Line 2"
Pouet:
Goto Pouet
end
Guess what? The display still doesn't work.
I'm waiting for AE to give some answers...
At least, have a look at how the displays look like (they're only 2mm thick). Would be really nice if something could be written on it, no? (pin 21 is on the upper right corner looking at picture PICT0001small.JPG).
Keithdoxey, it's getting clearer to me. I have to grab a piece of paper and study a little. Thanks a lot since this is exactly the kind of information I was looking for.
Bookmarks