標題: AD9708 High freq Dac Library [打印本頁]

作者: mm.rad    時間: 2018-4-27 21:37
標題: AD9708 High freq Dac Library
ad9708 high freq dac
written with arduino and codevision


單片機源程序如下:
  1. uint8_t data[256]={128,131,134,137,140,143,146,149,152,156,159,162,165,168,171,174,176,179,182,185,188,191,193,196,199,201,204,206,209,211,213,216,218,220,222,224,226,228,230,232,234,235,237,239,240,242,243,244,246,247,248,249,250,251,251,252,253,253,254,254,254,255,255,255,255,255,255,255,254,254,253,253,252,252,251,250,249,248,247,246,245,244,242,241,239,238,236,235,233,231,229,227,225,223,221,219,217,215,212,210,207,205,202,200,197,195,192,189,186,184,181,178,175,172,169,166,163,160,157,154,151,148,145,142,138,135,132,129,126,123,120,117,113,110,107,104,101,98,95,92,89,86,83,80,77,74,71,69,66,63,60,58,55,53,50,48,45,43,40,38,36,34,32,30,28,26,24,22,20,19,17,16,14,13,11,10,9,8,7,6,5,4,3,3,2,2,1,1,0,0,0,0,0,0,0,1,1,1,2,2,3,4,4,5,6,7,8,9,11,12,13,15,16,18,20,21,23,25,27,29,31,33,35,37,39,42,44,46,49,51,54,56,59,62,64,67,70,73,76,79,81,84,87,90,93,96,99,103,106,109,112,115,118,121,124,127};
  2. uint8_t i;
  3. void setup() {
  4.   // put your setup code here, to run once:

  5.   
  6. DDRB=0x08;
  7. DDRD=0xFF;
  8. // Timer/Counter 2 initialization
  9. // Clock source: System Clock
  10. // Clock value: 16000.000 kHz
  11. // Mode: CTC top=OCR2A
  12. // OC2A output: Toggle on compare match
  13. // OC2B output: Disconnected
  14. // Timer Period: 2 us
  15. // Output Pulse(s):
  16. // OC2A Period: 4 us Width: 2 us
  17. ASSR=(0<<EXCLK) | (0<<AS2);
  18. TCCR2A=(0<<COM2A1) | (1<<COM2A0) | (0<<COM2B1) | (0<<COM2B0) | (1<<WGM21) | (0<<WGM20);
  19. TCCR2B=(0<<WGM22) | (0<<CS22) | (0<<CS21) | (1<<CS20);
  20. TCNT2=0x00;
  21. OCR2A=0x07;
  22. OCR2B=0x00;
  23. }

  24. void loop() {
  25.   // put your main code here, to run repeatedly:
  26. PORTD=data[i++];
  27. //delayMicroseconds(100);
  28. //delay(1);
  29. }
復制代碼

所有資料51hei提供下載:
ad9708.rar (51.63 KB, 下載次數(shù): 12)





作者: mm.rad    時間: 2018-4-27 21:40
uno due atmega8




歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1