ADS1299 GPIO Control test

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
futuremax
Date:
Thu Dec 23 17:07:06 2021 +0000
Commit message:
ADS1299 GPIO Control test

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Dec 23 17:07:06 2021 +0000
@@ -0,0 +1,58 @@
+#include "mbed.h"
+// Programed by Seungchan Lee, futuremax7@gmail.com
+// 2021.07.15
+
+//Serial pc(USBTX, USBRX);
+static UARTSerial pc(USBTX, USBRX, 115200);
+
+InterruptIn drdy(D10);
+SPI ads1299(D11, D12, D13); // mosi, miso, sclk
+DigitalOut cs(D9);
+DigitalOut reset(A1);
+DigitalOut pwdn(A2);
+DigitalOut start(A0);
+ 
+int main() {
+//    pc.baud(115200);
+    
+    // GPIO Initialization
+    reset = 1;
+    pwdn = 1;
+    start = 0;    
+    cs = 1;
+ 
+    // Setup the spi for 8 bit data, high steady state clock,
+    // second edge capture, with a 1MHz clock rate
+    ads1299.format(8,1);
+    ads1299.frequency(5000000);
+    wait(0.1);
+ 
+    cs = 0;
+    ads1299.write(0x06); //RESET
+    cs = 1;
+    wait(0.5); // 100 ms
+    
+    cs = 0;
+    ads1299.write(0x11); //SDATAC
+    cs = 1;
+    wait(0.1); // 100 ms
+    
+    printf("start!!!\n");     
+    
+    while(1)
+    {
+        cs = 0;        
+        ads1299.write(0x54);
+        ads1299.write(0x00);
+        ads1299.write(0x43);
+        cs = 1;
+        wait(0.1);
+
+        cs = 0;                
+        ads1299.write(0x54);
+        ads1299.write(0x00);
+        ads1299.write(0x03);
+        cs = 1;
+        wait(0.1);       
+    }
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Dec 23 17:07:06 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file