A sports altimeter is required which provides the following information to the user:
A fully configured sports altimeter will include a barometer unit which records atmospheric pressure, an altimeter unit which records height above sea level, a variometer which records the current vertical speed and a timer unit which records trip duration.
After system reset or power on, the altimeter will show atmospheric pressure on the L.E.D. display. Pressing the Mode button causes the altimeter to cycle through the following modes:
The barometer is required to display the atmospheric pressure derived from the pressure sensor module.
The units of measurement for atmospheric pressure should be millibars (mb).
The following figure shows the expected output on the seven-segment display for a atmospheric pressure of 1013mb
Note that the display has five 'digits' with the first being smaller than the others. This left-most 'digit' tells us which mode we are in (in this case it displays the character is a 'P' to indicate pressure).
The units of measurement altitude should be metres (m).
The following figure shows the expected output on the seven-segment display for a vertical speed of 873m
(In this case the left-most digit displays the character 'A' to indicate altitude).
The units of measurement for vertical speed should be metres per second (m/s).
The following figure shows the expected output on the seven-segment display for a vertical speed of -0.08m/s (note that a negative value here indicates descent rather than ascent)
(In this case the left-most digit is supposed to represent a 'v' to indicate velocity).
The trip timer is required to display the cumulative time for a journey.
The trip timer will be zeroed at power on by an RC circuit which will operate the system reset. The trip timer will also be zeroed whenever the Trip button is pressed. (N.B. This causes a SYNCHRONOUS resetting of this unit and is totally separate from the nReset input that causes an ASYNCHRONOUS reset of all registers).
The units of measurement for time should be hours and minutes.
The following figure shows the expected output on the seven-segment display for a trip time of 1 hour and 59 minutes.
(In this case the left-most digit displays the character is a 't' to indicate time).
At power on, the sports altimeter should assume that the atmospheric pressure at sea level is 1013mb. With knowledge of the atmospheric pressure at sea level and the atmospheric pressure at the current location, it is possible to perform a calculation to estimate the altitude.
Note that many embedded systems will avoid the use of complex calculations using floating point numbers because these need a lot of resources and are slow. Instead, integer calculations are preferred along with the use of approximation techniques such as look-up tables and interpolation.
A fully configured sports altimeter will include the ability to set the atmospheric pressure at sea level. Sea level pressure initialisation is achieved by pressing the Trip and Mode buttons simultaneously in the atmospheric pressure display mode. There are four sub-states withinthis mode:
A fully configured sports altimeter will include the ability to set the current altitude (this offers an alternative method of calibrating the system to take account of changes in the atmospheric pressure at sea level). The altitude initialisation is achieved by pressing the Trip and Mode buttons simultaneously in the altitude display mode. There are four sub-states withinthis mode:
For each of the sports altimeter modes, you should choose suitable values for range, resolution and accuracy.
The range tells us the minimum and maximum values for the measurement. For the distance you might choose 00.0km - 99.9km for the range.
The resolution tells us the increment used between adjacent values. For the cadence, you might choose 5rpm as the resolution.
The accuracy of a measurement will be affected by a number of factors such as the accuracy of the clock input (you can assume that this is within 0.01% of the specified value), the accuracy with which you store the wheel size and the operation of your sports altimeter.
For low values, the maximum error of a well made measurement should be comparable to the resolution (for this reason it is not appropriate to set an overly small resolution that cannot be supported by the system).
For high values, percentage errors are likely to dominate over fixed errors. For this reason the error might be stated as "no more than X units or Y% (whichever is the larger)".
In particular, a proper estimation of the accuracy of your altimeter demonstrates that you have a good understanding of its limitations and is essential if you are to get a good mark for the design exercise.
When designing a system to detect the buttons being pressed, you should be aware that the time that a button will be held down is unpredicable and that the switch may bounce when it is pressed and/or when it is released. You may assume that the switch bounce does not last for more than 25ms.
While operation with an MS5803-02BA Miniature Altimeter Module via its SPI (Serial Peripheral Interface) connection would be ideal, it is recognised that this device is difficult to use. For this reason, it is suggested that all teams start by targetting a simplified altimeter module which also uses an SPI connection. While the former module supports a number of different commands and returns results of varying lengths, the simplified slave supports just one 8-bit command (0x00) which causes it to return a 24-bit integer value representing the current atmospheric pressure in millibars.
The display is a common cathode multiplexed display. Thus a segment is lit if and only if the relevant segment line is taken high and the relevant digit line is taken low.
For the sake of common test vectors you must use the signal names given below in your design.
Clock (32.768 kHz with active rising edge) nReset (Active Low) Test (Active High) SDI (Active High) nMode (Active Low) nTrip (Active Low) MISO (Active High)
SDO (Active High) SegA (Active High) SegB (Active High) SegC (Active High) SegD (Active High) SegE (Active High) SegF (Active High) SegG (Active High) DP (Active High) nDigit[4] (Active Low) nDigit[3] (Active Low) nDigit[2] (Active Low) nDigit[1] (Active Low) nDigit[0] (Active Low) SPICLK (Active High) MOSI (Active High) nAltCS (Active Low)
The default arrangement of pads is provided below.
Iain McNally
20-2-2024 (v0.2)