Wearable Sensors TeamBiweekly Report04-26-04Table of ContentsSoftware Team................................................................................................................ 3Finalize data acquisition software................................................................................ 3Integrate data acquisition and USB software................................................................ 3Data Capture ............................................................................................................... 3GUI Output from Function Generator (Figure 1) ......................................................... 5Chipcon....................................................................................................................... 6Hardware Team............................................................................................................... 7Sensors Team.................................................................................................................. 8BVP measurements ..................................................................................................... 8Complete Part List for bvp: ......................................................................................... 9Sensors Formulas: ....................................................................................................... 9BVP Circuit Modifications.......................................................................................... 9Final BVP Circuit Designs ........................................................................................ 11Bone Detector Circuit................................................................................................ 11Fingertip Detector Circuit.......................................................................................... 11Subtractor Circuit...................................................................................................... 12Software TeamFinalize data acquisition softwareThe data acquisition software was finalized by modifying the microcontroller code to use3 differential inputs and to sample the data at 500 Hz. It was thought that this wouldinvolve taking 6 analog inputs and differentiating them in software, but the Cygnalmicrocontroller has the functionality for hardware signal differencing. Sampling at 500Hz involved modifying the reset value of the timer used to call the ADC conversionroutine.Integrate data acquisition and USB softwareIntegrating the data acquisition and USB software was done by modifying the existingdata acquisition software to include code to send data to the USB chip during executionof the program’s main loop. The USB communication is a simple matter of writing thecorrect values to the usb data pins and then pulsing the USB_Write pin high for a shortamount of time. The code on the PC side did not need to be modified, since Adamcreated a microcontroller program to send dummy data to the PC in order to test his USBsoftware.Data CaptureTested and Built Software that is able to capture data from the micro controller, relay itthrough the USB, and output it to a program.In the past two weeks, we established communication from the micro controller. Thefirst week, we were able to install the USB driver, and use the program that shipped withthe USB controller to communicate with the USB device. During the second week, wecreated a custom C# program that be used to pull data from the USB device, and used itpull data from the device so it can be made available to other C# devices that could listento it.During the first week, we were assigned to get the USB chip working with the computer.To accomplish this task, we had to break it down into several smaller tasks:1. Learning how the USB device is powered and interfaced.2. How to load the drivers so I get the USB device to communicate with thecomputer.3. Learn how existing source code worked with the USB Device4. Create a C# program as an interface to the USB device (did not do until weektwo)The first step was to learn how the USB device was wired. We downloaded thespecification from the manufacturer’s website, and found it was actually quite simple.The entire device is composed of 20 pins, with 8 being data pins, and 4 being the primarycontrol and status pins. Within an hour, we had the device wired and ready to go on thebreadboard we had used to test the ChipCon.Next we had to install the drivers on the computer so we could establish communicationbetween the USB port and the windows computer. We used the DLL setup, vs. creating avirtual communication port. We got some help from Payton from the Coffemail teamwith this step, for there were a couple of headaches he helped us to avoid.Last we ran a few source code examples against the USB port to verify the program wasworking correctly. When we combined this with a simple micro controller setup ---hooking up one data pin and the write pin --- we were able to notice bytes being writtento the computer.The next week, we decided to finalize the setup of the USB chip and the micro controllerso that we could use all the data bits and all of the status and control functions. This wasall accomplished Wednesday evening. We started out by creating wires for everyconnection the USB that needed to map to the micro controller. In the process, wediscovered with Payton’s help, that two of the I/O pins on the board were bad; for Paytonthinks he fried them last year. Once they were all hooked up, labeled, and tested, weproceeded to write a short test program for the micro controller, and ran it.The first few times the program would not work, for we had not mapped the pinscorrectly in the C source code, and it took few hours to figure that bug out. Then usingthe test program provided, we were able to get data to appear on the computer. Whattook me the longest to figure out was how the data was being transmitted. The USBdevice buffers the data, on the chip, and sends it ever time a USB frame needs to betransmitted, which is about every 16 milliseconds. To figure out this buffering wasoccurring, we noticed that the bytes did not immediately appear on the computer as wewrote them, but instead, we had to wait a second, for them to show up, and when theydid, they showed up in mass quantities.Next we had to figure out how to make a custom program to work with the incomingdata. Dan and Adam wanted to write a C# program, instead of C++, for
View Full Document