This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

3 wire spi isnterfacing to AD9837

hello, I am working on nRF52 DK spi protocal.I am using AD9837 as slave.Here i am using 3 wire interfacing.I am connecting Sclk,ssn,MOSI pins olny & I am not connecting MISo pin.The AD9837 is a wave generator(sine wave,Square wave &Trriangle vave generator).The commands for generating as follows(here 16MHZ cmos crystal is used in the slave circuit) 0x0100 -----Reset 0x2100 -----control register 0x5A37 ------Lsb & output frequency is 400 hz 0x4000 ------Msb 0xC000 ------Phase register 0x2000--------sine wave generation

This commands will send byte wise i.e, first high byte next low byte & it will working in Aurdino board.But there is no wave form generation in nRF52 DK .In aurdino these commands are taken as integer value & each command has 2 bytes & these commands sends byte wise .for every command making ssn pin to low then send the command 2 times(one for high byte & other for low byte). After sending the command we can set ssn pin to high (every time).This will working fine in aurdino .But in nrf52DK the command will taken as character array only .For sending the command i am sending the following sequence. static uint8_t m_tx_buf1[] = {0x01,0x00};
static uint8_t m_tx_buf2[] = {0x21,0x00}; like this the following commands are declare.I am sending these command like this

nrf_drv_spi_transfer(&spi, m_tx_buf, 02, NULL, NULL));

i am enclosing the the data sheet of ad9837 & modifided spi code please go through. I am not getting wave generation. Can any please help me to find & resolve the issue.spi 3 wire interface.c

Related