Draft

CDG2000 Controller User Guide

Version0-90

Issued date11 Apr 2003

Preface

The objective of this document is to define how to use the CDG2000 controller.

Scope

This document applies only to the version 2 controller using the PIC17C766 for software releases up to and including V1.19.

Note that in V1-5 the location of the DDS clock data in the eeprom was changed – so it will need reprogramming when upgrading from 1.5 or earlier to 1.6 or later.

In version 1.17, the software was modified to cater for the new front end board, where the mapping of the relays to bands and attenuators was altered.

In Version 1.19, offsets for USB & LSB were added. When this happened, the checksumming arrangements were altered to protect data integrity. As a result, if you had saved to eeprom a different value of dds clock or cw offset, these will be reset to the rom values when you upgrade to V1.19. As a result, you will need to restore the settings using CFsel and setCF functions.

Table of contents

1Overview......

2Hardware......

2.1P1 – RS232 interface......

2.2JP1 – Analogue inputs and keyer......

2.3JP2 – the DDS bus......

2.4JP3 – the I2C bus......

2.4.1I2C bus limitations......

2.5JP4 – switched 12V outputs......

2.6JP5 – The LCD display......

2.7JP6 – Opto switches......

2.8JP7 -& 8 – Switch inputs......

2.9JP9 - controller power......

2.10JP10 – controller programming......

2.11JP11 – EEPROM write protect......

2.12JP12 – I2C Interrupt......

2.13JP13 : 12V switched input......

2.14JP14 – Transmit control......

3Using the controller......

3.1Programming a switch......

3.1.1Menus......

3.2Switch events......

3.3EEPROM......

3.4Dual VCOs......

3.5LCD Backlight......

3.6Keyers......

4Individual Switch Functions......

4.1Null - " "......

4.2Band Up - "Band+"......

4.3Band Down - "Band-"......

4.4Specific Bands - 160, 80, 40, 30, 20, 17, 15, 12, 10......

4.5Band Change - "Band "......

4.6Change Acceleration - "Accel"......

4.7Set mode - "Mode "......

4.8Change Volume - "Vol "......

4.9Change Attenuator - "Atten"......

4.10Go onto transmit - "Tune "......

4.11Set Mic Gain - "MicGn"......

4.12Set IF Gain - "IFGn "......

4.13Set Hang Time - "HangT"......

4.14Set VOX Gain - "VoxGn"......

4.15Set Anti Vox - "AVox"......

4.16Set Vox Delay - "VoxDl"......

4.17Set RX Power - "RFpwr"......

4.18Set Second Rotary encoder function - "SetF2"......

4.19Toggle between VCOs - "A/B"......

4.20Split VCO operation - "Split"......

4.21Set VCOs to same Frequency – “A=B”......

4.22Load from memory to current VCO - "load ", "mem1>", "mem2>", "mem3>", "mem4>"

4.23Store in memory from current VCO - "store", ">mem1", ">mem2",">mem3",">mem4"

4.24Lock tuning dial - "Lock "......

4.25Switch to CW - "CW "......

4.26Switch to USB - "USB "......

4.27Switch to LSB - "LSB "......

4.28Select Configuration Parameter to alter - "SelCF "......

4.29Change Configuration Parameter - "CFSet "......

4.30Select Narrow Band CW filter - "CWflt"......

4.31Software Version - “SWVer”......

4.32Backlight Control – “Light”......

4.33Menu functions – “Menu*”......

4.34Vox Control – “Vox”......

4.35Keyer On / Off – “EnKey”......

4.36Keyer Type – “KeyFn”......

4.37Keyer Speed – “KeySp”......

4.38Receive Lock – “Rlock”......

4.39PLL TX check – “PLLck”......

4.40DSP Control – “DSPon”, “DSPag”, “DSPbp”, “DSPnr”......

4.41Extended DSP Control - DSPnf, Notch, TxAGC, 2Tone, Tproc......

4.42Independent TX & RX functions......

