Feedback stimulation Interactive feedback can be provided through a physical telemetry motor and sensor system or directly through an electric stimulus. The analog output of the data acquisition card could be used in principle to synthesize a stimulus waveform (through a stimulus isolator circuit), however, in our example, we use the programmable stimulus generator supplied with the MEA set-up (Multi Channel Systems MCS GmbH STG1002), which is connected to the head-stage at the electrode array. The MEA1060-BC head-stage is programmable, so that a set of any of the 60 recording electrodes can be dynamically selected for stimulation. During stimulation, a TTL trigger and blanking signal lasting 1 ms is applied to the head-stage, electronically switching the designated stimulus electrodes to the stimulus generator lines and all other electrodes to ground. In this way, stimulation artifacts are almost completely suppressed allowing action potentials to be recorded again within 2 ms after stimulation. The STG1002 stimulus generator and the MEA1060-BC head-stage are two independent instruments, controlled by the real-time model through independent serial RS232 programming lines and triggered by two of the digital output lines of the data acquisition card (Simulink implementation of the programming protocols are included in the example software). All experimental control is thus performed by the real-time target PC, the drivers and control software provided by MCS for Windows are not used. The subset of stimulating electrodes is dynamically selected using a serial command string of 40–60 bytes length (depending on the complexity of the desired waveform). Likewise, the applied waveform is dynamically controlled using a serial command string of 54 bytes length (biphasic symmetric unipolar voltage stimulation, amplitude: 100–900 mV, duration: 200 μs negative pulse, 200 μs positive pulse). It therefore takes less than 10 ms to transmit the commands for both selecting a new set of stimulating electrodes and changing the stimulus waveform by reprogramming the respective instruments through the two independent serial lines. Integration of the control software within in the real-time model allows a high bandwidth feedback signal to be delivered as a function of the ongoing activity at a rate of up to 100 Hz (the stimulus generator STG1002 is limited to a maximum triggering frequency of 50 Hz). This means that a stimulus of dynamically varying form can be delivered through a variable set of electrodes every 10 ms (this can be improved by using different apparatus and/or firmware if necessary). The above feedback procedure may be adapted to other modalities, e.g., activity-dependent application of neuromodulators, sound, light, motion, and so forth.