[Tinyos-contrib-commits] CVS: tinyos-1.x/contrib/handhelds/apps/FAT_EKG FAT_EKG.nc, 1.1, 1.2 FAT_EKG_M.nc, 1.1, 1.2 SHIMMER2_SD_cardImage.zip, 1.1, 1.2 SerialLink.nc, 1.1, 1.2 readme.doc, 1.1, 1.2 readme.txt, 1.1, 1.2

steve ayer ayer1 at users.sourceforge.net
Thu Aug 28 12:25:46 PDT 2008


Update of /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/FAT_EKG
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv5098

Modified Files:
	FAT_EKG.nc FAT_EKG_M.nc SHIMMER2_SD_cardImage.zip 
	SerialLink.nc readme.doc readme.txt 
Log Message:

author stephen linder quoth "Fixed compatablity problems with
SHIMMER1. Hit the user button on the docking station to stop data
collection. Then you can control the application with the serial
interface." 


Index: FAT_EKG.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/FAT_EKG/FAT_EKG.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FAT_EKG.nc	19 Aug 2008 18:46:11 -0000	1.1
--- FAT_EKG.nc	28 Aug 2008 19:25:32 -0000	1.2
***************
*** 41,44 ****
--- 41,45 ----
      FAT_EKG_M, 
      PowerSupplyMonitorC,
+     UserButtonC,
      TimerC,
      TimerJiffyAsyncC,
***************
*** 60,63 ****
--- 61,65 ----
    Main.StdControl -> FAT_EKG_M;
    Main.StdControl -> TimerC;
+   Main.StdControl -> UserButtonC;
    Main.StdControl -> SD_DMA_C;
  
***************
*** 65,68 ****
--- 67,71 ----
    FAT_EKG_M.PowerSupplyMonitor -> 	PowerSupplyMonitorC;
  
+   FAT_EKG_M.Button -> 				UserButtonC.UserButton;
  
    FAT_EKG_M.blinkRunAndPowerLEDTimer -> TimerC.Timer[unique("Timer")];

Index: FAT_EKG_M.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/FAT_EKG/FAT_EKG_M.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** FAT_EKG_M.nc	19 Aug 2008 18:46:11 -0000	1.1
--- FAT_EKG_M.nc	28 Aug 2008 19:25:32 -0000	1.2
***************
*** 124,127 ****
--- 124,128 ----
  	interface Timer as retryDataCollectionTimer;
      interface TimerJiffyAsync as sampleADC_JiffyTimer;
+     interface MSP430Event as Button;
      interface StdControl as sampleADC_JiffyTimerAsyncControl;
      interface HPLUART;
***************
*** 154,158 ****
  extern int sprintf(char *str, const char *format, ...) __attribute__ ((C));
  
- void 		initSerialLinkToHost();
  void 		writeHeaderBlock (dataCollectionStatus_t status);
  void 		startRecordingDataTaskRequest();
--- 155,158 ----
***************
*** 237,241 ****
  		
  		// data will be recorded once the SHIMMER2 is undocked.
! 		startRecordingDataTaskRequest();
  		 
   		return SUCCESS;
--- 237,241 ----
  		
  		// data will be recorded once the SHIMMER2 is undocked.
!  		startRecordingDataTaskRequest();
  		 
   		return SUCCESS;
***************
*** 663,666 ****
--- 663,680 ----
  		post stopRecordingData();
  	}
+ 	
+   	// This gets called when the button is pressed on dock
+   	// This even is being preserved for backward compatablity to
+   	// SHIMMER1.
+     /////////////////////////////////////////////////////
+     async event void Button.fired() {
+ 		bool tempFlag;
+ 		tempFlag = CollectingandRecordingDataFlag;
+  		if (tempFlag == TRUE ){
+ 	      	post stopRecordingData();
+  	    } else {
+  	      	post startRecordingDataTask();
+  		}
+     }
  
  	///////////////////////////////////////////////////////////////////////////

Index: SHIMMER2_SD_cardImage.zip
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/FAT_EKG/SHIMMER2_SD_cardImage.zip,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
Binary files /tmp/cvsNpwGKQ and /tmp/cvsk29MT4 differ

