Single–trial learning is studied in an evolved robot model of synaptic spike–timing–dependent plasticity (STDP). Robots must perform positive phototaxis but must learn to perform negative phototaxis in the presence of a short–lived aversive sound stimulus. STDP acts at the millisecond range and depends asymmetrically on the relative timing of pre– and post–synaptic spikes. Although it has been involved in learning models of input prediction, these models require the iterated presentation of the input pattern, and it is hard to see how this mechanism could sustain single–trial learning over a time–scale of tens of seconds. An incremental evolutionary approach is used to answer this question. The evolved robots succeed in learning the appropriate behaviour, but learning does not depend on achieving the right synaptic configuration but rather the right pattern of neural activity. Robot performance during positive phototaxis is quite robust to loss of spike–timing information, but in contrast, this loss is catastrophic for learning negative phototaxis where entrained firing is common. Tests show that the final weight configuration carries no information about whether a robot is performing one behaviour or the other. Fixing weights, however, has the effect of degrading performance, thus demonstrating that plasticity is used to sustain the neural activity corresponding both to the normal phototaxis condition and to the learned behaviour. The implications and limitations of this result are discussed.