PDA

View Full Version : lcdout 8bit problem!!!!



santamaria
- 29th May 2007, 21:43
Hi all,

I am using pic 16f628 with pic basic pro compiler ver 2.46.I am tying to display to an lcd screen equivalent to hd44780 the word hello but i can't make it.When i use the same program with 4bit interface everything working fine(DEFINE LCD_BITS 4).but when i choose 8 bit nothing appear to lcd.I don't know also if the connection is correct because i never used before 8bit interface.the 4bit connection is according to manual.
the code is here
LCD IS connected as follows:
' LCD PIC
' DB0 PORTB.0
' DB1 PORTB.1
' DB2 PORTB.2
' DB3 PORTB.3
' DB4 PORTB.4
' DB5 PORTB.5
' DB6 PORTB.6
' DB7 PORTB.7
' RS PORTA.4 (add 4.7K pullup resistor to 5 volts)
' E PORTA.1
' RW Ground
' Vdd 5 volts
' Vss Ground
' Vo 20K potentiometer (or ground)
'
@ DEVICE pic16F628, INTRC_OSC_NOCLKOUT
DEFINE LCD_DREG PORTB
DEFINE LCD_RSREG PORTA
define LCD_DBIT 0
DEFINE LCD_RSBIT 4
DEFINE LCD_EREG PORTA
DEFINE LCD_EBIT 1
DEFINE LCD_BITS 8
CMCON=7
TRISA=0
INTCON=0
TRISB=0
Pause 1000 ' Wait for LCD to startup
loop:
Lcdout $FE,1 ' Clear LCD screen
pause 500
lcdout "HELLO" ' Display Hello
Pause 500 ' Wait .5 second
end

skimask
- 29th May 2007, 22:25
I am using pic 16f628 with pic basic pro compiler ver 2.46.I am tying to display to an lcd screen equivalent to hd44780 the word hello but i can't make it.When i use the same program with 4bit interface everything working fine(DEFINE LCD_BITS 4).but when i choose 8 bit nothing appear to lcd.I don't know also if the connection is correct because i never used before 8bit interface.the 4bit connection is according to manual.

Which LCD module are you using? There are a few modules out there that only operate in the 4 bit mode, but still have what looks like an 8 bit connector.

Don't need 'DEFINE LCD_DBIT 0' when using 8 bit mode, don't know if it makes a difference or not.

Try increasing 'commandus' (word value) and 'dataus' (byte value) and see what happens. Generally, 'commandus' has always worked for me at a max value of 2500, and 'dataus' had to be set to a max value of 100 for one setup.

mister_e
- 30th May 2007, 00:26
Assuming the default config fuses in the 16f628.inc could be commented, I would bet on...

@ DEVICE pic16F628, INTRC_OSC_NOCLKOUT, LVP_OFF, PWRT_ON

Now there's still the pull-up on MCLR and on RA.4 which have to be there, but you said it worked in 4-bit mode, so...

santamaria
- 30th May 2007, 05:24
Thanks all for your replies,
I did't know that few modules operate in 4bit only. i have 2 different modules
first is GMD1602E and second is PC2002B. I ckeck in datasheet that you configure the module if you wan't to work in 8bit.This is made by compiler? or i have to do it manual?

mister_e
- 30th May 2007, 17:52
GDM1602E use KS00066U (or equiv) controller, and has the same standard i/o assignment, i have some 2X40 LCD here that use this controller, and there's no issue in 4 bit using LCDOUT. I don't know in 8 bit... but to me 8 bit mode is just an i/o wasting solution.

PowerTip PC 2002-b use a S6A0069X controller, i would guess it's a standard HD44780, the i/o assignment seems to be the same as well.

So playing with the Start-up delay, COMMANDUS and DATAUS delay could do the trick.

santamaria
- 1st June 2007, 18:24
thanks mister_e for your reply.i will try it......