Are you using this chip on a solderless breadboard or are you using the Low Pin Count Demo Board from Microchip ?
this is you code with only minor tweeks and it works on a solderless breadboard. try grounding the contrast pin #3 on the lcd. This is compiled using MPASM as it is what I always use.
Code:
@ __config _INTRC_OSC_NOCLKOUT & _WDT_OFF & _MCLRE_OFF &_CP_OFF
define OSC 4
DEFINE LCD_DREG PORTC 'Set port C for the data lines
DEFINE LCD_DBIT 4
DEFINE LCD_RSREG PORTB 'Set the RS Port and Pin
DEFINE LCD_RSBIT 5
DEFINE LCD_EREG PORTB 'Set LCD Enable bit and pin
DEFINE LCD_EBIT 6
DEFINE LCD_BITS 4
' Set number of lines on LCD
DEFINE LCD_LINES 2
' Set command delay time in us
DEFINE LCD_COMMANDUS 2000
' Set data delay time in us
DEFINE LCD_DATAUS 50
ANSEL = 0
ANSELH = 0
CM1CON0 = 0
CM2CON0 = 0
Cnt VAR WORD
'Start Program
TRISC = 0
TRISB = 0
Pause 500
cnt=0
RPT:
HIGH PORTB.6
LCDOUT $FE,1 'CLEAR LCD SCREEN
pause 500
LCDOUT $FE,2,"CNT=", DEC CNT
Pause 1000
CNT=CNT+1
GOTO RPT
END
Last edited by Archangel; - 8th May 2009 at 07:26.
If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
.
Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
.
There simply is no "Happy Spam" If you do it you will disappear from this forum.
Bookmarks