4.43Vox Control - DisVX......

4.44Band Scanning......

5I2C Bus Details......

5.18 Channel DAC......

5.2PCF8574 - Low Pass Filters......

5.3PCF8574 - VCO Control......

5.4PCF8574 - Band Pass Filter......

5.5PCF8574 – DSP Control......

5.6PCF8574 - Relay Control Board......

5.7Custom PIC DSP Interface......

6S Meter control......

6.1On screen S meter......

6.2On Screen S Meter Calibration Process......

7Power Meter......

8Band data calculations......

9Bandscanner......

10Programming the controller......

11LCD Details......

12The Keyer......

12.1Iambic Keyer......

12.2Simple Keyer......

13Known Bugs......

14To Do

AController Assembly Notes......

A.1Do not fit the following......

A.2Erratum......

A.3Components......

A.4Assembly......

A.5Interfaces......

A.6Switches......

A.7LCDs......

A.8Beware......

A.9Oscillator......

BTX / RX Finite State Machine......

CKeyer Finite State Machine......

DBoard Layouts......

ECircuit Diagrams......

Draft1

2002 Colin Horrabin, George Fare & Dave Roberts - v0-90

Draft

1Overview

The CDG2000 controller consists of a PIC17C766 microcontroller that manages the rest of the transceiver and is controlled either by a keyboard and rotary control or by RS232 and communicates with the user either by means of Liquid Crystal Display(s) and LEDs or by RS232.

The following sections detail how to use the controller, both in terms of connections to the PCB and in terms of the commands.

RS232 interfaces are not yet defined.

2Hardware

The following connectors exist on the PCB

Connector / Usage
P1 / Future RS232 interface
JP1 / IF log amp ( s meter ) & power meter inputs and keyer input
JP2 / DDS bus – drives 1 or 2 DDS devices
JP3 / I2C bus.
JP4 / switched 12V outputs
JP5 / LCD connector
JP6 / Opto switches
JP7 / switch input 2
JP8 / switch input 1
JP9 / power to the controller ( +12V and whatever negative voltage the LCD & RS232 need )
JP10 / in circuit serial programming.
JP11 / write protect configuration data in EEPROM.
JP12 / unused - future interrupt input from I2C
JP13 / incoming 12V to the FET switches
JP14 / push to talk. Ground for transmit

The pinouts for these are shown in the following sections.

2.1P1 – RS232 interface

This connector is reserved for future use. Its pinout will be as shown below:

Pin / Function / Notes
1 / Data from PC to CDG2000 / Pin nearest to JP6/JP10
2 / Request to send from PC to CDG2000
3 / Ground
4 / Data from CDG2000 to PC
5 / Clear to Send from CDG2000 to PC / Pin nearest JP5/JP7

Data is standard RS232 levels but requires –12V to the controller ( JP9 ). It is recommended that a single in line 5 pin connector be used with polarisation in the form of a locating tab on the side nearest to the PIC processor.

2.2JP1 – Analogue inputs and keyer

The port carries 4 signal lines and 4 ground lines. From version 1-4 of the code, pin 7 is used for the S meter on screen display. Specifically, the analogue input from the IF unit log output is read by the ADC port. More detail may be found in section 6. Pin 5 is used as the transmit power monitor, again more details later.

Pin / Function / Comment
1 / Keyer Dash / Pin nearest FETs that switch power
2 / Ground
3 / Keyer Dot
4 / Ground
5 / TX Power measurement / Used to sense 0..5V for TX power
6 / Ground
7 / S Meter analogue in / Used to sense 0..5V from IF log amp output
8 / Ground / Pin nearest JP10

For the simple keyer, either keyer input (dot or dash) may be used.

2.3JP2 – the DDS bus

The pinout for this connector is shown below.

