AD9910 RAM file how to  - Page 1
Forum section: electronics / general

author: BeO
author_rank: Contributor
timestamp: September 02, 2017, 09:25:39 am
content: HelloI try to built a RAM file for an AD9910 , factory documentation do not include clear examples , I have the evaluation software with sample files but they have any comments in themDoes someone is able to provide me RAM file with comments to be able to understand how is built a RAM file in decimalThanks in advanceBeO

author: ale500
author_rank: Frequent Contributor
timestamp: September 04, 2017, 01:52:27 pm
content: Very interesting DDS, Did you try the software provided with the evaluation board ? Nothing useful there ? (I have only used ROM-based DDS so far).http://www.analog.com/media/en/evaluation-boards-kits/evaluation-software/AD9910Setup2.1.0.0.exe

author: Unknown
author_rank: Unknown
timestamp: September 05, 2017, 12:17:26 am
content: Check out the two files inthis AD forum answer. The .stp file contains the config; although it's not documented/commented there file, the 'regmap' is as explained in the AD9910 datasheet in pp49-60, MSB-first.E.g. in that .stp file, line 5:"00","10000000000000000000000000000000" // CFR1 (addr 0x00) set bit 31 (enable RAM functionality) = 1, etc(You'll also want to look at bits set / not set in the RAM / Single Tone profiles in register addresses 0x0E - 0x15)The .txt file contains the RAM data, which is straight 32 bit tuning words (or phase/amplitude data if in RAM modulation mode)It's all in hex & binary though - learn to think in hex or bin, or at least find a good decimal converter/calculator. You won't get far and will make far too many mistakes, especially with a slightly complicated DDS like this, if you insist on sticking to decimal...

author: BeO
author_rank: Contributor
timestamp: September 07, 2017, 10:58:00 am
content: HelloI have the AD9910 software as provided by AnalogI succeed to download RAM samples files and get the right wave shape on my oscilloscopeRegarding file as a extract here after ( square ramped wave ) , that not Hexa as I have 9 and that not binary but AD9910 doc says that decimal are also allowed34359738373403761583337154932833393370733307124818327491256432427003093210488054317827580031460635453113851290308163903530494267813017214526298500227129527900160000000000000000I try to adjust amplitude but I do not know which parameter to changeThat quite incredible to do have any documented sample on the net and Analog documentation is quite light for a so powerfull component.BeO

