kemalkemal
Member level 1
- Joined
- Jan 27, 2013
- Messages
- 38
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 1,288
- Activity points
- 1,672
Hi everyone
i'm trying to use HD44780-based Character-LCD(4line20character) . I found some material from some forums but couldn't make it.
If you check my software steps i appreciate it:
1st: I designate port configurations
2nd:I make function set(8 bit interface and 2line(although my LCD is 4 line)
3rd:I make -display off,clear display, entry mode set, display on- in sequence
4th:send character-L- to LCD
But it didn't work.:shock:
i'm trying to use HD44780-based Character-LCD(4line20character) . I found some material from some forums but couldn't make it.
If you check my software steps i appreciate it:
1st: I designate port configurations
Code:
#define RS PORTA,0
#define RW PORTA,1
#define E PORTA,2
#define LCD_DATA PORTB
#define LCD_CTRL PORTA
Code:
movlw b'00000111'
banksel ADCON1
movwf ADCON1
banksel TRISA
clrf TRISA ;RA0->RS
;RA1->R/W
;RA2->E
banksel TRISB
clrf TRISB
banksel LCD_CTRL
clrf LCD_CTRL ;
2nd:I make function set(8 bit interface and 2line(although my LCD is 4 line)
Code:
movlw 0X38
banksel LCD_DATA
movwf LCD_DATA
banksel LCD_CTRL
bcf RW
bsf RS
bsf E
bcf E
call delay_100u ; delay for 100us
3rd:I make -display off,clear display, entry mode set, display on- in sequence
Code:
movlw b'00001011' ;disp off
call send_cmd
movlw b'00000001' ;clear disp
call send_cmd
movlw b'00000111' ;entry inc
call send_cmd
movlw b'00001111' ;disp on
Code:
send_cmd:
banksel temp
movwf temp
call busy_check
banksel temp
movf temp,w
banksel LCD_DATA
movwf LCD_DATA
banksel LCD_CTRL
bcf RW
bcf RS
bsf E
bcf E
call delay_100u
return
Code:
busy_check:
banksel TRISB
movlw b'11111111'
movwf TRISB
banksel LCD_CTRL
bcf RS
bsf RW
bsf E
bcf E
banksel LCD_DATA
movf LCD_DATA,w
banksel temp_busy
movwf temp_busy
btfsc temp_busy,7
goto busy_check
banksel LCD_CTRL
bcf RW
banksel TRISB
clrf TRISB
return
4th:send character-L- to LCD
Code:
movlw b'01001100'
call send_lcd
Code:
send_lcd:
banksel temp
movwf temp
call busy_check
banksel temp
movf temp,w
banksel LCD_DATA
movwf LCD_DATA
banksel LCD_CTRL
bcf RW
bsf RS
bsf E
bcf E
call delay_100u
return
But it didn't work.:shock: