I have a problem with below code and i don't know how to solve it.
When start the power on all works ok.But if power of for 1-3 sec and again power on the LCD show chinese and the program not work.If the power of is largest from 3 secs all works ok.
The pic is 16f84a.
Code:
DEFINE LCD_DREG PORTB 'Selection of the port B
DEFINE LCD_DBIT 0 'Selection one RB0 with RB3
DEFINE LCD_RSREG PORTA 'RS on port A
DEFINE LCD_RSBIT 2 'RS on RA2
DEFINE LCD_EREG PORTA 'E on port A
DEFINE LCD_EBIT 3 'E on RA3
DEFINE LCD_BITS 4 'Mode 4 bits
DEFINE LCD_LINES 2 '2 lines
DEFINE I2C_SCLOUT 1
' ** DEFINITION OF THE ENTREES - EXITS
' Exits I2C
SCL var PORTA.1 ' SCL on RB1 (pine 18)
SDA var PORTA.0 ' SDA on RB0 (pin 17)
' Boutons
UP var PORTB.6 'increase the frequency (on RB6)
DOWN var PORTB.7 'decrease the frequency (on RB7)
CH_PAS var PORTB.5 'Change the step of synth (on RB5)
Input UP 'Up and Down are entries
Input DOWN
Input CH_PAS
' ** DECLARATION OF THE VARIABLES
b1 var Byte
b2 var Byte
b3 var Byte
b5 var Byte
F1 var Word
F2 var Word
F3 var Word
ADDR1 VAR Byte
ADDR2 VAR Byte
LOCK VAR Byte
BAND VAR BYTE
TMP VAR WORD
TMP_LO VAR TMP.LOWBYTE
TMP_HI VAR TMP.HIGHBYTE
PLLBASE VAR WORD
PLL VAR WORD
RXPLL VAR WORD
LO VAR RXPLL.LOWBYTE
HI VAR RXPLL.HIGHBYTE
PAS VAR BYTE '1=125kHz, 2=250kHz, 4=500kHz, 8=1MHz
'*** INITIAL DATA ***
ADDR1=$C2
ADDR2=$C3 'adress I2C of SDA5055 (ADDR1=$C0 , adress I2C of TSA5511)
PLLBASE=720 'beginning with 45 MHz : 45 / 0,0625 = 720
PAS = 2 'pas of 0.0625 MHZ by defect
PAUSE 100
LCDOUT $FE, 1 ' Clear LCD screen
LCDOUT "TUNER 45-890 MHZ" ' post text during 2 second
PAUSE 1000
EEPROM 0,[$70,$1c] 'initial data TMP =7280 ($1C70) corresponds to F = 500 MHz
Bookmarks