Neuromorphic engineering promises the deployment of low latency, adaptive and low power systems that can lead to the design of truly autonomous artificial agents. However, many building blocks for developing a fully neuromorphic artificial agent are still missing. While neuromorphic sensing, perception, and decision-making building blocks are quite mature, the ones for motor control and actuation are lagging behind. In this paper we present a closed-loop motor controller implemented on a mixed-signal analog/digital neuromorphic processor which emulates a spiking neural network that continuously calculates an error signal from the desired target and the feedback signals. The system uses population coding and recurrent Winner-Take-All networks to encode the signals robustly. Recurrent connections within each population are used to speed up the convergence, decrease the effect of mismatch and improve selectivity. The error signal computed in this way is then fed into three additional populations of spiking neurons which produce the proportional, integral and derivative terms of classical controllers exploiting the temporal dynamics of the network synapses and neurons. To validate this approach we interfaced this neuromorphic motor controller with an iCub robot simulator. We tested our spiking controller in a single joint control task for the robot head yaw. We demonstrate the correct performance of the spiking controller in a step response experiment and apply it to a target pursuit task.