Sonder Design Team / Memory25L16_fast

Dependents:   BlackBoard_Firmware_Fast_read_not_test

Fork of Memory by Sonder Design Team

Revision:
9:2587f246bf48
Parent:
8:6af25b9563df
Child:
10:96b5e7dcc91f
--- a/Memory.cpp	Sun Apr 15 23:19:56 2018 +0000
+++ b/Memory.cpp	Tue Apr 17 03:16:03 2018 +0000
@@ -108,20 +108,27 @@
  */
 int Memory::writeData(SPI my_spi, char buffer[], int address, int length)
 {
+    
+    //printf("\n C0 ");
     if(length>bufferSize) {
         printf("\nLength %i exceeds Max Length\n",length);
         return address;
     }
+    //printf("\n C1 ");
     for(int i =0; i<length; i++) {
         if(address%256==0) {                //Handle start and end of pages
             _cs_mem=1;
             wait_us(10);
+            //printf("\n C2 ");
+            
             //wait for the WIP bit to go low
             _cs_mem=0;                           //Selet memory
             my_spi.write(0x05);             //Send read status register command
             int byte1 = my_spi.write(dummy);//Send dummy byte to read status reg
+            //printf("\n C3 ");
             while ((byte1&1)>0) {
                 wait_us(10);
+                printf("\n C4 ");
                 my_spi.write(0x05);         //Send read status register command
                 byte1 = my_spi.write(dummy);//Send dummy byte to read status reg
             }
@@ -131,7 +138,8 @@
             my_spi.write(06);               //Set Write Enable flag in the status reg
             _cs_mem=1;
             wait_us(10);
-
+            
+            //printf("\n C5 ");
             _cs_mem=0;                           //Selet memory
             my_spi.write(02);               //Send read comand
             my_spi.write(address>>16);      //Send high address byte
@@ -139,6 +147,7 @@
             my_spi.write(address);          //Send low address
 
         }
+        //printf("\n C6 ");
         my_spi.write(buffer[i]);            //Write the calue of the buffer to memory
         //printf("%i%i%i%i%i%i%i%i",sixtyBytes[i]>>7&&1,buffer[i]>>6&&1,buffer[i]>>5&&1,buffer[i]>>4&&1,buffer[i]>>3&&1,buffer[i]>>2&&1,buffer[i]>>1&&1,buffer[i]&&1);