I had a few spare minutes and a few spare components on the bench and the need for brain for the new local repeater.
This is the result.
Not withstanding any RF requirements like diplexers and cavities etc. To make a working repeater you will need the following.
* Two radios of your choice.
* One PIC 12F510, (yes it's an 8 pin DIL - I prefer the SMD version) cost ~$0.70
* One 100uF capacitor, ~$1.50
* One 10K potentiometer, ~$2.00
* Firmware for 12F510 which is listed below. Free.
- You'll also probably want an LED with an appropriate current limiting resistor. It has purpose but isn't required.
The software performs the bare minimum of requirements.
That's basically a simple time out function and a morse ID.
Oh and tail with a cute little beep at the end of each over.
When the repeater is turned on, the power LED comes on and flashes 3 times and then remains on.
The time out is set for roughly 3 minutes because so of you old buggers can waffle on, and I'm no exception.
If the repeater does time out, it will beep 5 times on the output audio and then inhibit the PTT and the LED will constantly flash until the timeout is reset.
The timeout is only reset if the chip itself is reset or the carrier detect is released.
There is a 7 second delay. No need to punish everybody for longer (unless you feel the need to lengthen this time)
The repeater will then ID in morse and go back to normal operation as if you had never upset it. (it's very forgiving).
This repeater won't annoy you with a morse ID every 10 minutes.
If you want to annoy repeater users with such a legality then you can change the code to suit your needs.
Otherwise if you leave it as it is, it will ID roughly one hour after the last transmission.
I had considered having it ID at the end of the first over in an idle period like most other repeaters.
I just decided to keep the code simple and if required that can be added in later.
----
You will need to change the morse ID in the source code to suit your needs.
If you look at the code where the callsign is located you will see that it is very simple to modify.
subroutines DIT, DAH and SPCE (space). There is no need for spaces between elements, this is automatic.
Of course a space is required between characters.
As an example: V = DIT DIT DIT DAH (as SPCE is required) K = DAH DIT DAH (another SPCE)
There is no limit to how much morse code you would like to send. Well, it's only a small PIC so the actual limit is program memory.
When you have modified the source code you will need to compile it with the MPLAB IDE (which is free) from microchip.
The compiled file will be a .hex file which then needs to be uploaded to the PIC chip.
----
So how to wire it all up....
It's not too difficult and a circuit diagram of the radio you use for the receive radio will help, else you will just need to use a multimeter and trial and error.
First thing is to find the part of the circuit that opens the squelch or is an indication that the squelch is open. Some radios have a "Busy" light or a carrier detect which makes the task very easy. Else you will just has to open and close the squelch manually while watching suspect points in the circuit. It's not actually hard to find several places in the radio that respond with a change in DC levels.
The controller can respond to either positive or negative carrier detect though it is currently set to respond to 0V = carrier detect and floating is muted.
This line is connected to pin 7 on the PIC.
The PTT of the transmitting radio is connected to pin 3 on the PIC.
The PIC pulls the PTT low to transmit, but it can be changed if required.
Most radios run on 12V but a lot do have internal +5V rails. While the PIC can run on 12V, it is easier and more reliable on 5V.
Pin 1 = +5V
Pin 8 = 0V
All that is left to be connected is the audio output of the receive radio to the microphone input of the transmit radio.
I put a lot of thought into this one and it was the most productive 3 seconds of my life.
I selected a 10K pot, the brush (center pin) is connected to the microphone.
On end of the 10K pot is connected to the speaker output of the receive radio
Pin 5 of the PIC is connected to the other end of the potentiometer via a 100uF.
This provides the morse, warning beeps and tail pips to the audio circuit and the potentiometer adjusts the bias of how loud the tones are compared to the audio. The audio gain is controlled by the volume on the receiver. The squelch on the receiver also needs to be set to mute the repeater.
The indicator/power LED connected to pin 2 with a current limiting resistor
A reset push button can also be connected to pin 4 which is the reset pin for the PIC.
Set the frequency on each radio, add any external hardware and your done.
I've tested this with a couple of combinations of radios and it's
Code: Select all
; Ultra simple repeater controller by Trash VK2XSO
;
;
; PINOUTS
; ======= PIC 12F510
; ____ ____
; | \/ |
; 5 Volts Vcc --| 1 8 |-- GND
; | |
; POWER LED GPIO,5 --| 2 7 |-- GPIO,0 AN0 RX INPUT
; | |
; PTT GPIO,4 --| 3 6 |-- GPIO,1 AN1 SPARE
; | |
; RESET GPIO,3 MLCR --| 4 5 |-- GPIO,2 AN2 TONE
; |__________|
;
;
; +-------+
; TX <---PTT----|3 7|<---Squelch--- RX
; | |
; | 5 |
; +-------+
; |
; === 100uF
; |
; <|
; |>
; TX <---MIC------><| 10K pot
; |>
; <|
; +-------Speaker----- RX
;
;
;
; Programer socket DIP8
;
#include <P12F510.inc>
__CONFIG _MCLRE_ON & _CP_OFF & _WDT_OFF & _IntRC_OSC
OPTIN EQU 001h ;OPTION register
DEL1 EQU 011h ;delay counter 1
DEL2 EQU 012h ;delay counter 2
DEL3 EQU 013h ;delay counter 3
DEL4 EQU 014h ;delay counter 4
DEL5 EQU 015h ;delay counter 5
TEMP EQU 016h ;temporary register
FLAG EQU 017h ;flag register
#DEFINE TTT FLAG,0 ;TONE ENABLE
#DEFINE RX GPIO,2 ;RX
#DEFINE TONE GPIO,1 ;tone output pin
#DEFINE PTT GPIO,0 ;PTT
#DEFINE PWR GPIO,5 ;Power LED
#DEFINE CARRY STATUS,0 ;CARRY
#DEFINE DC STATUS,1 ;DECIMAL CARRY (busy flag)
#DEFINE ZERO STATUS,2 ;ZERO
#DEFINE PAGE0 STATUS,5 ;RP0
;--------------------------------------------------------
ORG 0000h ;Reset Vector
INIT bsf STATUS,5 ;page 1
movlw 0C0h ;OPTION register
movwf OPTIN ;write register
bcf STATUS,5
; movlw b'00110000' ; outputs
; movlw 0B1h ;b'10110001' configure AN[1:0] as analog inputs
; movwf ADCON0
movlw 000h
movwf ADCON0
bcf CM1CON0,3 ;disable comparitor
bsf CM1CON0,6 ;disable output
; movlw 008h ;GPIO,3 input only
movlw 00Ch
tris GPIO
clrf OSCCAL
call LDELAY
bsf PWR ;POWER LED ON flash 3 times
call LDELAY
bcf PWR
call LDELAY
bsf PWR
call LDELAY
bcf PWR
call LDELAY
bsf PWR
call LDELAY
bcf PWR
call LDELAY
bsf PWR
; call CALSGN
; goto MAIN
;---------------------------------------------------------------
CALSGN bcf PTT ;PTT ON
call SPCE ;VK2RAA ..._ _._ .._ _ _ ._. ._ ._
call SPCE ;VK2RQH ..._ _._ .._ _ _ ._. _ _._ ....
call SPCE ;==============================================================
call DIT ; V
call DIT
call DIT
call DAH
call SPCE ;-----
call DAH ; K
call DIT
call DAH
call SPCE ;-----
call DIT ; 2
call DIT
call DAH
call DAH
call DAH
call SPCE ;-----
call DIT ; R
call DAH
call DIT
call SPCE ;-----
call DAH ; Q
call DAH
call DIT
call DAH
call SPCE ;-----
call DIT ; H
call DIT
call DIT
call DIT
; call DAH ; ======= end of the call sign ========== Change the morse letters to suit your repeater. It's that simple.
call SPCE
call SPCE
call SPCE
bsf PTT ;PTT OFF
; goto MAIN
goto RSTOT
; retlw 0
;------------------------------------------------
DIT bsf TTT
call SDELAY
bcf TTT
call SDELAY
retlw 0
;-----------------------------------------------
DAH bsf TTT
call SDELAY
call SDELAY
call SDELAY
bcf TTT
call SDELAY
retlw 0
;-----------------------------------------------
SPCE bcf TTT
call SDELAY
call SDELAY
call SDELAY
retlw 0
;===========================================================
RSTOT clrf DEL1 ;reset (idle) time out counters
clrf DEL2
clrf DEL3
movlw 0BBh ;set idle ID to 1 hour
movwf DEL4
; clrf DEL4
; clrf DEL5 ;not used
MAIN incfsz DEL1 ;increment idle timer
goto NORX
incfsz DEL2 ;increment idle timer
goto NORX
incfsz DEL3 ;increment idle timer 52 seconds loop
goto NORX
incfsz DEL4 ;increment idle timer
goto NORX
; decfsz DEL5 ;increment idle timer
; goto NORX
goto CALSGN ;No activity time out - time to ID
NORX btfsc RX ;is RX on
goto MAIN ;no
bcf PTT ;PTT on
call LDELAY
RESTX clrf DEL1 ;reset time out counters
clrf DEL2
clrf DEL3
movlw 0FCh ;3 minute timeout 256-4=FC
movwf DEL4
; clrf DEL5 ;not used
REPTX incfsz DEL1 ;increment idle timer
goto YESTX
incfsz DEL2 ;increment idle timer
goto YESTX
incfsz DEL3 ;increment idle timer 52 seconds loop
goto YESTX
incfsz DEL4 ;increment idle timer
goto YESTX
; decfsz DEL5 ;increment idle timer
; goto YESTX
goto TIMOUT ;Transmit Time Out has occured
YESTX btfss RX ;is RX off
goto REPTX ;no
; bsf PTT
call LDELAY ;delay between tail and roger beep
; call LDELAY
; call LDELAY
TAIL bsf TTT
call SDELAY ;tail beep
bcf TTT
bsf PTT ;release PTT
; goto MAIN
goto RSTOT
;--------------------------------------------------------
TIMOUT bsf TTT
call SDELAY ;beep
call LDELAY
call SDELAY ;beep
call LDELAY
call SDELAY ;beep
call LDELAY
call SDELAY ;beep
call LDELAY
call SDELAY ;beep
bcf TTT
bsf PTT ;disable PTT
TOTAL bcf PWR ;flash the power LED to signal timeout
call LDELAY
bsf PWR
call LDELAY
btfss RX ;timeout
goto TOTAL ;RX not released
clrf DEL1 ;reset timer
clrf DEL2 ;reset time
movlw 020h ;about 7 seconds
movwf DEL3 ;
TTOUT nop ;Time out release
incfsz DEL1 ;increment idle timer
goto TTOUT
incfsz DEL2 ;increment idle timer
goto TTOUT
incfsz DEL3 ;increment idle timer 7 seconds loop
goto TTOUT
goto CALSGN ;reset the repeater
;----------------------------------------------
; Long Delay
LDELAY movlw 002h ;~1/3 second
movwf DEL3 ;outside loop
LOOP3 movlw 0FFh ;256
movwf DEL2 ;middle loop
LOOP2 movlw 0FFh ;256
movwf DEL1 ;inside loop
LOOP1 nop
decfsz DEL1 ;decrement loop 1
goto LOOP1
decfsz DEL2 ;decrement loop 2
goto LOOP2
decfsz DEL3 ;decrement loop 3
goto LOOP3
retlw 0
;----------------------------------------------
; Short Delay
SDELAY movlw 002h ;~1/3 second
movwf DEL3 ;outside loop
SLOOP3 movlw 02Fh ;256
movwf DEL2 ;middle loop
SLOOP2 movlw 0FFh ;256
movwf DEL1 ;inside loop
SLOOP1 nop
decfsz DEL1 ;decrement loop 1
goto SLOOP1
btfss TTT ;tone enable ?
goto NOTONE ;no
movlw 002h ;generate tone
xorwf GPIO
NOTONE decfsz DEL2 ;decrement loop 2
goto SLOOP2
decfsz DEL3 ;decrement loop 3
goto SLOOP3
retlw 0
goto MAIN
END