Firmware Notes

Version 10 (J. Simmons, 06/27/2016 10:08 pm)

1 1 J. Simmons
h1. Firmware Notes
2 1 J. Simmons
3 1 J. Simmons
{{>toc}}
4 1 J. Simmons
5 1 J. Simmons
The firmware for the *Holoseat* can be found in the SVN Repository.  Its basic function is to detect pedal events from the sensor, use the timing of those events to determine the cadence (in RPM), and then send the walk command (generally by pressing the 'w' key) when the pedal speed is greater than the specified trigger speed.
6 1 J. Simmons
7 1 J. Simmons
h2. Default Parameter Values
8 1 J. Simmons
9 1 J. Simmons
The default parameters for the firmware are stored in the @holoseat_constants.h@ file so they will be available at start up without the need for a connection to the desktop control application.  The desktop control application modifies the default values by updating the values of the corresponding constants in this file and then flashing updated firmware to the Holoseat.  The following parameters have default values in the constants file.
10 1 J. Simmons
11 1 J. Simmons
* Default Walk Character - what key is sent to move the character in the game
12 1 J. Simmons
* Default Holoseat Enabled - is the Holoseat enabled by default?
13 1 J. Simmons
* Default Trigger Cadence - how fast does the user need to pedal (in RPM) to trigger walking?
14 1 J. Simmons
* Default Logging Enabled - is serial logging enabled by default?
15 1 J. Simmons
* Default Logging Interval - how long between messages in serial logging in deci-seconds (0.1 of a second)
16 1 J. Simmons
17 1 J. Simmons
h2. HoloSeat Serial Protocol
18 1 J. Simmons
19 2 J. Simmons
The HoloSeat firmware has a serial protocol, the Holoseat Serial Protocol (HSP), to enable the desktop control application to modify all key parameters and to determine the current configuration of the Holoseat.
20 2 J. Simmons
21 4 J. Simmons
h3. Protocol Commands
22 2 J. Simmons
23 4 J. Simmons
The HSP supports two commands.  Each command is made up of a single upper case character indicating the statement type.  One command, the (S)et statement, also takes an input string.
24 1 J. Simmons
25 5 J. Simmons
* @S <config string>@ - (S)et command; used to send updated configuration to HoloSeat.  The config string has the following format:
26 5 J. Simmons
* @Q@ - (Q)uery command; used to request the HoloSeat send one standard state message (see *Protocol Messages* below)
27 4 J. Simmons
28 2 J. Simmons
h3. Protocol Messages
29 2 J. Simmons
30 4 J. Simmons
The HSP has two messages.  One is a single character message similar to the commands and one is the HSP standard state message which is sent after initialization, in reply to a (Q)uery command, and as the serial logging message.
31 6 J. Simmons
32 6 J. Simmons
* @R@ - (R)eady; sent by the HoloSeat to indicate it is ready for serial communication
33 10 J. Simmons
* @<VER>,<WC>(<DWC>),<E>(<DE>),<C>/<TC>(<DTC>),<L>(<DL>)/<LI>(<DLI>)@ - standard state message, see below for key; example: @1.2.3,w(w),1(1),70/65(75),1(0)/10(10)@
34 8 J. Simmons
** @<VER>@ - Firmware version string (example: 1.2.3)
35 1 J. Simmons
** @<WC>@ - Walk character (example: w)
36 9 J. Simmons
** @<DWC>@ - Default walk character (example: w)
37 8 J. Simmons
** @<E>@ - Enabled? Must be a @0@ (disabled) or a @1@ (enabled) (example: 1)
38 8 J. Simmons
** @<DE>@ - Default enabled state, same format as @<E>@ (example: 1)
39 8 J. Simmons
** @<C>@ - Current cadence rounded to whole number (example: 70)
40 8 J. Simmons
** @<TC>@ - Trigger cadence (example: 65)
41 8 J. Simmons
** @<DTC>@ - Default trigger cadence (example: 75)
42 8 J. Simmons
** @<L>@ - Logging enabled? Must be a @0@ (disabled) or a @1@ (enabled) (example: 1)
43 8 J. Simmons
** @<DL>@ - Default logging enabled,  same format as @<L>@ (example: 0)
44 8 J. Simmons
** @<LI>@ - Logging interval in deci-seconds (example: 10)
45 8 J. Simmons
** @<DLI>@ - Default logging interval in deci-seconds (example: 10)