JI1FGX/DU9 Mindanao, Philippines Amateur Radio Diary IOTA OC-130
English Japanese



Access until yesterday
Introduction. 【【Lily Diary]
Diary of Life in Mindanao

10/12/31 TV antenna fabrication
10/12/24 Cute operator
10/12/23 Business and broadcasters consult with us.
10/12/17 Business Antenna Construction
10/12/15 Antennas found in the city
10/12/10 14MHz antenna repair completed
10/12/07 14MHz antenna destruction
10/12/04 Fare8 Club Christmas Party
10/12/04 Gigi Class C Retake
10/11/27 To Manila, PARA's General Assembly
10/11/16 A piglet was born.
10/11/06 Ham Shop Situation
10/11/02 Internet connection is not available
10/10/27 STANDARD C150 repair
10/10/22 Ham Shop Page
10/10/22 power outage
10/09/30 Autumn Condition
10/09/17 DU8UTP Franco.
10/09/12 Challenge PSK 31
10/09/07 Expansion of piggery
10/08/12 Antenna repair for 21 MHz
10/08/07 The 21 MHz antenna is broken.
10/08/06 Backyard and Antenna
10/08/03 sunset
10/07/31 Radio Commercials
10/07/03 Shack Introduction
10/06/21 Repeater Controller
10/06/07 Repeater Controller CW Routine
10/05/20 Clear sky, group of antennas
10/05/18 antenna group
10/05/13 50MHz also open
10/05/09 Election...eh! Are you sure?
10/05/06 How to write a card via manager
10/05/04 shack
10/04/20 VHF Repeater Orders Received
10/04/12 Philippine Military Group
10/04/11 business
10/04/05 21MHz and 50MHz antennas
10/04/04 Failed 50MHz installation
10/04/04 If not available, make one. 50MHz balun
10/04/02 If you don't have it, make it. Cross mount.
10/04/01 50MHz 5EL remanufactured
10/03/23 Four 16-meter-long bamboos
10/03/22 Production of 21MHz 3-element yagi
10/03/15 Purchase a generator
10/03/05 wire antenna
10/02/03 Broken again.
10/01/20 I'm going in the wrong direction.
10/01/19 18MHz Yagi breakage for Japan
10/01/04 7/8 2-stage 144MHz band GP
JI1FGX/DU9 Mindanao Diary AVR Microcontroller Repeater Controller(2010/06/21)
The repeater controller I was working on with AVR's BASCOM has taken shape for the time being!
However, compiling this code with the BASCOM trial version will result in an error because it exceeds 4KB.
There is only one mode of TIMEOUT and only one mode in which TIMEOUT is reset in case of hang-up
This source code is tailored to the ATMEGA88.

input-output
PB2-8 Output for LCD (20x4)
PD0 For setup + Input
PD1 for setup - Input
For PD2 Setup Next Item Entry
PC1 Squelch input
PC2 Setup mode Input
PC3 Operation mode Input
PC4 CW tone 0 to +5V only Input
PC5 PTT output
' Copyright ©2008-2009 JI1FGX Kouichi Ueno
'
$regfile = "m88def.dat" ' specify the used micro
$crystal = 1280000 ' used crystal frequency
$baud = 19200 ' use baud rate
$hwstack = 32 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space


'$sim
'REMOVE the above command for the real program !
'$sim is used for faster simulation


'note : tested in PIN mode with 4-bit
Config Lcdpin = Pin , Db4 = Portb.4 , Db5 = Portb.5 , Db6 = Portb.6 , Db7 = Portb.7
Config Lcdpin = Pin , E = Portb.3 , Rs = Portb.2
'
'Config Timer1 = Timer , Prescale = 1024 , Clear Timer = 1 , Compare A = Toggle
'Compare1a = 1249
'On Compare1a Tint1


Dim I3 As Byte
Declare Sub Modeselect1()
Declare Sub Lcdvalue()
Declare Sub Lcddisp()
Declare Sub Repeater()
'Declare Sub Cw()

Dim Cwf As Byte

Dim Maxline As Byte

Dim Setupvalue(22) As Byte
$default Eram
Dim Eeprom_value(22) As Eram Byte At $01
$default Sram
Dim Sw(4) As String * 3
Dim Modeselect As Byte
Dim Modechar(5) As String * 20
Dim Page As Byte
Dim Flag As Bit ' Timer 1Hz
Dim Timeout As Byte


Config Lcd = 20 * 4 'configure lcd screen
Config Portd = Input
Config Portd.7 = Output
Config Portd.7 = Output
Config Portc = &B110000
Set Portc.5
Set Portc.6 '&B110000
Maxline = 4

