A single SpaceWire node or router in a system is responsible for generating time-codes. This “time-master” has an active TICK_IN signal which is asserted periodically (e.g. every millisecond) by its host system. Only the time-master should assert its TICK_IN signal, all other nodes must keep their TICK_IN signals de-asserted. To send out a time-code the time-master has to increment the time value on the SpaceWire CODEC time input-port and then assert the TICK_IN signal. The SpaceWire CODEC will then read in the new time-code value and transmit the requested time-code as soon as the current character has finished being sent.
The time-counter in the node or router acting as the time-master, may be used to generate the correct sequence of time-codes for transmission. The six-bit time-counter output is fed to the time-code input-port. When the next time-code is to be transmitted, the time-counter is incremented and the TICK_IN signal asserted. This causes the SpaceWire CODEC to send the required time-code. The values of the two control-flags sent in the time-code are application dependent. Their values should be updated when the time-counter is incremented.
Time-codes are normally generated periodically by the time-master to provide a regular timing tick for the SpaceWire system. The frequency of time-code is called the tick rate and the period between time-codes is called the tick interval.