ADF7023-mbed

Dependencies:   mbed

Revision:
2:9958a83be730
Parent:
1:7d363b744c5f
Child:
3:09638e7d0923
diff -r 7d363b744c5f -r 9958a83be730 main.cpp
--- a/main.cpp	Mon Jun 29 08:31:00 2015 +0000
+++ b/main.cpp	Mon Jun 29 09:35:25 2015 +0000
@@ -105,12 +105,12 @@
     CS=0;
     adf.write(0xBB);
     CS=1;
-    wait(0.1);
+    wait_ms(2);
     CS=0;
     adf.write(0xFF);
     adf.write(0xFF);
     CS=1;
-    wait(0.1);    
+    wait_ms(2);    
 }
 
 void data_write()
@@ -391,14 +391,15 @@
     adf.write(0xFF);
     adf.write(0xFF);  
     CS=1;
-    wait(0.1);
+    wait_ms(2);
     // TX MODE
     CS=0;
     adf.write(0xB5);
     CS=1;
-    wait(0.1);    
+    wait_ms(20);    
     while(1)
     {
+        pool_irq();
         CS=0;
          adf.write(0x2B);
          adf.write(0x36);
@@ -406,16 +407,45 @@
     int irq2 = adf.write(0xFF);
          CS=1;    
          wait_us(500);
-         cout<<"IRQ1="<<irq1<<"irq2="<<irq2<<ENDL; 
+         cout<<irq1<<"/t"<<irq2<<ENDL; 
     }
     
 }
 
+
+void pool_irq(void){
+    
+    adf.write(0x0B);
+    adf.write(0x36);
+    adf.write(0x98);
+    
+    adf.write(0x09);
+    adf.write(0x00);
+    adf.write(0x98);
+    
+    adf.write(0x29);
+    adf.write(0x00);
+    adf.write(0x00);
+    adf.write(0x00);
+    adf.write(0x00);
+    adf.write(0xFF);
+    adf.write(0xFF);
+    
+    adf.write(0x2B);
+    adf.write(0x36);
+    adf.write(0x36);
+    adf.write(0x36);
+    adf.write(0x36);
+    adf.write(0xFF);
+    adf.write(0xFF);
+       
+    }
+
 int main()
 {
     adf.format(8,0);
     adf.frequency(1000000);
     bbram_write();
     data_write();
-    
+        
 }
\ No newline at end of file