Software
Main Program
The Main Menu program determines how the sports monitor interacts with the user. Its final appearance was designed to allow users to toggle between 4 pages, each representing a major feature of the sports monitor.
Data Logging Menu
The Data Logging screen is the primary interface between the device and user during the operation of the sports monitor. The presentation of data has to be simple and easily readable since it would be inconvenient to keep toggling between menus to retrieve information. During the data-logging mode, the sports monitor will display the different types of data in the following sequence:
-Heart Rate
-Cadence
-Time
-Longitude
-Latitude
As the data is displayed onto the screen, the sports monitor also stores the information into the memory module. Each complete cycle of the data logger takes about 30 seconds to complete and the memory module store up to 5 hours of trip information
Data Transmit Menu
The user enters this menu to access the data transfer features found on the sports monitor. Upon entering this menu, the device will power up the IrDA transceiver and try to establish a connection with any compatible IrDA devices within its range. After determining that a connection has been setup from device to PC, the user simply selects the Send option and data from the sports monitor will be transferred to the PC
Data Erase Menu
Erasing of data from the sports monitor has to be carried out on 2 occasions:
1. After a total power loss.
2. After data has been transferred to the PC.
Should the Sports Monitor’s batteries drain out completely, data in the onboard Static RAM module will be lost. This includes the memory address pointer value that has to be re-initialized back to the start of the memory block
Shut Down Menu
Upon selection of this mode, the Sports Monitor shuts down all devices onboard and goes into a hibernating mode to preserve battery power
Heart Rate Program
The Heart Rate Program is written as a routine in the main program. When the heart rate routine is called, it configures and starts a timer and polls a pin on the microcontroller that is connected to the output of the heart rate circuit. The program then counts the number of times the pin changes its state during the period of time the timer is running. Once the timer hits the predefined value, the total number of logic changes on the polled pin is consolidated and multiplied to convert the sampling period to a minute. This produces the value for Pulses per Minute (Heart Rate).
Cadence Program
Since both cadence and heart rate are measured in units of minutes, the heart rate program is also used to measure cadence.
GPS Data Acquisition Program
The GPS Data Acquisition Program uses the microcontroller’s USART Receive pin to receive data from the GPS module at 4800-baud rate.
The program starts off by initializing the USART to run at a baud rate of 4800 and specifies the frame details. For NMEA sentences, each frame consists of 1 start bit, followed by 8 bits of data, 0 parity bits and 1 stop bit. After initialization, the routine enables the USART’s receive pin and the program waits to capture data from the GPS module. Next, the program sets up a 16-bit memory address pointer to a base value and starts loading the memory with the collected data from the USART receive pin. This sequence loops for 164 times, which is equivalent to 2 full samples of GPS information. The USART is then turned off and the information in the memory starts to be sorted out.
Software on PC
On the PC’s side, Microsoft’s Hyper Terminal program is used to receive data from the Sports Monitor. Once the data has been transferred, it has to be stored into a text file so that it can be imported into a Microsoft Excel spreadsheet that has been designed to tabulate the distance covered during the log session. The final presentation of data is in a form of an Excel spreadsheet table. Figure 4.3 shows an example of the data presentation on Excel.