PDA

View Full Version : LCD Problem



karenhornby
- 19th June 2008, 01:17
Hi guys...
any ideas how to set this?
my pin assignments are:
RS PORTB.4
E PORTB.5
but the data lines are
PORTB.0 LCD D7
PORTB.1 LCD D6
PORTB.2 LCD D5
PORTB.3 LCD D4

and my code is...


DEFINE OSC 8
DEFINE LCD_DREG PORTB 'set LCD DATA port
DEFINE LCD_DBIT 4 'set starting DATA bit (0 or 4) if 4-bit
DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
DEFINE LCD_RSBIT 4 ' Set LCD Register Select bit
DEFINE LCD_EREG PORTB ' Set LCD Enable port
DEFINE LCD_EBIT 5 ' Set LCD Enable bit
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_LINES 4 ' 4 Line LCD LCD
DEFINE LCD_COMMANDUS 2000 ' Set command delay time in us
DEFINE LCD_DATAUS 50 ' Set data delay time in us


The problem I have is the usual pin assignment is
PORTB.0 LCD D4
PORTB.1 LCD D5
PORTB.2 LCD D6
PORTB.3 LCD D7

HOW do I set the fact the pins are "backwards"?

SteveB
- 19th June 2008, 01:43
Karen,
Darrel has your answer (suprise, suprise :D). Here is the post: LCD_AnyPin (http://www.picbasic.co.uk/forum/showthread.php?t=7038&highlight=%2Ajack)

I'm sure Darrel will answer any questions you may have about implementing this.

HTH,
Steve

karenhornby
- 19th June 2008, 02:47
Thank you :)
and there was me thinking it was going to be an impossible problem to fix lol
or at least very hard!

SteveB
- 19th June 2008, 11:43
Thank you :)
and there was me thinking it was going to be an impossible problem to fix lol
or at least very hard!

Well, that's Darrel for you. Taking the seemingly impossible, very hard, and making it easy! So, don't thank me, thank Darrel.