Example design: Bicycle computer using VHDL
Basic functions
| Current speed Up to 99.9 km/h Accuracy: Increments of 1/10 km/h (3 digits) |
![]() |
| Average speed Up to 99.9 km/h Accuracy: Increments of 1/10 km/h (3 digits) Based on pure running time of the bike |
![]() |
| Maximum speed Up to 99.9 km/h Accuracy: Increments of 1/10 km/h (3 digits) User-driven reset is possible |
![]() |
| Trip distance Up to 999.9 km Accuracy: Increments of 1/100 km (5 digits) |
![]() |
| Total distance Up to 99999 km/h Accuracy: Increments of 1 km (5 digits) User-driven reset is not possible; can be erased by disconnecting the power supply |
![]() |
Computer setup
| Wheel size setting Adjustable from 80 cm to 208 cm in steps of 1 cm (3 digits). The initial value of 80 cm can be obtained by powering up the system or disconnecting the power supply |
![]() |
| Contrast setting The contrast of the liquid crystal display (LCD) can be varied. Setting up the circumference of the wheel |
![]() |
Computer operations
Wheel size setting
After powering up the bicycle computer, the circumference of the wheel must first be set up. Pressing key 1 for at least 1.28 seconds switches over to the setup mode. Key 2 is used to adjust the circumference between 80 cm and 208 cm in steps of 1 cm. If key 2 remains depressed, the circumference of the wheel is increased continuously. After pressing key 1 twice, the computer returns to the basic mode "Current Speed".
Setting up the contrast
In order to change the contrast of the LCD, the computer must be switched over to the setup mode by depressing key 1 for at least 1.28 seconds. Depressing key 1 again leads to the contrast adjustment mode. The contrast can then be changed with key 2. The contrast changes continuously if key 2 remains depressed. After pressing key 1 once more, the computer returns to the basic mode "Current Speed".
Changing the display mode
Pressing key 1 changes over the display mode. Each time the key is pressed the next mode is obtained.
Resetting the measured values
The maximum speed, average speed and trip distance values can be reset by depressing key 2 for at least 1.28 seconds in the respective display mode.
The power supply to the bike computer must be disconnected if the total distance is to be reset.
Description of the VHDL design
- Fundamentals
- The processing unit
- Debouncing of the reed sensor
- The timer component
- The arithmetic component
- BCD conversion of calculation results
- Determination of the maximum speed
- Adjustment for the perimeter of the tyre
- Output multiplexer
- Testbench and simulation
Reference
Labor Digitale Schaltungen, |
|
Laboratório de Desenvolvimento de Sistemas Digitais, |






