12/4/96 (Mike Rosing)
PC32 Event Timer System. Figure-1(small, big).
Event Timer Event Program Control Figure-2(small, big).
Host commands to Event Timer DSP Figure-3(small, big).
Host Commands Figure-4(small, big).
Event Program Commands Figure-5(small, big).
Event Program Commands (continued) Figure-6(small, big).
The Event Program is an emulated machine. The idea is to create a program structure which is easy to use and fast enough to respond to real world conditions. This gives the experimenter control of the DSP processor without having to reprogram any code. The data structure for this emulated machine is described below. The previous flow charts describe how the emulation works and shows that it is subordinate to the collection and storage of data.
There are several levels of complexity which need to be described. The lowest level is the DSP code. This is shown pictorially in the flow charts. The next level is Event Program and the highest level are host commands. These commands are found in the flow charts as well, but this only shows how the DSP executes them. The following is an attempt at describing the structure of these commands from the users perspective.
Each Event Program step consists of two 32 bit words. The first word is a relative time counter and the second word is command data. The relative time counter is used to compute how many clock ticks the Event Program should wait before fetching the next Event Program instruction. Zero is a valid value and can be used for loop commands. The time counter can be set to increment at rates from 16 MHz and divided down from that by up to 32 bits. Nominal design is presently to set the counter to 1 MHz. Almost all paths through the flow charts will get to (1) in one microsecond so that the emulated machine is “real time”.
There are two types of Event Program commands. These are identified by the most significant bit of the command data. If the bit is set, then all 32 bits are sent to the output port. This is an 'output raw' command. If the upper 16 bits are all set in the command data, a halt is executed. At present, this kills the processor.
If the most significant bit is clear, then the command structure is more complex. The upper 8 bits are used as an index into a jump table. These are called “Event Program Commands” in the flow charts. Their values and meanings are given below. The maximum number of Event Program steps is presently 1024.
Command Hex Value Comments nop 00XX XXXX Might be useful for pure time delay Loop top 01CC CCCC CCCCCC is loop count, max value = 16.7E6 Loop bottom 02XX XXXX goto 03XX XPPP PPP = relative address. Last 10 bits only. On event goto 04XX EPPP E = event # [0..15], PPP as above Reset clock 05XX XXXX zeros out time counter Dump data 06XX XXXX Block transfers events stored on DSP
The dump data command will not execute in 1 microsecond. Because data is continuously transferred to the host it should only be called when known dead times occur and no events need to be captured. All other commands will execute in the 1 microsecond time limit.
Host commands also consume 64 bits. The first 32 are used to send a command number and the second block is data. Somewhat inefficient from the host's point of view, but it helps speed things up on the DSP side. The commands are listed below:
Command Hex Value Data Value Comments nop 0000 0000 XXXX XXXX Used by the DSP to ensure no duplicate reset 0000 0001 XXXX XXXX Warm reboot, keeps DSP running halt 0000 0002 XXXX XXXX DSP goes to sleep. Cold reboot needed bit on 0000 0003 XXXX XXBB BB = bit number to set [0 .. 31] bit off 0000 0004 XXXX XXBB clears bit BB in output word bit change 0000 0005 XXXX XXBB flips bit BB in output word