Repository for CDMS code

Dependencies:   SimpleDMA mbed-rtos mbed eeprom

Fork of COM_MNG_TMTC_SIMPLE by Shreesha S

Files at this revision

API Documentation at this revision

Comitter:
ee12b079
Date:
Sat Apr 02 20:31:31 2016 +0000
Parent:
147:7fd1ca3a35a1
Child:
152:8e4155426581
Commit message:
TC transmission is successful, TM failed

Changed in this revision

COM_MNG_TMTC.h Show annotated file Show diff for this revision Revisions of this file
DefinitionsAndGlobals.h Show annotated file Show diff for this revision Revisions of this file
i2c.h Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/COM_MNG_TMTC.h	Sat Apr 02 13:54:24 2016 +0000
+++ b/COM_MNG_TMTC.h	Sat Apr 02 20:31:31 2016 +0000
@@ -421,6 +421,7 @@
                 wait(1); //TimeOut instead of wait
                 if(BAE_I2C_GPIO == 1)
                 {
+                    
                     //printf("receiving...\r\n");
                     FCTN_I2C_READ((char*)tm_pointer->TM_string,TM_LONG_SIZE);
                     //printf("%s", tm_pointer->TM_string);
--- a/DefinitionsAndGlobals.h	Sat Apr 02 13:54:24 2016 +0000
+++ b/DefinitionsAndGlobals.h	Sat Apr 02 20:31:31 2016 +0000
@@ -26,7 +26,7 @@
     #define ADF_IRQ PTA14
     
 //I2C - Payload to CDMS (need to change while using CDMS hardware)
-I2C master(D7,D6);
+I2C master(PIN32,PIN31);
 InterruptIn PYLD_I2C_Int(PTA13);
 
 //I2C - CDMS to BAE
--- a/i2c.h	Sat Apr 02 13:54:24 2016 +0000
+++ b/i2c.h	Sat Apr 02 20:31:31 2016 +0000
@@ -28,14 +28,13 @@
 
 void FCTN_I2C_READ(char *data,int length)
 {   
-    master.frequency(100000);
     CDMS_I2C_GPIO = 1;
     //t_read.start();
     read_ack = master.read(addr_bae|1,data,length);
     //t_read.stop();
   
-    //if(read_ack == 0)
-      //  printf("\n\rData received from BAE %s \n",data);
+    if(read_ack == 0)
+        printf("\n\rData received from BAE %s \n",data);
  if (read_ack == 1)
     {
         printf("\n \r data not received \n");
@@ -46,12 +45,10 @@
     CDMS_I2C_GPIO = 0;
     //printf("\n\r %d \n",t.read_us());
     //t.reset();
-    master.frequency(400000);
 }
 
 void FCTN_I2C_WRITE(char *data,uint8_t tc_len2)
 {
-    master.frequency(100000);
     CDMS_I2C_GPIO = 1;
     //t.start();
     write_ack = master.write(addr_bae|0x00,data,tc_len2);
@@ -68,7 +65,6 @@
     CDMS_I2C_GPIO = 0;
     //gPC.printf("\n\r %d \n",t.read_us());
     //t.reset();
-    master.frequency(400000);
 }
 
 
--- a/main.cpp	Sat Apr 02 13:54:24 2016 +0000
+++ b/main.cpp	Sat Apr 02 20:31:31 2016 +0000
@@ -5,7 +5,7 @@
 uint8_t rcv_isr = 0; // flag for interrupt
 
 #define DEBUG 1
-#define SDCARD 1
+#define SDCARD 0
 #define I2C_PL 0
 
 
@@ -37,6 +37,8 @@
 
 int main()
 {
+    CDMS_I2C_GPIO = 0;   
+    
     //gLEDR = 1;
     
     // ******************INITIALISATIONS START******************
@@ -52,8 +54,9 @@
     #if I2c
     //I2C to Payload    (depends on pl interrupt design)
     PYLD_I2C_Int.rise(&isr_pyldtm);
+    
     #endif
-    
+    master.frequency(100000);
     // DEBUG
     //gPC.puts("welcome to mng_tm_tc\r\n");
     gPC.baud(115200);