NM500 / NeuroShield

Dependents:   NeuroShield_SimpleScript NeuroShield_andIMU NeuroShield_Gesture_Recognition

Revision:
3:6163399b611e
Parent:
2:2812bcbcaaea
--- a/NeuroShieldSPI.cpp	Fri Jun 22 06:17:56 2018 +0000
+++ b/NeuroShieldSPI.cpp	Tue Feb 11 00:48:18 2020 +0000
@@ -32,7 +32,8 @@
  */
 
 /*
- * Revision History (v1.1.4)
+ * Revision History (v1.1.5)
+ * 2020/02/04    v1.1.5    Add dummy for switching between sd-card and nm spi
  * 2018/06/22    v1.1.4    Minor changes
  * 2018/01/03    v1.1.3    Add burst-mode read
  * 2017/12/20    v1.1.2    Modify the structure of neurondata
@@ -91,6 +92,8 @@
 {
     //device.lock();
     
+    device.write(0xff);                     // dummy for switching between sd-card and nm spi
+    
     nm500_ss = LOW;
     device.write(1);                        // Dummy for ID
     device.write((uint8_t)module_nm500);
@@ -113,6 +116,8 @@
 {
     //device.lock();
     
+    device.write(0xff);                                 // dummy for switching between sd-card and nm spi
+    
     nm500_ss = LOW;
     device.write(1);
     device.write((uint8_t)module_nm500);
@@ -139,6 +144,8 @@
 {
     //device.lock();
     
+    device.write(0xff);                                 // dummy for switching between sd-card and nm spi
+    
     nm500_ss = LOW;
     device.write(1);                                    // Dummy for ID
     device.write((uint8_t)(module_nm500 + 0x80));       // module and write flag
@@ -171,6 +178,8 @@
     
     //device.lock();
     
+    device.write(0xff);                             // dummy for switching between sd-card and nm spi
+    
     nm500_ss = LOW;
     device.write(1);                                // Dummy for ID
     device.write((uint8_t)(module_nm500 + 0x80));   // module and write flag
@@ -199,6 +208,8 @@
     
     //device.lock();
     
+    device.write(0xff);                             // dummy for switching between sd-card and nm spi
+    
     nm500_ss = LOW;
     device.write(1);                                // Dummy for ID
     device.write((uint8_t)(module_nm500 + 0x80));   // module and write flag
@@ -227,9 +238,11 @@
 {
     //device.lock();
     
+    device.write(0xff);                     // dummy for switching between sd-card and nm spi
+    
     nm500_ss = LOW;
     device.write(1);                        // Dummy for ID
-    device.write((uint8_t)module_fpga);   // address (4-byte)
+    device.write((uint8_t)module_fpga);     // address (4-byte)
     device.write(0);
     device.write(0);
     device.write(1);                        // version check : 0x01
@@ -252,6 +265,8 @@
 {
     //device.lock();
     
+    device.write(0xff);                             // dummy for switching between sd-card and nm spi
+    
     nm500_ss = LOW;
     device.write(1);                                // Dummy for ID
     device.write((uint8_t)(module_fpga + 0x80));    // address (4-byte)
@@ -275,6 +290,8 @@
 {
     //device.lock();
     
+    device.write(0xff);                             // dummy for switching between sd-card and nm spi
+    
     nm500_ss = LOW;
     device.write(1);                                // Dummy for ID
     device.write((uint8_t)(module_led + 0x80));     // address (4-byte)