AnsweredAssumed Answered

AD9912 SPI on Atmel AVR

Question asked by divyansh on Jan 18, 2013
Latest reply on Jan 24, 2013 by LouijieC


I have been trying to set a SPI for AD9912 but , I have failed to do so.I have used AD9912 previously but using bit banging not through any digital bus.Now ,I need to transfer data to see a sweep pattern at 10 hz having at least 100 points.I have read a similar post on PIC  but I am unable to get this through.Is it so that the SPI of AD9912 is not a standard one ??


What is the best way to send frequency very quickly through its Serial Interface ?

  • Improvised routine on Two wire interface. ? (Not Tried)
  • Sending bits in streams of data - done but takes time
  • Sending data on SPI bus in mode 0 - not working


I have written following function in Codevision/AVR studio  AVR for ATmega32A using SPI library at spi-on-an-avr


extern void spi(char data);
//Transfers data to MOSI 
//SPI mode(0) - Sample(rising) / Setup(falling)

void write_byte(unsigned char data,unsigned int addr)
int i;
unsigned char temp_addr=((addr&0x1f00)>>8);
spi(temp_addr); //MSB
toggle_io(); //0-1-0





CSB ~ (SS!)

SDO - not connected



It can be done another part number, but I think its possible using this part number only.If I am missing any part that you think is important kindly let me know.


Thanks and Regards,

Divyansh gupta