Re: LCD problem with 16F628
Bumping an 10 year old tread.... :)
I also have problems with 16F628A and 1602 LCD
Code:
PCON=%00001011 'set intosc to 4mhz
DEFINE OSC 4
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 4
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 5
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 1500
DEFINE LCD_DATAUS 44
pause 500
LCDOUT $FE, "SACDELI "
PAUSE 5000
END
PORTB.0 - PORTB.1 are connected to D4-D7 pins of LCD
PORTB.5 is connected to RS pin
PORTB.6 is connected to E pin.
All hardware 100% verified and working. But still no display.
Re: LCD problem with 16F628
Your code says RS is PortB.4 while you say it's PortB.5.
Your code says E us PortB.5 while you say it's PortB.6.
/Henrik.
Re: LCD problem with 16F628
Thanks, fixed that, but still does not works...
Re: LCD problem with 16F628
can you share your config settings?
Re: LCD problem with 16F628
Code:
;----[16F628A Hardware Configuration]-------------------------------------------
#IF __PROCESSOR__ = "16F628A"
#DEFINE MCU_FOUND 1
#CONFIG
cfg = _INTOSC_OSC_NOCLKOUT ; INTOSC oscillator: I/O function on RA6/OSC2/CLKOUT pin, I/O function on RA7/OSC1/CLKIN
cfg&= _WDT_ON ; WDT enabled
cfg&= _PWRTE_OFF ; PWRT disabled
cfg&= _MCLRE_OFF ; RA5/MCLR/VPP pin function is digital input, MCLR internally tied to VDD
cfg&= _BODEN_ON ; BOD enabled
cfg&= _LVP_OFF ; RB4/PGM pin has digital I/O function, HV on MCLR must be used for programming
cfg&= DATA_CP_OFF ; Data memory code protection off
cfg&= _CP_OFF ; Code protection off
__CONFIG cfg
#ENDCONFIG
#ENDIF
;----[Verify Configs have been specified for Selected Processor]----------------
; Note: Only include this routine once, after all #CONFIG blocks
#IFNDEF MCU_FOUND
#ERROR "No CONFIGs found for [" + __PROCESSOR__ +"]"
#ENDIF
Include "Modedefs.bas"
PCON=%00001011 'set intosc to 4mhz
DEFINE OSC 4
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 4
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 5
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 1500
DEFINE LCD_DATAUS 44
pause 500
LCDOUT $FE, "SACDELI "
PAUSE 5000
END
Re: LCD problem with 16F628
not suprised , it's certainly an odd use of the lcdout 254 directive
Re: LCD problem with 16F628
Nice one Richard, don't know how I missed that!
Re: LCD problem with 16F628
Haha thanks!
Fixed it. But there were other issues too, MCU itself was also defective, replaced it, and everything works now just fine.
Re: LCD problem with 16F628
Quote:
All hardware 100% verified and working. But still no display
I guess not then :-)
/Henrik.
Re: LCD problem with 16F628
It was working, but at certain moment, when swapping LCDs, I've applied power to MCU in reverse polarity :D LCD survived ,MCU - not.
Re: LCD problem with 16F628
Please see below thread discussion. This may help you.
https://www.ccsinfo.com/forum/viewtopic.php?t=42284