author: GRA
author_rank: Newbie
timestamp: June 13, 2020, 11:44:22 am
content: For a long time RAM on the DDS AD9910 did not work for me. I bought a DDS9910 board on an eBayhttps://www.ebay.com/itm/163923312245board a from GRA & AFCH. I tried the Chinese boards on the AD9910 - it was a terrible experience, a lot of spur, there were also some short circuits on the board.For a long time RAM on the DDS AD9910 did not work for me. I bought a DDS9910 board on an eBay board a from GRA & AFCH. I tried the Chinese boards on the AD9910 - it was a terrible experience, a lot of spur, there were also some short circuits on the board.Here is an example of how FM modulation works through RAM. I have to say right away very important sequence !!!/*****************************************************************************************SaveFM_WavesToRAM - calculate and store FM waves to RAMInput data:* F_carrier - frequency carrier Hz* F_mod - frequency modulations Hz* F_dev - frequency deviations Hz*****************************************************************************************/void SaveFMWavesToRAM (uint32_t F_carrier, uint32_t F_mod, uint32_t F_dev){#define TWO_POWER_32 4294967296.0 //2^32uint64_t Step_Rate;uint16_t Step;uint16_t n;double Deg;double Rad;double Sin=0;double DegIncrement=0;uint32_t FREQ_FM=0;uint32_t FTW_FM=0;uint8_t FTW_FM_8_bit;Step=DEFAULT_STEP_VALUE;Step_Rate=0;calcBestStepRate(&Step, &Step_Rate, F_mod);PrepRegistersToSaveWaveForm(Step_Rate, Step);DegIncrement=360.0/Step;//*************************************************************************Deg = 0; // start set degHAL_GPIO_WritePin(DDS_SPI_CS_GPIO_PORT, DDS_SPI_CS_PIN, GPIO_PIN_RESET);uint8_t MemAdr=RAM_Start_Word;HAL_SPI_Transmit(&hspi1, &MemAdr, 1, 1000);uint32_t RealDDSCoreClock=CalcRealDDSCoreClockFromOffset();float64_t f64FREQ_FM;//=f64(FREQ_FM);float64_t f64CoreClock=f64(RealDDSCoreClock);float64_t TwoPower32=f64(4294967295UL);float64_t f64FTW;bool a;uint_fast8_t softfloat_roundingMode;softfloat_roundingMode=softfloat_round_near_maxMag;for (n = 0; n < Step; n++){//Rad = Deg * 0.01745; // conversion from degrees to radians RAD=DEG*Pi/180Rad = Deg * PI/180.0;Sin = sin(Rad); // Get SinusFREQ_FM = F_carrier + (F_dev * Sin);//FTW_FM = round((double)TWO_POWER_32 * ((double)FREQ_FM / (double)DDS_Core_Clock));f64FREQ_FM=f64(FREQ_FM);f64FTW=f64_div(TwoPower32, f64CoreClock);f64FTW=f64_mul(f64FTW, f64FREQ_FM);FTW_FM=f64_to_ui32(f64FTW, softfloat_roundingMode, a);FTW_FM_8_bit=(FTW_FM>>24);FTW_FM_8_bit=(FTW_FM>>16);FTW_FM_8_bit=(FTW_FM>>;FTW_FM_8_bit=FTW_FM;HAL_SPI_Transmit(&hspi1, FTW_FM_8_bit, 4, 1000);Deg = Deg + DegIncrement;}HAL_GPIO_WritePin(DDS_SPI_CS_GPIO_PORT, DDS_SPI_CS_PIN, GPIO_PIN_SET);DDS_UPDATE();Serial.println("FM wave saved to RAM...");PlaybackFMFromRAM(A*-1);}void PlaybackFMFromRAM(int16_t Amplitude_dB){//*** RAM Enable ***HAL_GPIO_WritePin(DDS_SPI_CS_GPIO_PORT, DDS_SPI_CS_PIN, GPIO_PIN_RESET);strBuffer = CFR1_addr;strBuffer = RAM_Playback_Frequency | RAM_enable;// | RAM_enable;//0x00; RAM_Playback_Amplitude;//strBuffer = 0;//Continuous_Profile_0_1; //0;//0x80;//0x00;strBuffer = OSK_enable;// | Select_auto_OSK;//0x00;strBuffer = SDIO_input_only ;HAL_SPI_Transmit(&hspi1, (uint8_t*)strBuffer, 5, 1000);HAL_GPIO_WritePin(DDS_SPI_CS_GPIO_PORT, DDS_SPI_CS_PIN, GPIO_PIN_SET);DDS_UPDATE();uint16_t AmplitudeRegistersValue=(uint16_t)powf(10,(Amplitude_dB+84.288)/20.0);//AmplitudeRegistersValue=AmplitudeRegistersValue<<2;HAL_GPIO_WritePin(DDS_SPI_CS_GPIO_PORT, DDS_SPI_CS_PIN, GPIO_PIN_RESET);strBuffer = ASF_addr;strBuffer = 0x00;strBuffer = 0x00;strBuffer = AmplitudeRegistersValue >> 6; //15:8AmplitudeRegistersValue = AmplitudeRegistersValue << 2;AmplitudeRegistersValue = AmplitudeRegistersValue & B11111100;strBuffer = AmplitudeRegistersValue; //7:2HAL_SPI_Transmit(&hspi1, (uint8_t*)strBuffer, 5, 1000);HAL_GPIO_WritePin(DDS_SPI_CS_GPIO_PORT, DDS_SPI_CS_PIN, GPIO_PIN_SET);DDS_UPDATE();}