I have the below code and it's work
I want to change to work for FM 88-108MHZ
How i can change it;
'Fmin =1200 MHz, F max= 1650 MHz
' ** 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
TMP VAR WORD
TMP_LO VAR TMP.LOWBYTE
TMP_HI VAR TMP.HIGHBYTE
PLLBASE VAR WORD
PLL VAR WORD
LO VAR PLL.LOWBYTE
HI VAR PLL.HIGHBYTE
PAS VAR BYTE '1=125kHz, 2=250kHz, 4=500kHz, 8=1MHz
'*** INITIAL DATA ***
ADDR1=$C2 'adress I2C of SDA5055 (ADDR1=$C0 , adress I2C of TSA5511)
PLLBASE=9600 'beginning with 1200 MHz : 1200 / 0,125 = 9600
PAS = 1 'pas of 0.125 MHZ by defect
PAUSE 100
LCDOUT $FE, 1 ' Clear LCD screen
LCDOUT " PLL FM 88-108" ' post text during 1 second
LCDOUT $FE,$C0
LCDOUT " NIKOS"
PAUSE 1000
EEPROM 0,[$90,$01] 'initial data TMP = 400 ($190) corresponds to F = 1250 MHz
'The starting point is 1200 MHz given by PLLBASE. One adds a shift of 125kHz * TMP
'TMP is on 16 bits, therefore 65535 possible frequencies.
'
'*** READING OF THE DECALAGE TMP ***
READ 0,TMP_LO 'reads the 8 bits of weak weight
READ 1,TMP_HI 'reads the 8 bits of strong weight
' *** BEGINNING OF THE PROGRAM***
MAIN:
PLL = PLLBASE + TMP
I2CWRITE SDA,SCL,ADDR1,[HI,LO,$8E] 'Sending of the data to the module
GOSUB CALCUL 'calculate the frequency for posting
GOSUB AFFICHAGE 'post the frequency
PAUSE 500
'*** PRINCIPAL LOOP ***
BOUCLE:
BUTTON UP,1,10,2,b1,1,MONTE 'supervise the button UP
BUTTON DOWN,1,10,2,b2,1,DESCEND 'supervise the button DOWN
BUTTON MEMO,1,255,0,b5,1,STORE 'supervise the button MEMO
BUTTON CH_PAS,1,255,0,b3,1, CHOIX 'supervise the button PAS
PAUSE 100 'pauses of 0.1s
GOTO BOUCLE
MONTE: '** INCREASE THE FREQUENCY OF 1 PAS (STEP)
TMP = TMP + PAS
IF TMP > 3600 THEN TMP = 0 'Fmax = 1600 MHz
GOTO MAIN
DESCEND: '** DECREASE THE FREQUENCY OF 1 PAS (STEP)
IF TMP<PAS THEN RAZ_TMP
IF TMP = 0 THEN TOP
TMP = TMP - PAS
GOTO MAIN
TOP: TMP=3600
GOTO MAIN
RAZ_TMP: TMP = 0
GOTO MAIN
CHOIX: '** CHOICE OF THE PAS (STEP)
IF PAS = 8 THEN SAUTE
PAS = PAS*2
GOSUB AFFICHE_PAS
GOSUB AFFICHAGE 'post the frequency
GOTO BOUCLE
SAUTE: PAS = 1
GOSUB AFFICHE_PAS
GOTO BOUCLE
CALCUL: ' ** CALCULATION OF THE FREQUENCY
F1= PLL-800 'cut off 1GHz
F2=F1/8 'give them MHz
F3=125*(F1//8) 'give them kHz
RETURN
AFFICHAGE:
LCDOUT $FE, 1 'Clear LCD screen
LCDOUT #1 'post the 1 of Giga
LCDOUT #F2 'post the other digits
LCDOUT "." 'post the comma
LCDOUT #F3 'post the Khz
LCDOUT " MHz "