AD9954 DDS (Direct Digital Synthesizer)

Functions to control the Analog Devices AD9954 DDS. More...


Defines

#define DDS_AD9954_CFR1   0x00
 AD9954 CFR1 - Control functions including RAM, profiles, OSK, sync, sweep, SPI, and power control settings.
#define DDS_AD9954_CFR2   0x01
 AD9954 CFR2 - Control functions including sync, PLL multiplier, VCO range, and charge pump current.
#define DDS_AD9954_ASF   0x02
 AD9954 ASF - Auto ramp rate speed control and output scale factor (0x0000 to 0x3fff).
#define DDS_AD9954_ARR   0x03
 AD9954 ARR - Amplitude ramp rate for OSK function.
#define DDS_AD9954_FTW0   0x04
 AD9954 FTW0 - Frequency tuning word 0.
#define DDS_AD9954_FTW1   0x06
 AD9954 FTW1 - Frequency tuning word 1.
#define DDS_AD9954_NLSCW   0x07
 AD9954 NLSCW - Negative Linear Sweep Control Word used for spectral shaping in FSK mode.
#define DDS_AD9954_PLSCW   0x08
 AD9954 PLSCW - Positive Linear Sweep Control Word used for spectral shaping in FSK mode.
#define DDS_AD9954_RWCW0   0x07
 AD9954 RSCW0 - RAM Segment Control Word 0.
#define DDS_AD9954_RWCW1   0x08
 AD9954 RSCW0 - RAM Segment Control Word 1.
#define DDS_RAM   0x0b
 AD9954 RAM segment.
#define DDS_FREQ_TO_FTW_DIGITS   9
 Number of digits in DDS frequency to FTW conversion.

Functions

void ddsInit ()
 Initialize the DDS regsiters and RAM.
void ddsSetOutputScale (uint16_t scale)
 Set DDS amplitude value in the range 0 to 16383 where 16383 is full scale.
void ddsSetAmplitude (uint8_t amplitude)
 Set the DDS amplitude in units of dBc of full scale where 1 is 0.1 dB.
void ddsSetFTW (uint32_t ftw)
 Set DDS frequency tuning word.
void ddsSetFreq (uint32_t freq)
 Convert frequency in hertz to 32-bit DDS FTW (Frequency Tune Word).
void ddsSetFSKFreq (uint32_t ftw0, uint32_t ftw1)
 Set DDS frequency tuning word for the FSK 0 and 1 values.
void ddsSetMode (DDS_MODE mode)
 Set the DDS to run in A-FSK, FSK, or PSK31 mode.

Variables

DDS_MODE ddsMode
 Current operational mode.
const uint32_t DDS_MULT [DDS_FREQ_TO_FTW_DIGITS] = { 11, 7, 7, 3, 4, 8, 4, 9, 1 }
 Array of multiplication factors used to convert frequency to the FTW.
const uint32_t DDS_DIVISOR [DDS_FREQ_TO_FTW_DIGITS-1] = { 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000 }
 Array of divisors used to convert frequency to the FTW.
const uint16_t DDS_AMP_TO_SCALE []
 Lookup table to convert dB amplitude scale in 0.5 steps to a linear DDS scale factor.
const uint32_t freqTable [256]
 Frequency Word List - 4.0KHz FM frequency deviation at 81.15MHz (445.950MHz).


Detailed Description

Functions to control the Analog Devices AD9954 DDS.

Define Documentation

#define DDS_AD9954_ARR   0x03

AD9954 ARR - Amplitude ramp rate for OSK function.

Definition at line 798 of file PicoBeacon.c.

Referenced by ddsInit().

#define DDS_AD9954_ASF   0x02

AD9954 ASF - Auto ramp rate speed control and output scale factor (0x0000 to 0x3fff).

Definition at line 795 of file PicoBeacon.c.

Referenced by ddsSetOutputScale().

#define DDS_AD9954_CFR1   0x00

AD9954 CFR1 - Control functions including RAM, profiles, OSK, sync, sweep, SPI, and power control settings.

Definition at line 789 of file PicoBeacon.c.

Referenced by ddsSetMode().

#define DDS_AD9954_CFR2   0x01

AD9954 CFR2 - Control functions including sync, PLL multiplier, VCO range, and charge pump current.

Definition at line 792 of file PicoBeacon.c.

Referenced by ddsInit().

#define DDS_AD9954_FTW0   0x04

AD9954 FTW0 - Frequency tuning word 0.

Definition at line 801 of file PicoBeacon.c.

Referenced by ddsSetFSKFreq(), and ddsSetFTW().

#define DDS_AD9954_FTW1   0x06

AD9954 FTW1 - Frequency tuning word 1.

Definition at line 804 of file PicoBeacon.c.

Referenced by ddsSetFSKFreq().

#define DDS_AD9954_NLSCW   0x07

AD9954 NLSCW - Negative Linear Sweep Control Word used for spectral shaping in FSK mode.

Definition at line 807 of file PicoBeacon.c.

Referenced by ddsSetMode().

#define DDS_AD9954_PLSCW   0x08

AD9954 PLSCW - Positive Linear Sweep Control Word used for spectral shaping in FSK mode.

Definition at line 810 of file PicoBeacon.c.

Referenced by ddsSetMode().

#define DDS_AD9954_RWCW0   0x07

AD9954 RSCW0 - RAM Segment Control Word 0.

Definition at line 813 of file PicoBeacon.c.

#define DDS_AD9954_RWCW1   0x08

AD9954 RSCW0 - RAM Segment Control Word 1.

Definition at line 816 of file PicoBeacon.c.

