ad9708 high freq dac
written with arduino and codevision
0.jpg (22.77 KB, 下載次數: 75)
下載附件
2018-4-28 01:33 上傳
單片機源程序如下:
- 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};
- uint8_t i;
- void setup() {
- // put your setup code here, to run once:
-
- DDRB=0x08;
- DDRD=0xFF;
- // Timer/Counter 2 initialization
- // Clock source: System Clock
- // Clock value: 16000.000 kHz
- // Mode: CTC top=OCR2A
- // OC2A output: Toggle on compare match
- // OC2B output: Disconnected
- // Timer Period: 2 us
- // Output Pulse(s):
- // OC2A Period: 4 us Width: 2 us
- ASSR=(0<<EXCLK) | (0<<AS2);
- TCCR2A=(0<<COM2A1) | (1<<COM2A0) | (0<<COM2B1) | (0<<COM2B0) | (1<<WGM21) | (0<<WGM20);
- TCCR2B=(0<<WGM22) | (0<<CS22) | (0<<CS21) | (1<<CS20);
- TCNT2=0x00;
- OCR2A=0x07;
- OCR2B=0x00;
- }
- void loop() {
- // put your main code here, to run repeatedly:
- PORTD=data[i++];
- //delayMicroseconds(100);
- //delay(1);
- }
復制代碼
所有資料51hei提供下載:
ad9708.rar
(51.63 KB, 下載次數: 12)
2018-4-27 21:35 上傳
點擊文件名下載附件
下載積分: 黑幣 -5
|