Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente Dernière révision Les deux révisions suivantes | ||
materiel:ad9850:accueil [2015/02/18 18:15] resonance |
materiel:ad9850:accueil [2015/02/18 21:46] resonance [Avec Arduino] |
||
---|---|---|---|
Ligne 1: | Ligne 1: | ||
====== AD9850 ====== | ====== AD9850 ====== | ||
+ | {{: | ||
+ | Générateur de signaux sinusoïdaux ou carré. | ||
+ | {{youtube> | ||
+ | ===== Datasheet ===== | ||
+ | * {{: | ||
+ | * 2 sine wave and 2 square wave output (mais tous avec la même fréquence !) | ||
+ | * AD9850: 0-40MHz | ||
+ | * After the 20-30MHz frequency harmonics increases, the waveform will be less and less clean | ||
+ | * Square Wave: 0-1MHz | ||
+ | * Low-pass filter with 70MHz, so the waveform better than SN | ||
+ | * Parallel and serial data input can be selected via a jumper | ||
+ | * DA produced the benchmark pin (PIN12) leads for easy adjustment to do the magnitude of the output waveform Application | ||
+ | * Comparator reference input voltage generated by the variable resistor, the resistor can be adjusted duty cycle square wave of different | ||
+ | * Active AD9850 125MHz crystal oscillator modules | ||
+ | |||
+ | ===== Avec Arduino ===== | ||
+ | * https:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | * http:// | ||
+ | |||
+ | |||
+ | ==== Connection ==== | ||
+ | Il suffit de 6 fils. | ||
+ | |||
+ | | **ARDUINO** | **AD9850** | | ||
+ | | 5V | VCC | | ||
+ | | GND | GND | | ||
+ | | 8 | W_CLK | | ||
+ | | 9 | FQ_UD | | ||
+ | | 10 | DATA | | ||
+ | | 11 | RESET | | ||
+ | |||
+ | {{: | ||
+ | |||
+ | ==== Code Arduino pour deux modules ==== | ||
+ | |||
+ | **Sans librairie à installer** ++++ Voir le code | | ||
+ | <code c> | ||
+ | /* | ||
+ | * USE TWO AD9850 | ||
+ | * Modified from http:// | ||
+ | */ | ||
+ | |||
+ | // 1st MODULE | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | // 2nd MODULE | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | # | ||
+ | |||
+ | # | ||
+ | |||
+ | // transfers a byte, a bit at a time, LSB first to the 9850 via serial DATA line | ||
+ | void tfr_byte(byte data, int pin_clock, int pin_data) | ||
+ | { | ||
+ | for (int i=0; i<8; i++, data>> | ||
+ | digitalWrite(pin_data, | ||
+ | pulseHigh(pin_clock); | ||
+ | } | ||
+ | } | ||
+ | |||
+ | // frequency calc from datasheet page 8 = <sys clock> * < | ||
+ | void sendFrequency(double frequency, int pin_clock, int pin_fq, int pin_data) { | ||
+ | int32_t freq = frequency * 4294967295/ | ||
+ | for (int b=0; b<4; b++, freq>> | ||
+ | tfr_byte(freq & 0xFF, pin_clock, pin_data); | ||
+ | } | ||
+ | tfr_byte(0x000, | ||
+ | pulseHigh(pin_fq); | ||
+ | } | ||
+ | |||
+ | void setup() { | ||
+ | // configure arduino data pins for output | ||
+ | pinMode(FQ_UD, | ||
+ | pinMode(W_CLK, | ||
+ | pinMode(DATA, | ||
+ | pinMode(RESET, | ||
+ | | ||
+ | pinMode(FQ_UD2, | ||
+ | pinMode(W_CLK2, | ||
+ | pinMode(DATA2, | ||
+ | pinMode(RESET2, | ||
+ | |||
+ | pulseHigh(RESET); | ||
+ | pulseHigh(W_CLK); | ||
+ | pulseHigh(FQ_UD); | ||
+ | | ||
+ | pulseHigh(RESET2); | ||
+ | pulseHigh(W_CLK2); | ||
+ | pulseHigh(FQ_UD2); | ||
+ | } | ||
+ | |||
+ | void loop() { | ||
+ | sendFrequency(1320, | ||
+ | sendFrequency(440, | ||
+ | |||
+ | while(1); | ||
+ | } | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | **Avec la librairie [[http:// | ||
+ | ++++ Voir le code | | ||
+ | <code c> | ||
+ | // from http:// | ||
+ | |||
+ | #include < | ||
+ | |||
+ | #define CLK 6 | ||
+ | #define FQUP 7 | ||
+ | #define BitData 8 | ||
+ | #define RESET 9 | ||
+ | |||
+ | AH_AD9850 AD9850(CLK, FQUP, BitData, RESET); | ||
+ | |||
+ | void setup() | ||
+ | { | ||
+ | AD9850.reset(); | ||
+ | delay(1000); | ||
+ | AD9850.powerDown(); | ||
+ | | ||
+ | // initialize serial communication | ||
+ | Serial.begin(9600); | ||
+ | } | ||
+ | |||
+ | void loop(){ | ||
+ | |||
+ | // | ||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | | ||
+ | | ||
+ | |||
+ | |||
+ | // | ||
+ | for (int phase=0; | ||
+ | { | ||
+ | | ||
+ | | ||
+ | } | ||
+ | |||
+ | } | ||
+ | </ | ||
+ | ++++ | ||
+ | |||
+ | |||
+ | ===== Modulation ===== | ||
+ | Deux signaux modulés par une porte ET : \\ | ||
+ | {{: | ||
+ | |||
+ | |||
+ | Le schéma de la porte ET avec deux diodes et une résistance (merci Patrick!)\\ | ||
+ | {{: | ||
+ | |||
+ | ===== Signal carré ===== | ||
+ | Il faut modifier le "duty cycle" du signal carré avec le potentiomètre. | ||
+ | |||
+ | {{: | ||
- | {{: |