#define DDS_FREQ_TO_FTW_DIGITS   9

Number of digits in DDS frequency to FTW conversion.

Definition at line 825 of file PicoBeacon.c.

Referenced by ddsSetFreq().

#define DDS_RAM   0x0b

AD9954 RAM segment.

Definition at line 819 of file PicoBeacon.c.


Function Documentation

void ddsInit (  ) 

Initialize the DDS regsiters and RAM.

Definition at line 882 of file PicoBeacon.c.

References DDS_AD9954_ARR, DDS_AD9954_CFR2, DDS_MODE_NOT_INITIALIZED, DDS_MODE_POWERDOWN, ddsMode, ddsSetMode(), ddsSetOutputScale(), IO_CS, and IO_UPDATE.

Referenced by main().

Here is the call graph for this function:

void ddsSetAmplitude ( uint8_t  amplitude  ) 

Set the DDS amplitude in units of dBc of full scale where 1 is 0.1 dB.

For example, a value of 30 is 3dBc or a value of 85 is 8.5dBc.

Parameters:
amplitude in 0.1 dBc of full scale

Definition at line 945 of file PicoBeacon.c.

References DDS_AMP_TO_SCALE, ddsSetOutputScale(), and IO_OSK.

Referenced by diagPort().

Here is the call graph for this function:

void ddsSetFreq ( uint32_t  freq  ) 

Convert frequency in hertz to 32-bit DDS FTW (Frequency Tune Word).

Parameters:
freq frequency in Hertz

Definition at line 991 of file PicoBeacon.c.

References DDS_DIVISOR, DDS_FREQ_TO_FTW_DIGITS, DDS_MULT, and ddsSetFTW().

Referenced by diagPort().

Here is the call graph for this function:

void ddsSetFSKFreq ( uint32_t  ftw0,
uint32_t  ftw1 
)

Set DDS frequency tuning word for the FSK 0 and 1 values.

The output frequency is equal to RefClock * (ftw / 2 ^ 32).

Parameters:
ftw0 frequency tuning word for the FSK 0 value
ftw1 frequency tuning word for the FSK 1 value

Definition at line 1012 of file PicoBeacon.c.

References DDS_AD9954_FTW0, DDS_AD9954_FTW1, IO_CS, and IO_UPDATE.

Referenced by tncSetMode().

void ddsSetFTW ( uint32_t  ftw  ) 

Set DDS frequency tuning word.

The output frequency is equal to RefClock * (ftw / 2 ^ 32).

Parameters:
ftw Frequency Tuning Word

Definition at line 967 of file PicoBeacon.c.

References DDS_AD9954_FTW0, IO_CS, and IO_UPDATE.

Referenced by ddsSetFreq(), and timeUpdate().

void ddsSetMode ( DDS_MODE  mode  ) 

Set the DDS to run in A-FSK, FSK, or PSK31 mode.

Parameters:
mode DDS_MODE_APRS, DDS_MODE_PSK31, or DDS_MODE_HF_APRS constant

Definition at line 1046 of file PicoBeacon.c.

References DDS_AD9954_CFR1, DDS_AD9954_NLSCW, DDS_AD9954_PLSCW, DDS_MODE_AFSK, DDS_MODE_FSK, DDS_MODE_POWERDOWN, ddsMode, IO_CS, and IO_UPDATE.

Referenced by ddsInit(), diagPort(), tnc1200TimerTick(), and tncSetMode().

void ddsSetOutputScale ( uint16_t  scale  ) 

Set DDS amplitude value in the range 0 to 16383 where 16383 is full scale.

This value is a linear multiplier and needs to be scale for RF output power in log scale.

Parameters:
scale in the range 0 to 16383

Definition at line 923 of file PicoBeacon.c.

References DDS_AD9954_ASF, IO_CS, and IO_UPDATE.

Referenced by ddsInit(), and ddsSetAmplitude().


Variable Documentation

Initial value:

 
{ 
    16383, 15467, 14601, 13785, 13013, 12286, 11598, 10949, 10337, 9759, 9213, 8697, 
    8211, 7752, 7318, 6909, 6522, 6157, 5813, 5488, 5181, 4891, 4617, 4359, 4115, 3885, 3668, 3463, 
    3269, 3086, 2913, 2750, 2597, 2451, 2314, 2185, 2062, 1947, 1838, 1735, 1638 
}
Lookup table to convert dB amplitude scale in 0.5 steps to a linear DDS scale factor.

Definition at line 834 of file PicoBeacon.c.

Referenced by ddsSetAmplitude().

const uint32_t DDS_DIVISOR[DDS_FREQ_TO_FTW_DIGITS-1] = { 10, 100, 1000, 10000, 100000, 1000000, 10000000, 100000000 }

Array of divisors used to convert frequency to the FTW.

Definition at line 831 of file PicoBeacon.c.

Referenced by ddsSetFreq().

const uint32_t DDS_MULT[DDS_FREQ_TO_FTW_DIGITS] = { 11, 7, 7, 3, 4, 8, 4, 9, 1 }

Array of multiplication factors used to convert frequency to the FTW.

Definition at line 828 of file PicoBeacon.c.

Referenced by ddsSetFreq().

Current operational mode.

Definition at line 822 of file PicoBeacon.c.

Referenced by ddsInit(), and ddsSetMode().

const uint32_t freqTable[256]

Frequency Word List - 4.0KHz FM frequency deviation at 81.15MHz (445.950MHz).

Definition at line 843 of file PicoBeacon.c.

Referenced by timeUpdate().


Generated on Sun Oct 5 11:25:47 2008 for Pico Beacon by  doxygen 1.5.7