I'm working on a little project using a pic16f628a , hc595 and a 4780 LCD display in 8 bit mode , but i just get a black screen .
i'm not sure if it is a hardware or software problem ..
This is the code i'm using
i'm not sure if it is a hardware or software problem ..
This is the code i'm using
Code:
;*******************HC595 pins****************************************
; Pic pin 17 (DS)to pin 14
; Pic pin 18 (SH)to pin 11
; Pic pin 1 (ST)to pin 12
; 595 Pin 10 16 to +
; 595 Pin 8 13 to Gnd
;********************************************************************
#define PIN_q7 PORTA,0 ; DS (serial data in)
#define PIN_SH PORTA,1 ; SH_CP(shift)
#define PIN_ST PORTA,2 ; ST_CP (latch)
#define LCD_RS PORTA,3 ; PIC pin 2 ->LCD RS (pin4)
#define LCD_E PORTA,4 ; PIC pin 3 ->LCD clock(pin6) 1 to send data
#define R_DEL1 0x20 ; Delay register
#define R_DEL2 0x21 ; Delay register
*********************************************************
;LCD INIT
;**********************************************************
;Boot
;**********************************************************
Boot
movlw 0x14
call delay
;**********************************************************
; LCD INIT 2
;**********************************************************
INIT
bcf LCD_E
BcF LCD_RS
;movlw b'00110000'
;call _595
;call pulse_e
movlw b'00110000'
call _595
call pulse_e
movlw b'00110000'
call _595
call pulse_e
;***************************************************
movlw b'00110000' ;8 bit operation For 4 bit mode Send command 0010xxxx as one operation (bottom 4 bits are don't care)
call _595
call pulse_e
movlw b'00001111'
call _595
call pulse_e
movlw b'00000111'
call _595
call pulse_e
movlw b'00000001'
call _595
call pulse_e
loop
bcf LCD_RS
movlw b'00000010'
nop
nop
nop
bsf LCD_RS
call delay_1ms
movlw 'a'
call _595
call pulse_e
loop1
goto loop1
_595
movwf data1
movlW .8
movwf RXT
d0
btfsc data1,7
bsf PIN_q7
btfss data1,7
bcf PIN_q7
bsf PIN_SH
call delay_1ms
call delay_1ms
bcf PIN_SH
rlf data1
DECFSZ RXT,F
goto d0
bsf PIN_ST
call delay_1ms
call delay_1ms
bcf PIN_ST
return
pulse_e
bsf LCD_E
nop
nop
nop
nop
bcf LCD_E
call delay_1ms
call delay_1ms
call delay_1ms
return