or try this,
Code:
#CONFIG
__CONFIG _CONFIG1, _FCMEN_OFF & _FOSC_INTOSC & _WDTE_OFF & _MCLRE_OFF & _CP_ON & _IESO_OFF & _BOREN_OFF & _PWRTE_OFF
__CONFIG _CONFIG2, _PLLEN_OFF & _STVREN_OFF & _LVP_OFF
#ENDCONFIG
OSCCON = %01101010 'sets the internal oscillator to 4Mhz
TRISA = %00000000
TRISC = %00000000
ANSELA = %00000000
ANSELC = %00000000
OPTION_REG.7 = 0
SCL VAR PORTC.0
SDA var PORTC.1
Reset var PORTC.2 'could tie reset pin to vdd through 10K resistor
pause 100
HIGH Reset
'OPF1 = 0
goto StartProgram
'********************************************************************************
'=============Initializing LCD==========
ST7036Init:
'FUNCTION SET 0 and 1 ------------pag 30 datasheet
I2CWRITE PORTC.1, PORTC.0,$78,[$00,$38] ' Function set - 8 bit, 2 line display 5x8, inst table 0
pause 10
I2CWRITE PORTC.1, PORTC.0,$78,[$00,$39] ' Function set - 8 bit, 2 line display 5x8, inst table 1
pause 10
I2CWRITE PORTC.1, PORTC.0,$78,[$00,$14,$73,$5E,$6D,$0C,$01,$06] '
Return
'********************************************************************************
startProgram:
gosub ST7036Init
I2CWRITE PORTC.1, PORTC.0,$78,[$40,$48,$65,$6c,$6c,$6f] ' Hello
IdleLoop:
' could blink an led here
goto Idleloop
Bookmarks