Pin / Function / Comment
1 / DDS 1 Load/Enable / Pin nearest corner of PCB
2 / DDS 1 Serial Data
3 / Ground
4 / DDS 1 Serial Clock
5 / Unused / floating
6 / Unused / Floating
7 / DDS 2 Load / Enable
8 / DDS 2 Serial Data
9 / Ground
10 / DDS 2 Serial Clock / Pin nearest U2

The DDS bus connector is a 10 pin box header, with the polarising keyway towards the edge of the PCB. It actually consists of two sets of signals designed to allow a 10 way ribbon cable connector to be split between traces 5 and 6 to provide two ‘tails’ at the remote end that can be connected to two DDS devices. If only 1 DDS is used the second set of signals may be ignored and a 10 way connector used at each end.

The port provides a separate enable signal for each DDS but common clock and data lines, hence loading serial data to one DDS will actually load both, but only the intended target is given the load signal.

The lines are driven from CMOS drivers and the leads should be kept as short as possible. No bus terminations should be used.

2.4JP3 – the I2C bus

Pin / Function / Comment
1 / Ground / Pin nearest edge of board / JP2
2 / I2C Serial Clock
3 / Ground
4 / I2C Serial Data
5 / Ground
6 / I2C interrupt line
7 / VCC ( +5V from controller )
8 / AN0
9 / VCC ( +5V from controller )
10 / AN1 / Pin nearest FET switches

The I2C bus is designed to control all functions of the transceiver. It is carried on a 10 pin ribbon cable and is ‘daisy chained’ between the cards. The bus is terminated on the controller card and needs no other terminations. Slew rate control is provided by the PIC. Data is sent at 100 Kbits / second. The devices connected to the bus on other cards ( such as PCF8574 devices on the LPF and front end boards ) are powered by the ribbon cable from the controller and should not be powered from the cards they control. A box header should be used with the polarising tab towards the edge of the board for compatibility.

The AN0 and AN1 lines provide spare lines to the PIC and are used for the keyer. Leave them unconnected on the other boards.

The Interrupt line is not used at present. Where it is desired that an I2C device be able to interrupt the PIC, this is the line it would use. On all other boards, do not connect to the interrupt line unless you want to use it !

The memory map for the I2C bus is shown later.

2.4.1I2C bus limitations

The I2C bus drives all devices in parallel. There is therefore a limit on the load that can be applied.

The maximum specified capacitive load is 400 pF on each line.

Each I2C device provides about 10 pF per line and 2 inches of 24 thou tracks on FR4 board would add another 2 pF. Being conservative call that 15 pF per board per device.

Assuming at most 10 boards with one I2C device each ( we have less than this ) gives rise to 150 pF from the end points, leaving at most 250 pF for the ribbon cable.

Typical cable has an inter-trace capacitance of 20 pF per foot, but we have a ground each side of the signal lines giving 40 pF per foot.

Hence the cable must not be longer than 6 feet. That however leaves no margin for error. A maximum suggested length for the cable is therefore 4 feet.

2.5JP4 – switched 12V outputs

Pin / Function / Comment
1 / Ground / Pin nearest JP6
2 / +12V when CW selected / Low current output
3 / +12V when USB selected / Low current output
4 / +12V when LSB selected / Low current output
5 / +12V when narrow CW filter / Low current output
6 / +12V when keyed / High current output
7 / +12V when LCD backlight on
or
+12V when 2 tone osc selected in tuneup / High current output
8 / +12V when on receive / High current output
9 / +12V when on transmit / High current output
10 / Ground / Pin nearest power FETs and corner of board

Power supplied to the controller via JP13 is switched by FETs and supplied out via JP4. This power input / output is completely separate from the power to the controller.

There are two types of drivers. In all cases the power is supplied by an FET switch, but 4 are low power ( max 300 mA ) and 4 high power ( max 12 A ). Note however that the FETs would need heatsinks for this and the cables / tracking would need attention. It is NOT intended that they be used for currents that high!

In each case there will be a small leakage current when off ( max 25 uA for high current FETs rising to max 250 uA at 150 OC if you don’t heatsink it and max 10 uA for low current rising to max 500 uA at 125 OC if you abuse them ).

