Working first code :
Very strange whats happened: I wrote hex file , on LCD apppeared something like this :"ell o Hello ". I writed the file again, with the same hex file , on the same test board, without any changes ....and nothing on LCD! I tried many times...I discharged a capacitors from Vcc, I disconected the power supply 30 min, I turn ON again ...nothing!Code:'**************************************************************** '* Name : UNTITLED.BAS * '* Author : Dave Cutliff * '* Notice : Copyright (c) 2014 Use at your own risk * '* : All Rights Reserved * '* Date : 12/29/2014 * '* Version : 1.0 * '* Notes : * '* : * '**************************************************************** #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 DEFINE I2C_HOLD 1 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 1000 HIGH Reset goto StartProgram '******************************************************************************** '=============Initializing LCD========== ST7036Init: I2CWRITE PORTC.1, PORTC.0,$78,[$00] pause 250 I2CWRITE PORTC.1, PORTC.0,$78,[$38] pause 250 I2CWRITE PORTC.1, PORTC.0,$78,[$39] pause 250 I2CWRITE PORTC.1, PORTC.0,$78,[$14] pause 250 I2CWRITE PORTC.1, PORTC.0,$78,[$79] pause 250 I2CWRITE PORTC.1, PORTC.0,$78,[$50] pause 250 I2CWRITE PORTC.1, PORTC.0,$78,[$6C] pause 250 I2CWRITE PORTC.1, PORTC.0,$78,[$0C] pause 250 I2CWRITE PORTC.1, PORTC.0,$78,[$01] pause 250 I2CWRITE PORTC.1, PORTC.0,$78,[$06] pause 250 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
So, today I have free time to study . I'll try next Dave's suggestion.
Thx for your patience ,Dave!!




Bookmarks