Index: SerialLink.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/FAT_EKG/SerialLink.nc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** SerialLink.nc	19 Aug 2008 18:46:12 -0000	1.1
--- SerialLink.nc	28 Aug 2008 19:25:33 -0000	1.2
***************
*** 58,61 ****
--- 58,63 ----
  void initSerialLinkToHost() {
  	uint16_t temp;
+ 	
+ 	SerialLinkInit ();
  
  	// disable the SD card chip select.
***************
*** 93,96 ****
--- 95,100 ----
  	static uint8_t block[4]; 							// constructed block number
  	
+ 	
+ //	call Leds.yellowToggle ();
  	if (state == S_HEADER_BLOCK_RECEIVE) {    
  		// receive block mode

Index: readme.doc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/FAT_EKG/readme.doc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
Binary files /tmp/cvsmZ6vow and /tmp/cvsdiG1VK differ

Index: readme.txt
===================================================================
RCS file: /cvsroot/tinyos/tinyos-1.x/contrib/handhelds/apps/FAT_EKG/readme.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** readme.txt	19 Aug 2008 18:46:12 -0000	1.1
--- readme.txt	28 Aug 2008 19:25:42 -0000	1.2
***************
*** 4,12 ****
  spl at alum.mit.edu
  
! The FAT_EKG TinyOS program for SHIMMER2  logs data from an EKG chest-strap and the three axis accelerometer to the SD card.  The SD card is formatted with the FAT-16 file system and contains a log file: data_out.bin. SHIMMER2 queries the SD card for the location and length of the file on the SD-card and  uses this information to overlay the collected data on the file.
  
! After SHIMMER2 is docked, the data can be accessed directly as a normal file. The program DataFileRead.c is provide to translate the binary data file to a space delimited text file.
  Preparing the SD card
! The SD- card must be formatted with the FAT-16 file system. If you are unsure  what file system is being used on your SD-card you can reformat the SD-card using either Linux of Microsoft Windows.  Place SHIMMER2 in a SHIMMER2 docking station, or remove the SD card and place it in a card reader.   Under Windows you right click on the drive and select Format.  Under File System select FAT (not FAT32) and then format.
  
  After formatting the SD card you can either install the SD-card image that is provided in SHIMMER2_SD_cardImage.zip or you create your own image. The only required file on the SD-card is data_out.bin. This file should be the first file copied to the SD-card to insure that the file occupies consecutive  blocks on the SD card. The file can be any size up to 1 gigabyte. The  FAT_EKG application will stop logging data when the end of the file is reached.
--- 4,12 ----
  spl at alum.mit.edu
  
! The FAT_EKG TinyOS program for SHIMMER2  logs data from an EKG chest-strap and the three axis accelerometer to the SD card.  The SD card is formatted with the FAT-16 file system and contains a log file: data_out.bin. SHIMMER2 queries the SD card for the location and length of the file on the SD-card and  uses this information to overlay the collected data on the file. 
  
! After SHIMMER2 is docked, the data can be accessed directly as a normal file. The program DataFileRead.c is provide to translate the binary data file to a space delimited text file. 
  Preparing the SD card
! The SD- card must be formatted with the FAT-16 file system. If you are unsure  what file system is being used on your SD-card you can reformat the SD-card using either Linux of Microsoft Windows.  Place SHIMMER2 in a SHIMMER2 docking station, or remove the SD card and place it in a card reader.   Under Windows you right click on the drive and select Format.  Under File System select FAT (not FAT32) and then format. 
  
  After formatting the SD card you can either install the SD-card image that is provided in SHIMMER2_SD_cardImage.zip or you create your own image. The only required file on the SD-card is data_out.bin. This file should be the first file copied to the SD-card to insure that the file occupies consecutive  blocks on the SD card. The file can be any size up to 1 gigabyte. The  FAT_EKG application will stop logging data when the end of the file is reached.
***************
*** 42,48 ****
  Place the SHIMMER in the dock station. Reset the SHIMMER and confirm that the green LED is on. Confirm that the serial link to the SHIMMER (thru the USB interface) is working by toggling the red LED on the SHIMMER
  
! 	./ss.exe -d
  
! The response to this command is
  
  $ ./ss  -d
--- 42,48 ----
  Place the SHIMMER in the dock station. Reset the SHIMMER and confirm that the green LED is on. Confirm that the serial link to the SHIMMER (thru the USB interface) is working by toggling the red LED on the SHIMMER
  
! 	./ss.exe –d
  
! The response to this command is 
  
  $ ./ss  -d
***************
*** 54,64 ****
  Closing port
  
! The SHIMMER docking station uses a FTDI chip to interface the SHIMMER’s serial port to the USB port. FTDI provides a device driver that maps the USB port to a virtual serial port.  ss.exe will search through the first ten serial ports to find the SHIMMER. Sometimes you may need to specify the serial port. You can do this using -p option.
! 
!           ./ss.exe -p /dev/ttyS3 -d
  
! The -p option must be the first option.  A list of all options can be obtained by running ss without any options.
  Initiating Data Collection
! Start  data collection by placing the SHIMMER in the dock station. Reset the SHIMMER and confirm that the green LED is on.
  
  Run ss.exe under Cygwin with the following option to commence data logging
--- 54,64 ----
  Closing port
  
! The SHIMMER docking station uses a FTDI chip to interface the SHIMMER’s serial port to the USB port. FTDI provides a device driver that maps the USB port to a virtual serial port.  ss.exe will search through the first ten serial ports to find the SHIMMER. Sometimes you may need to specify the serial port. You can do this using –p option.
  
!           ./ss.exe -p /dev/ttyS3 –d
!         
! The –p option must be the first option.  A list of all options can be obtained by running ss without any options. 
  Initiating Data Collection
! Start  data collection by placing the SHIMMER in the dock station. Reset the SHIMMER and confirm that the green LED is on. 
  
  Run ss.exe under Cygwin with the following option to commence data logging
***************
*** 69,77 ****
  To run ss.exe on a Windows PC without Cygqin, have the cyqwin1.dll in the same subdirectory as ss.exe.
  
! 	ss -A "Shimmer ID String"
  
  Data collection begins when the SHIMMER2 is undocked. When data is being collected the green LED blink every time a data block is saved to the SD card. If the red LED blinks there has either been an error writing to the SD card or the battery is running low.
  
! You can also specify the sample period for data collection using the -t option.
  Terminating Data Collection
  Data collection can be terminated normally by inserting the SHIMMER in the docking station and The green LEDs stops blinking and if the SD card contains the image provide in SHIMMER2_SD_cardImage.zip  a MS-Windows based computer will auto detect the SD card and ask if you would like to plot the SHIMMER data.
--- 69,77 ----
  To run ss.exe on a Windows PC without Cygqin, have the cyqwin1.dll in the same subdirectory as ss.exe.
  
! 	ss -A "Shimmer ID String" 				
  
  Data collection begins when the SHIMMER2 is undocked. When data is being collected the green LED blink every time a data block is saved to the SD card. If the red LED blinks there has either been an error writing to the SD card or the battery is running low.
  
! You can also specify the sample period for data collection using the –t option.  
  Terminating Data Collection
  Data collection can be terminated normally by inserting the SHIMMER in the docking station and The green LEDs stops blinking and if the SD card contains the image provide in SHIMMER2_SD_cardImage.zip  a MS-Windows based computer will auto detect the SD card and ask if you would like to plot the SHIMMER data.
***************
*** 79,84 ****
  This will run the EKGread.exe program on the SD card which translates the binary data in data_out.bin to a space delimited ASCII file: t.txt. The first column will be the time stamp of the data (using Unix time), and the subsequent columns the raw data from the 12-bit ADC on the MSP430.
  Data logging Limitations
! The application concurrently collects and save data. Through put of the system is limited by 12-msec it takes to save a 512-byte block to the SD card. Data logging has been tested at 1000 Hz with four channels of 12-bit data.
  Bluetooth
  Data can be streamed over Bluetooth by setting ENABLE_BLUETOOTH_ DATA_ TRANSMISSION.  The data format is set in sendDataSetViaBluetooth(), and is currently space delimited ASCII text.
  
--- 79,90 ----
  This will run the EKGread.exe program on the SD card which translates the binary data in data_out.bin to a space delimited ASCII file: t.txt. The first column will be the time stamp of the data (using Unix time), and the subsequent columns the raw data from the 12-bit ADC on the MSP430.
  Data logging Limitations
! The application concurrently collects and save data. Through put of the system is limited by 12-msec it takes to save a 512-byte block to the SD card. Data logging has been tested at 1000 Hz with four channels of 12-bit data.  
! Support of the original SHIMMER
! This application will run on the original SHIMMER. You will however have to remove the SD card and use a card reader to read the SD card. You could also use shimmerSerial.c to down load the code over the USB connection to the SHIMMER docking station. 
! 
! With SHIMMER you will have to press the button on the docking station to inform the application to stop data collection before you can communicate with it over the serial port. When SHIMMER is collecting data the yellow LED blinks periodically. W
! 
  Bluetooth
  Data can be streamed over Bluetooth by setting ENABLE_BLUETOOTH_ DATA_ TRANSMISSION.  The data format is set in sendDataSetViaBluetooth(), and is currently space delimited ASCII text.
  
+ 



More information about the Tinyos-contrib-commits mailing list