The characteristics of an X ray detector composed of PIN photodiode and charge sensitive preamplifier are studied . An energy resolution of 7.6% at FWHM for the 59.5keV X ray from 241 Am source was obtained with the photodiode detector at 25℃, and 4.7% at 0℃,respectively. The measurement of energy spectra of this detector has been compared with those of CdZnTe semiconductor detector. The dependence on temperature of the energy resolution is studied.