h i g h l i g h t s• JET monitor equipped with a DAQ system to digitize gamma signals from 19 detectors.• DAQ FPGAs used for real-time processing and streaming the gamma-ray energy values.• New algorithm was designed to produce at FPGA real-time spectra from energy values.• Spectra built at FPGA ensures streamed packets not limited by count rate.• New algorithm is relevant for future experiments expecting high event count rates. a r t i c l e i n f o Gamma-ray diagnostics are considered of crucial importance for understanding the plasma behavior of next fusion devices. Among other physical phenomena, gamma-ray spectra can provide information about the fusion reactions rate and the fast ions temperature and confinement, indicators of how close we are from reaching self-sustained burning plasmas. Accordingly, dedicated gamma-ray diagnostics are currently installed at the Joint European Torus (JET). The 2D gamma-ray profile monitor is one of these diagnostics, equipped with an Advanced Telecommunications Computing Architecture (ATCA) Data Acquisition (DAQ) system, capable of digitizing gamma-ray signals from the 19 photodiode detectors. The DAQ system includes Field Programmable Gate Array (FPGA) devices, with embedded processing algorithms. These algorithms are responsible for processing the gamma-ray signals acquired from each detector in real-time, and for periodically streaming the corresponding energy values to the DAQ host. However, for higher count rates it will be unfeasible to stream periodically all the energy values without loss. Thus, a new algorithm was designed, capable to produce real-time spectra at FPGA from the processed energy values. The spectra should be periodically streamed, delivering binned data rather than a value for each gamma-ray. This allows to reduce the data rate, avoiding data losses. Consequently, the streaming data can be used for control purposes, as demanded by next fusion experiments with long plasma discharges of high energy/count rate content. This work describes the real-time spectrum code developed for FPGA along with the attained results. It was concluded that the spectrum code is suitable for implementation in any spectroscopy diagnostic, whenever real-time spectra are required.