It is recommended that a single in line Molex KK 2.54 mm style connector with a polarising tab near the board edge be used.

Note that pin 7 assumes one of two functions, either backlight control or 2 tone osc control in tuneup. It is a compile time selection as to which function is supported – you cannot have both with this version of the software.

2.6JP5 – The LCD display

Pin / Function / Comment
1 / Ground / Pin nearest preset pot
2 / +5V to LCD display / Power to LCD
3 / Contrast Adjust LCD / From preset pot / Vee – display specific
4 / Register Select / Display specific signal
5 / Read / Write control / Display specific signal
6 / Enable signal / Display specific signal
7 / Data bus bit 0 / Data bus LS bit
8 / Data bus bit 1
9 / Data bus bit2
10 / Data bus bit3
11 / Data bus bit 4
12 / Data bus bit 5
13 / Data bus bit 6
14 / Data bus bit 7 / Data bus MS bit
15 / LCD chip select / Display specific signal
16 / LCD reset / Display specific signal
17 / Vee to LCD / Display specific power
18,19,20 / Spare

This connector is pinned out in a standard fashion with a 20 pin box header with the keyway towards the PIC. The usage of many signals varies according to the display, especially in the case of the power Vee and contrast.

The intention is however to try to ensure that for most displays pin 1 of the display connects to pin 1 of JP5 etc. Where the function of the control lines ( pins 4,5,6,15,16 ) varies, this is catered for in the software. The software currently drives displays based on the Hitachi HD44870 / Seiko SED1278 as well as graphics displays based on the HD61830 or SED1330. The software must be explicitly built for the specified display.

2.7JP6 – Opto switches

Pin / Function / Comment
1 / Opto switch 1 channel A / Towards 33 MHz crystal
2 / Opto switch 1 channel B
3 / Ground
4 / Ground
5 / +5V to opto switch
6 / +5V to opto switch
7 / Opto switch 2 channel A
8 / Opto switch 2 channel B
9 / Ground
10 / Ground / Nearest JP4 and board edge

This is a 10 pin box header with the polarising tab towards the PIC processor.

Like the DDS bus, it is designed to connect to a cable with a 10 pin header at one end, split between traces 5 and 6 with the two five way groups going to two opto switches. If only one encoder is used, the second set is merely ignored.

The switch should have at least 128 cycles per revolution of the control with quadrature outputs. Power ( 5 V ) is provided by the controller.

2.8JP7 -& 8 – Switch inputs

Pin / Function / Comment
1 / Switch input bit 1 / JP8 nearest corner board, JP7 nearest P1
2 / Switch input bit 2
3 / Switch input bit 3
4 / Switch input bit 4
5 / Switch input bit 5
6 / Switch input bit 6
7 / Switch input bit 7
8 / Switch input bit 8
9 / Ground
10 / +5V

The switch inputs are general purpose switch control inputs and their use is software specific. Each is an identical pinout 10 way box header with the polarising slots towards the board edge.

When used to scan a keyboard ( up to 4 x 4 on each one ) pins 1,2,3 and 4 carry the scan signals ( pulled low in turn cyclically ) and pins 5,6,7 and 8 are the scan inputs. Power and ground are not normally needed in this case.

2.9JP9 - controller power

Pin / Function / Comment
1 / +ve supply to controller / Pin nearest board edge
2 / Ground
3 / -ve supply to controller / Pin furthest from board edge

This connector provides power to the controller.

With the exception of the RS232 drivers, the controller requires a voltage greater than +8V for the 5V regulator. When RS232 is used, +12V should be supplied. When programming the PIC via the serial programming adapter however, a voltage in excess of 16V is needed in order to supply 13V for programming.

The negative supply serves two purposes. The first is to supply –12V for RS232. The second is to supply a negative voltage to the LCD, should the specific model of LCD require it. This is display specific.

