  The formation of deuterated molecules is favoured at low temperatures and
high densities. Therefore, the deuteration fraction D$_{frac}$ is expected to
be enhanced in cold, dense prestellar cores and to decrease after protostellar
birth. Previous studies have shown that the deuterated forms of species such as
N2H+ (formed in the gas phase) and CH3OH (formed on grain surfaces) can be used
as evolutionary indicators and to constrain their dominant formation processes
and time-scales. Formaldehyde (H2CO) and its deuterated forms can be produced
both in the gas phase and on grain surfaces. However, the relative importance
of these two chemical pathways is unclear. Comparison of the deuteration
fraction of H2CO with respect to that of N2H+, NH3 and CH3OH can help us to
understand its formation processes and time-scales. With the new SEPIA Band 5
receiver on APEX, we have observed the J=3-2 rotational lines of HDCO and D2CO
at 193 GHz and 175 GHz toward three massive star forming regions hosting
objects at different evolutionary stages: two High-mass Starless Cores (HMSC),
two High-mass Protostellar Objects (HMPOs), and one Ultracompact HII region
(UCHII). By using previously obtained H2CO J=3-2 data, the deuteration
fractions HDCO/H2CO and D2CO/HDCO are estimated. Our observations show that
singly-deuterated H2CO is detected toward all sources and that the deuteration
fraction of H2CO increases from the HMSC to the HMPO phase and then sharply
decreases in the latest evolutionary stage (UCHII). The doubly-deuterated form
of H2CO is detected only in the earlier evolutionary stages with D2CO/H2CO
showing a pattern that is qualitatively consistent with that of HDCO/H2CO,
within current uncertainties. Our initial results show that H2CO may display a
similar D$_{frac}$ pattern as that of CH3OH in massive young stellar objects.
This finding suggests that solid state reactions dominate its formation.
