AnsweredAssumed Answered

AD5932 Programming/Frequencies

Question asked by armstrongwi on Apr 21, 2017
Latest reply on Apr 25, 2017 by musach

I am having trouble programming my AD5932

 

I am using an Arduino Mega board to load the program to the chip.  I need it to output a sine wave starting at 100kHz and end at 10MHz with the step intervals initiated by the CTRL pin.  I have written the following code:

 

int fsync = 53;
pinMode (fsync, OUTPUT);

digitalWrite (fsync,HIGH);
SPI.begin();
SPI.setBitOrder(MSBFIRST);
digitalWrite(fsync,LOW);
delay(200);

//Control bits

SPI.transfer(0b00000110);
delay(200);
SPI.transfer(0b11110011);
delay(200);

 

//Start frequency (lower bits)
SPI.transfer(0b11000110);
delay(200);
SPI.transfer(0b10100000);
delay(200);

 

//Start frequency (higher bits)
SPI.transfer(0b11010000);
delay(200);
SPI.transfer(0b00011000);
delay(200);

 

//Delta frequency (lower bits)
SPI.transfer(0b00101001);
delay(20);
SPI.transfer(0b01110010);
delay(20);

 

//Delta frequency (higher bits)
SPI.transfer(0b00110000);
delay(20);
SPI.transfer(0b00000000);
delay(20);

 

//Number of increments
SPI.transfer(0b00011111);
delay(20);
SPI.transfer(0b11111111);
delay(20);

 

digitalWrite(fsync,HIGH);
delay(20);

 

When this is run the AD5932 will output a sine wave with a frequency of approximately 30kHz and won't step when the CTRL pin is triggered.

Outcomes