G7KPM Logic Controller
G7KPM Logic Controller
A Basic Logic Controller For Hybrid ATV Repeaters
There have been many designs over the years for logic controllers of varying complexity and more recently, based on Raspberry Pi units. The unit described here is based on the PIC16F877A PIC microprocessor and the source code is written in Proton Basic. A free version with unrestricted PIC16F877A support can be downloaded from: https://www.crownhill.co.uk
The controller has 8 video inputs for sync detection, IP1 to IP8. The inputs are designed to connect into the video 'loop' and therefore has no 75R termination provided on the PCB. Each input is fed into a MAX7461 Sync detector IC as described by G0ATW in CQTV 264. Looking at input 1 as an example, when no sync is detected, Pin 4 is pulled low and goes high (5v) when valid sync is detected. When this pin goes high, the capacitor, C17 is charged via D1. This will then turn on the transistor TR, pulling pin 40 (RB7) of the PIC16F877A low (normally held HIGH due to the 10K pull-up resistor in RP1 resistor pack). When the video signal is lost, PIN 4 of the MAX7461 is pulled low and the capacitor C17 will start to discharge, providing a switch off delay which will prevent nuisance 'K's under poor signal conditions/fading etc. The value of C17 to C24 is not critical and can be set to your requirements.
Digital inputs are provided at CN1 and your digital receiver should pull the required input pin 1 – 8 low upon valid RX via a closing contact.
CN2 provides 8 selection lines for an audio switcher unit, which is active LOW. On GB3CT, this output is buffered and inverted using a HEF4049 Hex inverter IC to operate the audio switcher. When more than one input is active, then the audio of all active inputs will be mixed together to one output to the TX. GB3CT uses a pair of 4 channel audio switch PCB modules obtained from Ebay.
JP1 and JP2 set the output to your cameo unit as latched or momentary. Latched is normally used when connecting to the cameo unit alarm inputs and momentary when connecting to selection buttons.
JP1 controls the outputs cameo latch for 9 screen and Quad selection (PORTE.1). Placing a jumper at positions 1-2 pulls PORTE.1 High (Momentary) and placing the jumper at positions 2-3 pulls PORTE.1 Low (Latched)
JP2 Controls the switched outputs 1 to 8 as momentary or latched by pulling PORTE.0 high (Momentary) or low (Latched). A power off restart is required when jumper settings are changed.
All outputs on CN5, 6 & 7 are open collector.
An RS422 output has been provided in the PCB design to enable serial control of video switchers/video matrix where available. This has not been implemented in the CT build, but can be added using the PIC basic HRSin and HRS out commands. TTL level serial data is also available via the 3 pin DATA OUT header to use with RS232/RS485 modules available from Ebay etc.
U1 – PIC16F877A
U2 – 7805 (5V Regulator)
U3 - MAX490 (optional)
IC – MAX7461 (Loss of Sync Detector IC)
TR – BC847 (SOT23)
D1 to D8 – 1N4148 or similar
C1 to C16 – 0.1uF
C17 to C25 – 100uF (Select for required turn off delay after loss of sync)
C26, C30, C31, C32 – 220nF
C33 - 47uF
C27, C28 – 22pF
C29 – 470uF
C34, C35 – 220nf (0805)
C33 – 100uF (1206)
R1 to R8 – 1K (0805)
R9 to R16 – 1K (1206)
R17 - 10K
R18 to R29 – 1K
R30 - 10K
VR1 - 100K
RP1 – 10K 8 way SIL resistor pack
X1 – 20MHz Xtal
Logic Operation
When any input 1 to 8 is active, then the logic will switch the corresponding output on CN5.
When more than 1 input (1 to 4) are active, the logic will select QUAD output on CN6.
When more than 1 input (5 and above) is active, then the logic selects the 9 SCREEN output on CN7.
Any loss of input signal will momentarily activate the 'K' output on CN7 and provide a 'K' in Morse code at the K Audio Output connector. The audio output level can be set by the adjustment of the preset resistor, VR1.
When no inputs are active, the logic will activate the TESTCARD output to select the identification test cards and information pages etc.
The PIC Basic source code as used in GB3CT is available (to copy & paste into the Proton basic complier) from the Repeater Technical Topics section of the BATC forum and can be modified to suit your requirements.