AD9833BRMZ Help to generate Sine wave with SPI interface code

Status
Not open for further replies.

rineesh

Junior Member level 1
Joined
Dec 30, 2010
Messages
16
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,414
Dear all
Please help me to generate 300kHz sine from AD9833BRMZ.
Here I have configured as per datasheet & evaluation board.
But the output is not satisfying the design .I have probed the SPI lines the function code is below.

Fmclk=5Mhz, ExpectedFout=3Mhz.

SetPinValue(FSYNC,0); //Chip select=0
usTemp = usSPITranceiveData(SPICHN2,0x2100);// Controll reg
usTemp = usSPITranceiveData(SPICHN2,0x7525);// Freq Reg LSB
usTemp = usSPITranceiveData(SPICHN2,0x4002);// Freq Reg MSB
usTemp = usSPITranceiveData(SPICHN2,0xC000);// Phase Reg=0
usTemp = usSPITranceiveData(SPICHN2,0x2000);// Exit Reset
vDelay(1);//32Mhz processor clock// 7.2uS delay
vSetPinValue(FSYNC,1); //Chip select=1;

Also we have tried with refernce a code from net & modified as follows

vSetPinValue(FSYNC,0);
usTemp = usSPITranceiveData(SPICHN2,0x2108);
usTemp = usSPITranceiveData(SPICHN2,0x7333);
usTemp = usSPITranceiveData(SPICHN2,0x4CCC);
usTemp = usSPITranceiveData(SPICHN2,0xB333);
usTemp = usSPITranceiveData(SPICHN2,0x8CCC);
usTemp = usSPITranceiveData(SPICHN2,0xC000);
usTemp = usSPITranceiveData(SPICHN2,0xE000);
usTemp = usSPITranceiveData(SPICHN2,0x2008);
vDelay(1);
vSetPinValue(FSYNC,1);


What is the wrong thing in this code?????
 

Dear poorchava

We are using STM32F103VCT6
 

Do you have a digital osciloscope? I mean can you record the transmission and check for any fault conditions?
 

Re: poorchava digital osciloscope?

We have all ready checked by logic analyzer and confirmed that the signal status of chip select data & clock.Everything working fine
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…