The controller needs about 20 mA when running from the 5V regulator, plus whatever the I2C devices and opto switches need.

It is suggested that a 3 pin polarised header be used with the polarising tab towards JP5.

2.10JP10 – controller programming

Pin / Function / Comment
1 / Vsupply to adapter from controller / Pin nearest R15 / JP8
2 / Vpp ( MCLR )
3 / +5V to adapter from controller
4 / 8 MHz clock to controller from adapter
5 / Ground
6 / Data to / from PIC
7 / Serial data clock to PIC
8 / Not connected
9 / PIC Test pin
10 / Not connected / Pin nearest JP1 & JP6

This connector provides a serial programming interface to the PIC. It allows the PIC to be programmed in situ. HINT – I find it easier to erase the PIC in situ by putting the whole controller in the EPROM eraser with a mask over the rest of the card than to remove & reinsert the PIC chip into its 84 pin socket.

Pin 1 supplies power to the controller so that it may generate a 13V programming supply. This means the power supplied to the controller must exceed 16V assuming a 3 volt dropout for an LM317. The programming adapter regulates and switches the voltage to supply back to the PIC MCLR and TEST pins via JP10 pins 2 and 9 respectively.

The 5V regulator on the controller supplies power to the programming adapter logic via pin 3.

The adapter supplies back to the PIC an 8 MHz programming clock on pin 4.

The other two signal leads provide a serial communications interface to the PIC.

To allow sharing of an adapter it is suggested that a right angle SIL header is used. If polarised, the polarising tab should be on the side away from the PCB so that the pins overhang the edge of the board and are partially covered by the polarising tab.

2.11JP11 – EEPROM write protect

This is a simple 2 pin header ( currently unused ). The intention is that it will control the ability to write to the configuration data in the EEPROM whilst still allowing the operational parameters such as band & memories to be accessed. A simple link header is used to control access with a two pin connector.

2.12JP12 – I2C Interrupt

This is currently unused. Should the software require to access the shared interrupt line of the I2C bus, this header would be used to enable / disable it.

2.13JP13 - 12V switched input

Pin / Function / Comment
1 / Ground
2 / +12V in
3 / +12V in
4 / Ground

This connector provides incoming 12V to supply the rest of the transceiver ( well, not those that take LOTS of current ! ). Power is switched by the FETs and supplied out on JP4.

2.14JP14 – Transmit control

Pin / Function / Comment
1 / Transmit / Pin nearest PIC
2 / Ground / Pin nearest JP7

When pin 1 is shorted to pin 2 ( i.e. grounded – it is a CMOS logic input ) the rig will go onto transmit.

When high ( or open circuit ) the rig is on receive.

The logic of going between the states of receive and transmit is not a simple binary action. Rather, a finite state machine is employed with state changes every 10 msec. This provides proper sequencing of power and relays.

3Using the controller

The controller reacts to events. These events can arise from a number of sources. These are:

  • A front panel switch being depressed or released
  • Rotation of one of the two opto shaft encoder controls
  • A change to the PTT input
  • An interrupt from the I2C bus
  • A signal from the Keyer ( Dot or Dash )
  • Receipt of an RS232 signal

The last one in the above list – RS232 - is not yet implemented.

Switch functions are programmed using the main tuning control and the configuration is stored in the EEPROM.

On initial power up, all switches are set to perform no function when pressed. They must be configured before use.

3.1Programming a switch

To program a switch, perform the following function

  1. Press the switch and hold it depressed
  2. Wait for 5 seconds until the main frequency display is blanked
  3. Turn the main tuning control until the desired function is displayed
  4. Release the switch

Where a switch is associated with an on screen label, that label will change as the selected function changes. Where there is no associated on screen label, the selected function temporarily replaces the displayed frequency.

If the main tuning control is turned while the switch is depressed and before the displayed frequency is blanked 5 seconds later, then the programming mode is not entered and instead any function associated with that switch is executed.

Remember that there can be up to 4 different menus – see below