OwenDuffy.net 


PllLdr application - ATTiny44 & AD9833 in Codan 6801

*** DRAFT***

The Codan 6801 is an older SSB transceiver using a single crystal per simplex SSB channel, for up to 10 channels. The channel switch selects the crystal and also a band pass filter for that channel.

This article describes an application of PllLdr to an AD9833 DDS as a crystal replacement in the Codan 6801 MkII transceiver for ham bands. The objective was an internal replacement for crystals which are quite expensive, compatible with the existing architecture and using the existing controls. Note that the modification would compromise type approvals.

Fig 1: Block diagram of the crystal replacement and its integration with the existing electronics

Fig 1 shows a block diagram of the crystal replacement and its integration with the existing electronics.

Design

PllLdr

PllLdr is available on several chips, the most relevant for this project are an ATTiny44 which allows 8 channels, or an ATMega328P which allows all 10 channels. The Atmega328P is conveniently implmented by using an inexpensive Arduino Nano 16MHz/5V module (more later). For this initial project, the ATTiny44 was used.

The transceiver provides 10 wires for crystal selection, on is raised to around 11V to select. Some of these signals are used as inputs to PllLdr, but they must be reduced to below 5V. Datasheet states chip pullup R=20-50k. On 5V, Imax=5/20k=250uA, so, for 0.3V input, R=0.3/250e-6=1.2k. The high side R from 11V twice that, 2k2, so you would get 1/3.2*11=3.4V for a high. This sinks 3mA of current, but only on one active channel circuit.

Fig 2: Schematic

Fig 2 shows the schematic diagram. 

Now the ATTiny supports 7 input pins (sel[0]-sel[6]), so wire them CH1-sel[0] which selects EEPROM address 1 through CH7-sel[6] which selects address 7, no input (CH8-CH10) selects address 0 so CH8-10 will select the same channel (the one at EEPROM address 0) so tune those filters for that frequency.

If you use the ATMega328P (Nano), you have one input available for each of the 10 channels, but note that the corresponding EEPROM addresses are 1-10, 0 is allocated but unused.

Fig 3: Typical SPI burst from PllLdr to AD9833

Fig 3 shows the SPI traffic for a frequency change.

DDS

The DDS used is a low cost chip that can be purchased online as a module with on board 25MHz reference oscillator for under $10. DDS output needs to be passed through a low pass filter to reject spurious products such as alias outputs.

Fig 4:

Fig 4 shows an example AD9833 DDS module.

Low pass filter

Fig 5: Low pass filter design

Fig 5 shows the 7 pole eliptic (Cauer / Zolaterev) low pass filter design. The design uses readily available inexpensive E12 series capacitors, and the inductors can be hand wound on inexpensive T25-1 powdered iron cores.

Implementation

Hardware

Fig 6: Hardware modification to Codan 6810

Fig 6 shows the small module on prototype board carrying the ATTiny44 MCU, AD9833 module and low pass filter. The channel signals are picked up from the resistive dividers at left and fed to a SIL header connector on the DDS board. The output from the DDS board LPF (top end of board) is fed to the original crystal oscillator input and a 200Ω resistor provides the required termination of the low pass filter.

In this radio, only the first eight channels were fitted with bandpass filters, so it can only be equipped with eight channels.

Fig 7: Front panel of Codan 6810 fitted with eight channel DDS

Fig 7 shows the front panel labelled for the channels. Readers will note that this radio also has the optional RF Gain control fitted.

Example EEPROM configuration

The register values to be loaded into the AD9833 were calculated in a spreadsheet.

Fig 8: Spreadsheet to calculate the AD9833register values

Fig 8 is a screen shot of the spreadsheet used to calculate AD9833 register values for each channel. The error of the 25MHz reference oscillator was measured and incorporated into the calculations for better channel accuracy... so the values are specific to THIS oscillator.

The following is an example EEPROM configuration in JSON format for input to the converter.

 
//JSON syntax does not provide comments, filter this file through jsmin to
//strip comments
/*************************************************
EEPROM data file for AD9833 for lunchbox radio - low side osc
Bruce Boardman 20200720
10.130000
3.650000
3.670000
7.045000
7.060000
7.090000
7.135000
10.120000
*************************************************/
//options: invert SCK, 1/8
{
"ver":"02",
"rbo":"",
"options":["8020","0000"],
"regs":[
["21005F1655B52000"],
["21006E94451E2000"],
["21007571452B2000"],
["21006C0A4DCF2000"],
["210061314DD92000"],
["21004B7D4DED2000"],
["21006AF04E0A2000"],
["21007BA755AE2000"]
]
}

Above is an example EEPROM configuration file for a 8 channel transmitter.

Fig 9:

Fig 9 shows the binary EEPROM image structure. The screenshot is from HHD Hex Editor Neo Ultimate using its structure viewer.

Programming utilities

Command file for AVRDUDE / USBASP

The following is an example command file, note that some defaults need adjustment to suit your own environment.

 
@echo off
if *%1==* goto usage

rem override
set PRG=usbasp
set DEVICE=t44
set PORT=usb
rem note -B requires latest (2011) USBASP firmware
set OPTS=-B 5
set AVRDUDE=avrdude

if *%2==* goto eeprom
if *%2==** goto eeprom
set FLASH=%2
if *%2==*# set FLASH=d:\src\PllLdr\PllLdr\Release\pllldr.hex

echo program flash (%FLASH%)...
echo "%AVRDUDE%" %OPTS% -c %PRG% -P %PORT% -p %DEVICE% -U flash:w:"%FLASH%":i
"%AVRDUDE%" %OPTS% -c %PRG% -P %PORT% -p %DEVICE% -U flash:w:"%FLASH%":i
timeout /nobreak /t 1 >nul

:eeprom
if *%1==** goto fuse
echo program eeprom (%1)...
echo "%AVRDUDE%" %OPTS% -c %PRG% -P %PORT% -p %DEVICE% -U eeprom:w:"%1":i 
"%AVRDUDE%" %OPTS% -c %PRG% -P %PORT% -p %DEVICE% -U eeprom:w:%1:i 
timeout /nobreak /t 1 >nul

:fuse
if not *%3==*fuse goto cleanup
echo program fuses ...
"%AVRDUDE%" %OPTS% -c %PRG% -P %PORT% -p %DEVICE% -U hfuse:w:0xD4:m -U lfuse:w:0xe2:m efuse:w:0xfe:m
timeout /nobreak /t 1 >nul

:usage
echo usage: %~n0 eepromfile flashfile fuse
goto end

:cleanup
:end

Links

Credit

Credit to Bruce Boardman (VK4MQ) for the construction / implementation work, some pics and schematic.

Changes

Version Date Description
1.01 23/07/2020 Initial.
1.02    
1.03    
1.04    
1.05    

© Copyright: Owen Duffy 1995, 2021. All rights reserved. Disclaimer.