Cursor On

Cwf = 0
Modeselect = 1
Modechar(1) = "Hangup S"
Modechar(2) = "Timeout M"
Modechar(3) = "TO Reset S"
Modechar(4) = "mode(1,2)"
Modechar(5) = "JI1FGX/DU9"
'Modechar(5) = "DTMFON1 "
'Modechar(6) = "DTMFON2 "
'Modechar(7) = "DTMFOFF1 "
'Modechar(8) = "DTMFOFF2 "

'Modechar(5) = "CW1Speed "
'Modechar(6) = "CW1interval M"
'Modechar(7) = "CW2Speed "
'Modechar(8) = "CW2interval M"
'Modechar(09) = "DTMFON1 "
'Modechar(10) = "DTMFON2 "
'Modechar(11) = "DTMFOFF1 "
'Modechar(12) = "DTMFOFF2 "
'Modechar(13) = "JI1FGX DU9"
Page = 1
Modeselect = 1

Cls.
'Sound Portc.4 , 5000 , 100
Wait 1

Main: Main
Do
Debounce Pinc.3 , 1 , Setup , Sub
Debounce Pinc.3 , 0 , Repeater , Sub
loop
End
Sub Repeater()
Local Timer_1 As Byte
Local Timer_2 As Byte
Local Timer_3 As Byte
Local S1 As String * 2
Local Fstep As Byte
Local Hungup As Byte
'Dim Timeout As Byte

Fstep = 0
Cwf = 0
If Eeprom_value(1) = &HFF Then Eeprom_value(1) = 1
If Eeprom_value(2) = &HFF Then Eeprom_value(2) = 1
If Eeprom_value(3) = &HFF Then Eeprom_value(3) = 1
If Eeprom_value(4) = &HFF Then Eeprom_value(4) = 1
Timer_1 = Eeprom_value(1)
Timer_2 = Eeprom_value(2) * 10
Timer_3 = Eeprom_value(3)
Cls.

Do
Select Case Fstep

Case 0
If Pinc.1 = 0 Then
Reset Portc.5
Hungup = 0
Timeout = 0
Fstep = 1
End If

Case 1
If Timeout = Timer_2 Then
Fstep = 4
End If
If Timeout <= Timer_2 Then
Timeout = Timeout + 1
S1 = Str(timeout)
Cls : Locate 1 , 1 : Lcd "PTT ON" : Lcd Format(s1 , " ")
If Cwf = 0 Then Gosub Cw1
Wait 1
End If
If Pinc.1 = 1 Then Fstep = 2

'Hungup count
Case 2
If Pinc.1 = 1 Then
Locate 1 , 1 : Lcd "Hungup "
If Eeprom_value(4) = 2 Then Timeout = Timeout + 1
If Hungup = Timer_1 Then
Fstep = 3
Hungup = 0
End If

If Hungup <= Timer_1 Then
Hungup = Hungup + 1
Wait 1
End If
If Pinc.1 = 0 Then
' Hungup = 0
Fstep = 0
End If
End If

' Hungup
Case 3
Set Portc.5
Cls : Locate 1 , 1 : Lcd "PTT OFF "
Fstep = 0
Cwf = 0
' Timeout
Case 4
Set Portc.5
Cls : Locate 1 , 1 : Lcd "PTT OFF Timeout"
Timeout = 0
Hungup = 0
Fstep = 0
': S1 = 0
Wait Timer_3
Cls : Locate 1 , 1 : Lcd "PTT OFF "
Cwf = 0
End Select



Debounce Pinc.3 , 1 , Endofloop

loop


Endofloop:.
'Disable Oc0a
'Disable Interrupts
End Sub

Cw1:.
Cwf = 1
Dim In_char As String * 1
Dim M_data As String * 5
Dim M As String * 1
Dim Cwlen As Byte
Dim Cwcodelen As Byte
Cls.
For Cwlen = 1 To Len(modechar(5))
Locate 2 , Cwlen
Lcd Mid(modechar(5) , Cwlen , 1)
In_char = Mid(modechar(5) , Cwlen , 1)

