can't get work ad9951

Hi, i'm using stm32f4 with connected to it ad9951
connection similar to this http://www.dl5mgd.de/dds/Bilder/Ad9951.png
generator i'm using 20 mhz and without bc848 (no reset inversion)

in short here is the code that i'm using

#define DDS_SYS_CLOCK 40000 //400.00 mhz we don't need more zeros
const float ftw_c = (float)0xFFFFFFFF/(float)DDS_SYS_CLOCK; // (2^32 -1)/DDS_SYS_CLOCK
uint16_t freq = 8750; //output frequency 87.50mhz same format as DDS_SYS_CLOCK

//dds reset pin down
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_2, GPIO_PIN_RESET);
//io upd down
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, GPIO_PIN_RESET);
//reset dds
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_2, GPIO_PIN_SET);
HAL_Delay(100);//delay 100 ms
HAL_GPIO_WritePin(GPIOD, GPIO_PIN_2, GPIO_PIN_RESET);
HAL_Delay(100);

uint8_t second_reg[4] = {0x01, 0x00, 0x00, 0xA7};//mutliplier 20, vco range 1, pump 150 uA
//transmit 4 bytes, timeout 1 sec
HAL_SPI_Transmit(&hspi3, second_reg, 4, 1000);
//io update
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, GPIO_PIN_SET);
HAL_Delay(1);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, GPIO_PIN_RESET);

ftw = (uint32_t)(ftw_c * (float)freq); //frequency tuning word = constant(2^32/dds_sys_clock) * needed frequency

uint8_t spibuf[5] = {0x04, ((ftw>>24)&0xFF), ((ftw>>16)&0xFF), ((ftw>>8)&0xFF), (ftw&0xFF)};

HAL_SPI_Transmit(&hspi3, spibuf, 5, 1000);
//io update
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, GPIO_PIN_SET);
HAL_Delay(1);
HAL_GPIO_WritePin(GPIOA, GPIO_PIN_15, GPIO_PIN_RESET);

but i only get some aliaces in range 170 - 175 mhz

Parents Reply Children
No Data