Repository for CDMS code

Dependencies:   SimpleDMA mbed-rtos mbed eeprom

Fork of COM_MNG_TMTC_SIMPLE by Shreesha S

Committer:
chaithanyarss
Date:
Sat Jul 02 10:48:30 2016 +0000
Revision:
207:28a07943dded
Parent:
206:fba4aeebf004
Except Flash everything else.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
chaithanyarss 207:28a07943dded 1 DigitalOut pwr_comrx (PIN72);
chaithanyarss 207:28a07943dded 2
chaithanyarss 207:28a07943dded 3 void RESET_COMRX();
chaithanyarss 207:28a07943dded 4 void RESET_RTC();
chaithanyarss 206:fba4aeebf004 5
chaithanyarss 206:fba4aeebf004 6 void RESET_COMRX()
chaithanyarss 206:fba4aeebf004 7 {
chaithanyarss 206:fba4aeebf004 8 pwr_comrx = 0;
chaithanyarss 206:fba4aeebf004 9 wait_ms(10);
chaithanyarss 206:fba4aeebf004 10 pwr_comrx =1;
chaithanyarss 206:fba4aeebf004 11 }
chaithanyarss 206:fba4aeebf004 12
chaithanyarss 206:fba4aeebf004 13 void RESET_RTC()
chaithanyarss 206:fba4aeebf004 14 {
chaithanyarss 206:fba4aeebf004 15 gCS_RTC=1;
chaithanyarss 206:fba4aeebf004 16 gCS_RTC=0;
chaithanyarss 206:fba4aeebf004 17 spi.write(0x81); //register address with write flag
chaithanyarss 206:fba4aeebf004 18 spi.write(0x80);//enabling stop bit in the seconds register
chaithanyarss 206:fba4aeebf004 19
chaithanyarss 206:fba4aeebf004 20 gCS_RTC=1;
chaithanyarss 206:fba4aeebf004 21 gCS_RTC=0;
chaithanyarss 206:fba4aeebf004 22 spi.write(0x81);
chaithanyarss 206:fba4aeebf004 23 spi.write(0x00);//disabling the stop bit to restart the oscillator
chaithanyarss 206:fba4aeebf004 24
chaithanyarss 206:fba4aeebf004 25 wait(4000);
chaithanyarss 206:fba4aeebf004 26 //clearing the halt bit
chaithanyarss 206:fba4aeebf004 27 gCS_RTC=1;
chaithanyarss 206:fba4aeebf004 28 gCS_RTC=0;
chaithanyarss 206:fba4aeebf004 29 spi.write(0x8C);
chaithanyarss 206:fba4aeebf004 30 spi.write(0x00);
chaithanyarss 206:fba4aeebf004 31
chaithanyarss 206:fba4aeebf004 32 //clearing the OF bit
chaithanyarss 206:fba4aeebf004 33 gCS_RTC=1;
chaithanyarss 206:fba4aeebf004 34 gCS_RTC=0;
chaithanyarss 206:fba4aeebf004 35 spi.write(0x8F);
chaithanyarss 206:fba4aeebf004 36 spi.write(0x00);
chaithanyarss 206:fba4aeebf004 37 }
chaithanyarss 206:fba4aeebf004 38
chaithanyarss 206:fba4aeebf004 39