If In_char = " " Then M_data = " "
If In_char = "A" Then M_data = "0-"
If In_char = "B" Then M_data = "-000"
If In_char = "C" Then M_data = "-0-0"
If In_char = "D" Then M_data = "-00"
If In_char = "E" Then M_data = "0"
If In_char = "F" Then M_data = "00-0"
If In_char = "G" Then M_data = "--0"
If In_char = "H" Then M_data = "0000"
If In_char = "I" Then M_data = "00"
If In_char = "J" Then M_data = "0---"
If In_char = "K" Then M_data = "-0-"
If In_char = "L" Then M_data = "0-00"
If In_char = "M" Then M_data = "--"
If In_char = "N" Then M_data = "-0"
If In_char = "O" Then M_data = "---"
If In_char = "P" Then M_data = "0--0"
If In_char = "Q" Then M_data = "--0-"
If In_char = "R" Then M_data = "0-0"
If In_char = "S" Then M_data = "000"
If In_char = "T" Then M_data = "-"
If In_char = "U" Then M_data = "00-"
If In_char = "V" Then M_data = "000-"
If In_char = "W" Then M_data = "0--"
If In_char = "X" Then M_data = "-00-"
If In_char = "Y" Then M_data = "-0--"
If In_char = "Z" Then M_data = "--00"
If In_char = "0" Then M_data = "-----"
If In_char = "1" Then M_data = "0----"
If In_char = "2" Then M_data = "00---"
If In_char = "3" Then M_data = "000--"
If In_char = "4" Then M_data = "0000-"
If In_char = "5" Then M_data = "00000"
If In_char = "6" Then M_data = "-0000"
If In_char = "7" Then M_data = "--000"
If In_char = "8" Then M_data = "---00"
If In_char = "9" Then M_data = "----0"
If In_char = "/" Then M_data = "-00-0"

For Cwcodelen = 1 To Len(m_data)
If Mid(m_data , Cwcodelen , 1) = "0" Then Sound Portc.4 , 100 , 100
If Mid(m_data , Cwcodelen , 1) = "-" Then Sound Portc.4 , 300 , 100
If Mid(m_data , Cwcodelen , 1) = " " Then Waitms 80
Waitms 30
Next
Waitms 200
Next

Return
Setup: 1.


Set Portc.5
Gosub Lcddisp
Do

Debounce Pind.0 , 0 , Sw0on , Sub
Debounce Pind.1 , 0 , Sw1on , Sub
Debounce Pind.2 , 0 , Modeselect1 , Sub
Debounce Pinc.3 , 0 , Endofsetup
loop
Endofsetup:.
Return
End


Sw0on:.
Incr Setupvalue(modeselect)
Eeprom_value(modeselect) = Setupvalue(modeselect)
Gosub Lcdvalue

Bitwait Pind.0 , Set
Return

Sw1on:.

If Setupvalue(modeselect) > 1 Then
Decr Setupvalue(modeselect)
End If
Eeprom_value(modeselect) = Setupvalue(modeselect)

Gosub Lcdvalue
Bitwait Pind.1 , Set
Return


Sub Modeselect1()
Local Amari As Byte
Local I2 As Byte
'Local I As Byte
Local I1 As Byte

Modeselect = Modeselect + 1
I2 = Page - 1
I2 = Maxline * I2
I1 = Modeselect - I2
I2 = I1 - 1
If I1 > 1 Then
Locate I2 , 13
Lcd " "
End If
Locate I1 , 13
Lcd ">"


Amari = Modeselect Mod 4
If Amari = 1 Then
Page = Page + 1


' Cls.
Gosub Lcddisp
End If
If Modeselect > 4 Then
' If Modeselect > 10 Then
Modeselect = 1
Page = 1
' Cls.
Gosub Lcddisp
End If

'Return
End Sub

Sub Lcdvalue()
Local I2 As Byte
Local I1 As Byte
I2 = Page - 1
I2 = Maxline * I2
I1 = Modeselect - I2


Sw(i1) = Str(setupvalue(modeselect))
Sw(i1) = Format(sw(i1) , " 0")

Locate I1 , 17
Lcd Sw(i1)
'Return
End Sub

Tint1:.
Toggle Portd.7
Flag = 1
Return

Sub Lcddisp()
Local I As Byte
Local I2 As Byte
Local I1 As Byte
Cls.

For I = 1 To Maxline
I2 = Page - 1
I2 = Maxline * I2
I1 = I + I2
Setupvalue(i1) = Eeprom_value(i1)
If Setupvalue(i1) = 255 Then
Setupvalue(i1) = 1
End If

Sw(i) = Str(setupvalue(i1))
Sw(i) = Format(sw(i) , " 0")

Locate I , 1 : Lcd Modechar(i1)

Locate I , 17 : Lcd Sw(i)
Next
Locate 1 , 13
Lcd ">"
'Return
End Sub



End
June 07, 2010   July 03, 2010