This paper describes a real-time pulse height analysis diagnostic for feedback control of the TCV plasma. The implementation of this diagnostic is based on a new generation X-ray detector with high resolution and count rate, an in-house developed VME intelligent module, with parallel processing capabilities provided by four Digital Signal Processors, and several digital signal processing algorithms. Results show that a value of the electron temperature (T.) can be calculated in approximately 100 ms, thus providing a twenty-value T. profile during a TCV discharge. The time resolution might be increased by improving the X-ray detecting system and/or the processing procedures.