June 30

Dependencies:   FreescaleIAP SimpleDMA mbed-rtos mbed

Fork of CDMS_CODE by shubham c

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

Who changed what in which revision?

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