# Fileset

[Acceptor activation of Mg-doped GaN – Effects of N2-O2 vs N2 as ambient gas during annealing.pdf](https://mdr.nims.go.jp/filesets/c1bc8708-dc5f-44be-a5b4-0415540402f2/download)

## Creator

[Ashutosh Kumar](https://orcid.org/0000-0002-8085-1598), Martin Berg, Qin Wang, [Jun Uzuhashi](https://orcid.org/0000-0003-2023-8158), [Tadakatsu Ohkubo](https://orcid.org/0000-0003-3548-1951), Michael Salter, Peter Ramvall

## Rights

[Creative Commons BY Attribution 4.0 International](https://creativecommons.org/licenses/by/4.0/)

## Other metadata

[Acceptor activation of Mg-doped GaN—Effects of N2/O2 vs N2 as ambient gas during annealing](https://mdr.nims.go.jp/datasets/5ebf6971-7517-482a-ad74-660011e23a25)

## Fulltext

1  Acceptor activation of Mg-doped GaN –  Effects of N2/O2 vs N2 as ambient gas during annealing  Ashutosh Kumar,1,*, Martin Berg1, Qin Wang2, Jun Uzuhashi3, Tadakatsu Ohkubo3, Michael Salter2, and Peter Ramvall,1,* 1RISE Research Institutes of Sweden, Scheelevägen 17, SE-223 63 Lund, Sweden 2RISE Research Institutes of Sweden, Isafjordsgatan 22, SE-164 40 Kista, Sweden 3National Institute for Materials Science, Tsukuba 305-0047, Japan  * Corresponding author(s): ashutosh.kumar@ri.se, peter.ramvall@ri.se   ABSTRACT Here, we investigate the effects of O2:N2 (1:1) as ambient gas as compared with pure N2 during activation annealing of Mg as p-type doping in GaN layers grown by MOCVD. The purpose is to understand the impact of O2 on the resulting free hole concentration and hole mobility using SIMS, XRD, STEM, AFM and Hall effect measurements. Even though the presence of O2 in the ambient gas during annealing is very effective in reducing the H level of the Mg-doped GaN layers, the maximum achievable hole concentration and mobility is still higher with pure N2. The differences are explained by an in-diffusion of O to the GaN layer acting as n-dopant and thus giving rise to a compensation effect. The Mg-H complexes at substitutional (MgGa), i.e., the electrically active acceptor sites that provide free holes, are preferentially activated by annealing with N2 only as ambient gas, while annealing with O2:N2 (1:1) also dissociates electrically inactive Mg-H complexes resulting in much less residual H. At the lower growth pressure of 150 mbar compared to higher growth pressure of 300 mbar, an increasing carbon incorporation leads to a compensation effect drastically reducing the free hole concentration while the mobility is unaffected.    I. INTRODUCTION It has been more than 30 years since the ground-breaking discovery of p-doping GaN that opened for the development of blue and white LEDs and low-power displays in smartphones that changed our way of life.[1-4] A special feature of the discovery was that the dopant, Mg in this case, needs to be activated in order to produce holes needed for the p-type conduction. The activation can occur by low-energy electron beam irradiation [1] or a heat treatment such as rapid thermal processing (RTP).[2,3] The discovery opened for the realization of a GaN-based p-n junction, an important part in many electronic devices, and thus, the achievement of a precise control of p-type conductivity is considered as a crucial issue in devices such as vertical p-n diodes for high-power applications and blue light emitting diodes for lighting applications. Mg substitutional to Ga is the preferred acceptor for p-type doping of GaN due to its relatively low activation energy, with reported values between 155 and 230 meV [5-8] and commonly used mailto:ashutosh.kumar@ri.semailto:peter.ramvall@ri.se2  in p-GaN fabrication by metal-organic chemical vapor deposition (MOCVD).  However, still the realization of high hole concentrations in p-type GaN films is one of the limiting factors for obtaining highly efficient GaN-based optoelectronic devices. It is now well-accepted that hydrogen molecules from NH3 in MOCVD form inactive bonds with Mg atoms, and these bonds need to be dissociated for Mg activation. Rapid thermal processing (RTP) has proven to be the most promising way to achieve this Mg activation in Mg-doped GaN layer. For example, by application of RTP in a N2 atmosphere at temperatures above 700°C, p-GaN with resistivity, hole concentration and hole mobility of 2 Ωcm, 3×1017cm-3 and 10 cm2V-1s-1, respectively, were realized early.[2] In addition to temperature, the ambient gas during activation of the Mg-dopant has an important role and it was found that by adding O2 a higher hole concentration was obtained for a given activation temperature.[9] By applying secondary ion mass spectroscopy (SIMS) after activation annealing the H level was found to be clearly lower when 10% O2 was added to the N2 ambient during activation. The samples with less H also showed a lower resistivity at optimized activation time; for longer times, the resistivity was observed to increase, which was attributed to a compensation effect by in-diffusion of oxygen.[9] Similar results were obtained by activation in pure O2.[10] Kuo et al. found that with O2 present during activation annealing, hole concentrations of 3×1017cm-3 may be obtained already at 400 °C.[11] The finding that less residual H after activation annealing improves the electrical properties is in line with that dissociation of the Mg-H complex is the key process for activation of p-doping by Mg in GaN.[3,12-14]. Considering different temperatures, ambient gases, annealing times etc, it can be said that the processes involved to achieve p-type conduction in GaN are still not completely understood but are to a large degree based on empirical observations and know-how.  Other important factors that may affect the result of p-doping GaN with Mg are dislocations, defects, and hillocks, and on the substrate type used.[15,16] The presence of another epitaxial layer on the p-GaN layer can also severely affect the doping activation efficiency by to some degree hindering the H from out-diffusing through the surface.[14] It is also known that growth of an additional GaN layer on top of an activated p-GaN layer may re-passivate the Mg doping of the underlying GaN layer.[14] Recently, it was found that O2 during annealing enhances the diffusion rate of Mg in the layer.[17] Furthermore, annealing in pure or partial O2 has also been found effective in improving ohmic contacts on p-type GaN.[18,19]   II. EXPERIMENTAL Epitaxial growths were performed using an Aixtron 7×2” close-coupled showerhead (CCS) MOCVD tool. Purified ammonia (NH3), trimethylgallium (TMGa) and biscyclopentadienyl magnesium (Cp2Mg) were used as precursors for nitrogen, gallium, and magnesium, respectively. Epison 4 in-line gas concentration monitors were used for precursor concentration control. Purified hydrogen (H2) with a dew point less than -110 oC was used as carrier gas.  3  Mg-doped p-GaN layers were grown on 2″ c-plane (0001) sapphire substrates. First a standard 3-µm-thick unintentionally-doped buffer layer was epitaxially grown on the sapphire substrate, followed by a 0.5-µm-thick semi-insulating (SI) GaN layer by carbon auto-doping, and a 0.5-µm-thick Mg-doped GaN layer. The SI GaN layer was intentionally grown to electrically isolate the top Mg-doped layer from the buffer layer which is crucial in Hall measurements to minimize the contribution in carrier densities in top-layer from the buffer layer.  In this study, two different GaN growth conditions of the Mg-doped layer were used. In both cases the layers were grown at 995 °C, as measured on the wafer by the Argus top-temperature controller (TTC). The V/III-ratio in the gas phase was 1500 and the growth pressures were 300 mbar and 150 mbar that resulted in growth rates of about 1.2 µm/hour and 3.0 µm/hour, respectively. In order to keep the NH3 partial pressure constant at the lower growth pressure, the supplied amount of TMGa and NH3 were doubled. The total carrier gas flow was kept constant; thus, a thinner growth surface diffusion layer (boundary layer) may be expected at the lower pressure with higher carrier gas velocity. The substantially higher growth rate at 150 mbar is most likely caused by the doubling of the TMGa flow together with the thinner diffusion layer.  The Mg doping levels targeted at 300 mbar growth pressure were 1×1019 cm-3, 4×1019 cm-3, and 8×1019 cm-3 that corresponds to growth with 1.3%, 2.6%, and 4.0% Cp2Mg taken as the molar flow relation between Cp2Mg and TMGa in the gas phase. At 150 mbar growth pressure the targeted levels were 1×1019 cm-3 and 4×1019 cm-3, corresponding to growth with 0.3% and 1.3% Cp2Mg. The Mg incorporations were confirmed by SIMS. No in-situ Mg-doping activation process in the MOCVD growth chamber was applied. Atomic force microscopy (AFM) characterization was done in tapping mode by a Bruker Dimension Icon on 3.0×3.0 µm2 sample surface area. The analysis of the captured AFM images was done by Nanoscope software. X-ray diffraction (XRD) characterization was done by a Bruker D8 Discovery equipped with PathFinder detector with variable slit and three bounce Ge (220) crystal. In order to improve the precision of the characterization, AFM and XRD were performed at several points over the 2” wafer and the average of the measured values were taken. Rapid thermal processing (RTP) was performed in an RTP-1200-100 from UniTemp GmbH. Wafers were ramped to a target temperature of 900 °C at 80 °C/second in N2/O2 ambient with an overshoot of less than 10 °C, stay for 5 minutes at 900 °C in N2/O2 ambient, followed by cooling only in N2 ambient. Before any RTP involving Mg-doped GaN samples the tool was first tested by RTP of a dummy wafer at the same condition as was to be used for the Mg activation. SIMS was performed by a Cameca double-focusing magnetic sector tool. Approximate SIMS detection limits/background levels were; Mg: 3×1016 cm-3, H: 2×1017 cm-3, C: < 1×1017 cm-3, O: 1×1017 cm-3.   Microstructural investigations were carried out by cross-sectional low-angle annular dark-field (LAADF-) scanning transmission electron microscopy (STEM) observation by using Thermo Fisher 4  Scientific Titan G2 80–200 at 200 kV. STEM specimens were prepared by the standard lift-out method using a focused ion beam (FIB) with a scanning electron microscopy (SEM) system, Thermo Fisher Scientific Helios 5UX.20  Electrical measurements were performed in the van der Pauw geometry on square samples manufactured by thermal evaporation of Ni/Au (20/100 nm) as ohmic contacts followed by cutting the 2” wafers in 3×3 mm2 squares, thus forming contacts in the sample corners. The contacts were not annealed, but for the GaN growth with 0.3% and 1.3% Cp2Mg an approximately 25-nm-thick Mg-doped GaN top layer with 2.6% Cp2Mg was grown to improve the ohmic contacts. The samples were then characterized by van der Pauw and Hall effect measurements to determine the hole concentrations (p), hole mobilities (µ), and resistivity (ρ). For the measurements, the sourcing was done using Keithley 2602 SMU, with the voltage measurements being performed using a Keithley 6514 electrometer. The magnetic field was applied using a Bouhnik AF14108 electromagnet and power supply system, controlled by magnetic field probing using a Lakeshore 475D Gaussmeter. The measurements were performed at different drive current levels and result was compared in order to ensure that the result was not affected by heating or leakage etc. induced by too high current or voltage levels.  III. RESULTS  After MOCVD growth the wafers were investigated by AFM and XRD. Fig. 1 displays the results of the AFM investigation on the wafers grown at 300 mbar. Typically, the surface step heights increase with increasing Mg concentration, presumably due to step bunching. Mg concentrations up to about 4×1019 cm-3 has no major effect on the surface roughness. The average (Ra) and RMS (Rq) roughness for 1×, 4×, and 8×1019 cm-3 Mg were Rq ~ 0.2 nm, Ra ~ 0.15 nm, Rq ~ 0.35 nm, Ra ~ 0.25 nm, Rq ~ 1.25 nm, Ra ~ 0.80 nm, respectively. The roughness values for 1×1019 cm-3 Mg are similar to those of undoped epitaxial GaN layers ( Rq ~ 0.17 nm, Ra ~ 0.13 nm) as shown in the supplementary information. At 8×1019 cm-3 Mg the as-grown surface is rougher and optical microscopy revealed hillocks on the epitaxial surface.   FIG 1.  AFM micrographs of p-GaN surfaces grown at 300 mbar with 1×, 4×, and 8×1019 cm-3 Mg. The roughening of the surfaces most likely occurs by step-bunching induced by the increasing amount of Mg. 5  Another effect of increasing Mg-doping appears to be fewer threading dislocations reaching the surface. The density of threading dislocations, observed as small black dots, for 1×1019 cm-3 Mg is around 3-5×108 cm-2, similar to what is commonly observed for GaN grown on sapphire substrates.  Structural properties of the Mg-doped GaN layers were examined with XRD-based rocking curve measurements as presented in Fig. 2. In such measurement, the detector is set at the Bragg angle corresponding to GaN and sample is tilted. The width of the peak provides information about the crystalline quality of the GaN layer. For GaN growth without Mg-doping, the (0002) peak width is usually around 300 arcsec confirming good crystalline quality of the layer. The resulting full width at half maximum (FWHM) and XRD peak positions for Mg incorporations as determined by SIMS at 1×, 4×, and 8×1019 cm-3, were 293.4 and 17.52, 310.7 and 17.60, and 332.9 and 17.01, arcsec and degrees, respectively. In comparison to the undoped GaN layer where width of the XRD (0002) rocking curve diffraction peak was found to be ~ 293.3 arcsec (see supplementary information), very small or no increase of peak width was observed for the smallest amounts of Mg. This suggests that doping with about 1×1019 cm-3 Mg does not lead to degradation of the crystalline quality of GaN layer. However, as Mg incorporation is increased to 4×1019 cm-3 and 8×1019 cm-3, the width of the (0002) peak increases. This may be attributed to the formation of Mg-induced defects like clusters or pyramids as reported earlier.[16,21,22] The (0002) peak position is significantly shifted for 8×1019 cm-3 Mg, suggesting  expansion of the GaN lattice which may be caused by incorporation of Mg at interstitial lattice positions leading to strain.  FIG 2. XRD of (0002) symmetrical plane of p-GaN grown at 300 mbar with varying amount of Cp2Mg during growth, (a. 1.3%), (b. 2.6%), and (c. 4.0%), obtained through rocking curve measurements. A width of less than 300 arcsec at 1×1019 cm-3 Mg suggests a good quality of the grown Mg-doped GaN layers. The FWHM and XRD peak positions for 1.3%, 2.6% and 4.0% Mg, were 293.4 and 17.52, 310.7 and 17.60, and 332.9 and 17.01, arcsec and degrees, respectively. As expected, the width was found to increase with increasing amount of Mg due to Mg-induced structural deformations, most likely Mg at interstitial positions that also appears 6  to expand the lattice and move the XRD peak position to smaller angle (from about 17.5 to 17.0 degrees). To activate the Mg-doping, the wafers were cut to quarters and RTP was carried out at different temperatures, ranging between 700 oC and 975 oC  under N2 and O2:N2 (1:1) gas mixtures. The general trend observed is that by adding O2 during the activation annealing the temperature where the activation commences appears to be lower.[9-11] However, to achieve saturation i.e., minimize the resistivity, relatively high RTP temperature is required, whereas only a small difference is expected between RTP ambient gas of N2 and O2:N2 (1:1).[9-10] By applying SIMS analysis for some different RTP temperatures, it was found that RTP for 5 minutes at temperatures lower or higher than 900 oC resulted in activation saturation (SIMS spectra for 850 °C and 975 °C are shown in supplementary information), as judged by the reduction of the H level, of the Mg doping levels in this study. The result of the SIMS investigation of RTP for 5 minutes at 900 oC on the wafers grown at 300 mbar MOCVD reactor pressure is shown in Fig. 3, where a test matrix with the amount of Cp2Mg in the gas-phase during growth in relation to TMGa 1.3%, 2.6%, and 4.0%, for as grown, N2, and O2:N2 (1:1) RTP processed Mg-doped GaN is presented. The onset of the Mg doping appears to be fairly slow, especially at the lower concentrations. The reason is believed to be that before steady-state incorporation can start ~ 0.3 monolayers of Mg are needed at the growth surface.[13] The most prominent difference between the RTP ambients can be observed for the H level of the topmost 0.5-µm-thick Mg-doped GaN. Before annealing, H follows the Mg level up to around 4×1019 cm-3 where it appears to saturate. Depending on the gas mixture a striking differences on the impact of H level is evident; O2:N2 (1:1) is by far superior in suppressing H. It has been suggested that O2 contributes to a more efficient hydrogen removal by forming H2O molecules on the GaN surface.[19] In the case of N2, the reduction of the H level is limited to about 1×1019 cm-3 regardless of the Mg-doping level. Another result of RTP, similar regardless of ambient gas, is that the H level of the 0.5-µm-thick SI GaN is reduced down to the background level of ~ 2×1017 cm-3.  7   FIG 3. SIMS spectra of Mg-doped GaN layers grown at 300 mbar before and after activation annealing at 900 °C. The rows of SIMS spectra represent the amount of Cp2Mg in the gas-phase during growth in relation to TMGa (1.3%, 2.6%, and 4.0%) and the columns for as grown, RTP processed in N2, and O2:N2 (1:1) ambient gas. Before annealing H follows the Mg level up to around 4×1019 cm-3.   The SIMS investigation of the p-GaN layer grown at 150 mbar is displayed in Fig. 4. Two p-GaN growths at 150 mbar with 0.3% and 1.3% Cp2Mg have been characterized. At these relatively low Mg-doping levels the surface roughness and XRD rocking curve peak width is approximately similar to undoped GaN ~ 293.3 arcsec as shown in the supplementary information. Comparing the Mg incorporation for growth at 150 mbar with 300 mbar reactor pressure the incorporation appears to have increased four-fold; 1.3% Cp2Mg in the gas-phase gave 4×1019 cm-3 Mg in the solid phase and 0.3% Cp2Mg gave 1×1019 cm-3 Mg, respectively. The reason for the increased incorporation might be less parasitic pre-reactions of Cp2Mg in the gas phase at the lower growth pressure, also the fact that Cp2Mg is a relatively large molecule and may diffuse easier through the thinner boundary layer at 150 mbar may play a role. Judging from the reduction of the H-level, the activation by RTP in the case of N2 ambient gas appears to be substantially more effective on the GaN layer with 4×1019 cm-3 Mg grown at 150 mbar compared to 300 mbar in Fig. 3. This observation suggests that the Mg might be incorporated differently for growth at 150 mbar than 300 mbar.   8   FIG 4. SIMS spectra of Mg-doped GaN layers grown at 150 mbar before and after activation annealing at 900 °C. The upper and lower rows are for p-GaN grown at 150 mbar with 0.3% and 1.3% Cp2Mg, respectively. The columns represent as grown, RTP processed in N2, and O2:N2 (1:1) ambient gas. Before annealing H follows the Mg level after RTP the H levels are substantially lower. It is clear that the Mg incorporation is substantially larger at 150 mbar growth pressure where 1.3% Cp2Mg results in about 4×1019 cm-3; a fourfold increase compared with p-GaN grown at 300 mbar shown in Fig. 3. For growth at 150 mbar an Mg level of 1×1019 cm-3 can be obtained with 0.3% Cp2Mg in the gas phase. Another important observation is that the carbon level in the Mg-doped layer is substantially higher for growth at 150 mbar reactor pressure than at 300 mbar in Fig. 3.  Electrical characterization on all samples annealed at 900 °C was performed by Hall in van der Pauw configuration. A uniform sheet resistance was measured from the four possible directions. Typical data for RTP at 900 °C in O2:N2 (1:1) for Mg-doped GaN grown at 300 mbar reactor pressure is shown in Fig. 5. Except for the highest Mg doping level, the Hall mobilities are typically around 8-9 cm2V-1s-1 and the hole concentrations are 4-5×1017 cm-3, as calculated from the sheet concentration and the 500-nm-film thickness at the corresponding sourcing current in the -1 T ≤ B ≤ 1 T magnetic field range.    FIG 5. Room temperature Hall characterization of the three samples corresponding to the Cp2Mg/TMGa 9  ratios 1.3% (a), 2.6% (b), 4% (c) annealed at 900 °C in O2:N2 (1:1) using the van der Pauw Hall method. Hole mobilities, µ, of 8.0, 8.3, 6.4 cm2V-1s-1 and hole concentrations, p, of 4.2×1017, 4.0×1017, and 2.0×1017 cm-3 are extracted for the three samples respectively with p being calculated from the sheet concentration using the 500-nm-film thickness. Sourcing currents of 5 µA was applied for (a) and (b), and 1 µA for (c). The data was confirmed by lower sourcing currents to limit the possible injection into underlying GaN layers. The, in some cases, observed asymmetric VHall-B trends are attributed to sample size non-uniformities.  To further understand the correlation between electrical and structural properties, we have carried out scanning transmission electron microscopy (STEM) on all three samples with Mg~ 1×1019 cm-3, 4×1019 cm-3 and 8×1019 cm-3 annealed under N2 ambient, as shown in Fig. 6. Imaging was performed under low-angle annular dark field (LAADF) condition.23-26   FIG 6. Cross-sectional LAADF-STEM images of 1×, 4×, and 8×1019 cm-3 Mg-doped GaN. Pyramidal defects were observed in 4× and 8×1019 cm-3 samples, but not in 1×1019 cm-3. Each inset in 4× and 8×1019 cm-3 shows a high-magnification STEM image of pyramidal defects.  IV. DISCUSSION The measured hole mobility and hole concentration of all samples annealed at 900 °C are presented in Table I. The general trend appears to be that RTP at 900 °C in N2 results in slightly higher mobility and hole concentration leading to a substantially lower resistivity. The samples with 8×1019 cm-3 Mg show lower hole concentrations and mobility, possibly due to the formation of compensating defects with donor-like behavior involving a complex,[21] for example, Mg2–VN–H, where VN is a nitrogen vacancy.[27] Such a complex would be a neutral defect during growth but would become a donor, which may cause a compensation effect once the hydrogen was removed by the activation process. At high Mg concentrations the normally deep donor MgGa–VN may contribute to compensation.[28,29]    RTP in N2 at 900 oC RTP in O2:N2 1:1 at 900 oC 10  Mg ~ 1x1019 cm-3 Growth at 150 mbar Cp2Mg = 0.3%  p = 0.87x1017 cm-3 µ = 18.6 cm2V-1s-1 ρ = 3.8 Ohm-cm Not measurable Mg ~ 4x1019 cm-3 Growth at 150 mbar Cp2Mg = 1.3%  p = 1.12x1017 cm-3 µ = 10.0 cm2V-1s-1 ρ = 5.6 Ohm-cm p = 1.03x1017 cm-3 µ = 9.2 cm2V-1s-1 ρ = 6.6 Ohm-cm Mg ~ 1x1019 cm-3 Growth at 300 mbar Cp2Mg = 1.3 %  p = 4.9x1017 cm-3 µ = 9.3 cm2V-1s-1 ρ = 1.37 Ohm-cm p = 4.2x1017 cm-3 µ = 8.0 cm2V-1s-1 ρ = 1.86 Ohm-cm Mg ~ 4x1019 cm-3 Growth at 300 mbar Cp2Mg = 2.6%  p = 4.5x1017 cm-3 µ = 9.1 cm2V-1s-1 ρ = 1.53 Ohm-cm p = 4.0x1017 cm-3 µ = 8.3 cm2V-1s-1 ρ = 1.91 Ohm-cm Mg ~ 8x1019 cm-3 Growth at 300 mbar Cp2Mg = 4.0%   p = 3.8x1017 cm-3 µ = 7.8 cm2V-1s-1 ρ = 2.1 Ohm-cm p = 2.0x1017 cm-3 µ = 6.4 cm2V-1s-1 ρ = 5.0 Ohm-cm  TABLE I.  Hole concentration, hole mobility, and resistivity at room temperature of Mg-doped GaN samples activated by RTP at 900 °C in N2 and O2:N2 (1:1). The values are determined by Hall characterization in the van der Pauw configuration.   The Hall data indicates that even though SIMS characterization clearly shows a significant lowering the of H level by adding O2 during RTP it has a small effect on the electrical characteristics. This result is surprising since the dissociation of the Mg-H complex is considered to be the key process for activation of p-doping by Mg in GaN.[3,12-14] However, it has also been suggested that H combines with Mg to form two different types of Mg-H complexes: one metastable, presumably with Mg substitutional to Ga, leading to the Mg acceptor after annealing and one dominating at high Mg levels being stable and electrically inactive.[13] The correlation between the amount of incorporated Mg and free hole concentration is further explained by by STEM where pyramidal defects were observed in the samples with Mg ~ 4×1019 cm-3 and Mg ~ 8×1019 cm-3 as shown in Fig. 6. These defects were not observed in sample with lowest amount of Mg ~ 1×1019 cm-3. The number density of these pyramidal defects is found to be significantly higher in sample with Mg ~ 8×1019 cm-3 which explains the lowest hole concentration in this sample in comparison to other samples. Kumar et al.16,30 and other authors31,32 reported that these defects provide segregation sites for Mg and may act as the compensating centers which may lead to a decrease in free hole concentration.  Considering hole concentration of about 1×1018 cm-3 for Mg-doped GaN as measured by Hall effect at room temperature with a maximum at an Mg-doping level at around 2-3×1019 cm-3 [33] and that about 10% of the holes are ionized at room temperature,[21] about 1×1019 cm-3 substitutional Mg dopants need to activate. The measured maximum hole concentration in this work of 4-5×1017 cm-3 translates to about 4-5×1018 cm-3 activated Mg-dopants on substitutional Mg sites. Comparison of the SIMS results for 1×1019 cm-3 Mg (1.3%) grown at 300 mbar before and after RTP in N2 in Fig. 3 indicates a lowering of 11  the H levels of about 4-5×1018 cm-3 which commensurate with the measured hole concentration of about 4-5×1017 cm-3. The same is true for the other samples grown at 300 mbar after RTP in N2, 4×1019 cm-3 Mg (2.6%) and 8×1019 cm-3 Mg (4.0%), albeit less clear because of the higher Mg content. In the case of RTP in O2:N2 (1:1) the reductions of the H levels of all samples grown at 300 mbar are substantially larger. This finding suggests that only the Mg-H complexes at substitutional (MgGa) electrically active acceptor sites are dissociated by RTP with N2 as ambient gas, while RTP with O2:N2 (1:1) also dissociates electrically inactive Mg-H complexes. Thus, the residual H measured by SIMS after activation annealing with N2 may provide a representative measure of the resulting hole concentration. With reference to Table I, for growth at 150 mbar reactor pressure the relation between the Mg incorporation in relation to the resulting hole concentration after RTP is radically different. Both the sample with 1×1019 cm-3 Mg and 4×1019 cm-3 Mg, in spite of having comparably lower H levels after RTP at 900 °C in N2, showed hole concentrations of only about 1×1017 cm-3, a lot less than may have been expected from the results at 300 mbar. A possible reason for the low hole concentration may be the larger amount of residual carbon in the Mg-doped layer grown at 150 mbar, as seen in Fig. 4 compared with growth at 300 mbar in Fig. 3. A larger amount of residual carbon is commonly observed at lower GaN growth pressures.[34] The excess carbon may lead to a compensation effect [35-37] making the GaN material become semi-insulating [38] that may be the case for layer grown at 150 mbar with 0.3% Cp2Mg that was not measurable after RTP in O2:N2 (1:1). The increase of C by about 4×1017 cm-3 at 150 mbar corresponds fairly well to the loss of holes compared to the p-GaN layers with corresponding Mg levels grown at 300 mbar.  However, still the activation annealing in N2 for the layers grown at 150 mbar appears to be more effective than N2 annealing for samples grown at 300 mbar. This is especially clear when comparing the H level for SIMS of the 300 mbar for Mg = 4×1019 cm-3 (2.6%) sample in Fig. 3. with the H level of the 150 mbar Mg = 4×1019 cm-3 (1.3%) sample in Fig. 4. Applying the previous result that N2 primarily activates Mg-H complexes on electrically active sites substitutional to Ga growth at 150 mbar may be more favorable than 300 mbar in order to obtain a high hole concentration provided the carbon impurity is kept low. As can be seen in Table I. the layers activated by RTP at 900 °C in O2:N2 (1:1) show a slightly lower hole concentration compared to those in pure N2. A possible explanation for the observed effect may be that oxygen in GaN forms a donor.[39-41] By applying SIMS with higher sensitivity (~ 3-4×1015 atoms/cc), as shown in the supplementary information, it appears that there is an interdiffusion of O to a level of about 5×1016 cm-3 down to a depth of about 250 nm of the 1×1019 cm-3 Mg-doped GaN layer and basically throughout the entire Mg-doped layer of the sample with 4×1019 cm-3 Mg. Oxygen is known to diffuse into GaN at temperatures similar to the RTP in this work.[9,42,43] Thus, the lower hole concentration might be attributed to compensation by n-type doping from O. The slightly lower mobility, as seen in Table I. for RTP activation in O2:N2 (1:1) as ambient gas, may also be explained by the higher impurity level from 12  O in-diffusion to the p-GaN layer.  V. CONCLUSIONS The reduction of the residual H level of an Mg-doped GaN layer is substantially more effective in the presence of O2 during RTP, still the hole concentration and hole mobility were found to be higher for activation annealing in pure N2. Since only the Mg-H complexes at substitutional (MgGa) electrically active acceptor sites will provide free holes our findings suggest that these sites are preferentially dissociated by RTP with N2 as ambient gas, while RTP with O2:N2 (1:1) also dissociates electrically inactive Mg-H complexes. Thus, the residual H level in relation to the Mg level after activation annealing with N2 only may provide a representative measure of the resulting free hole concentration of the Mg-doped GaN layer. As revealed by STEM, an increase in incorporated Mg leads to the increase in number density of pyramidal defects, and these pyramidal defects may act as the compensating centres which explains the lowest hole concentration in sample with highest Mg in present work.  Depending on the amount of Mg incorporated in the GaN layer, the MOCVD reactor pressure during growth, and the ambient gas during Mg activation annealing, different types of compensation mechanisms are dominating. At the highest Mg incorporation, in this work about 8×1019 cm-3, compensation may occur by the formation of compensating defects involving a complex such as Mg2–VN–H with donor-like behavior. At the lower growth pressure, 150 mbar, the increasing carbon incorporation leads to a compensation effect that may ultimately making the GaN material become semi-insulating. With O2:N2 (1:1) as ambient gas during activation annealing the hole concentration and mobility were found to be lower than with N2 only. The effect may be explained by the incorporation of O as n-doping in GaN leading to compensation.   ACKNOWLEDGMENTS This project has received funding from the ECSEL Joint Undertaking (JU) under grant agreement No 826392. The JU receives support from the European Union's Horizon 2020 research and innovation program and Austria, Belgium, Germany, Italy, Slovakia, Spain, Sweden, Norway, and Switzerland.  AUTHOR DECLARATIONS Conflict of Interest The authors have no conflicts of interest. Author Contributions Ashutosh Kumar: Formal analysis (equal); Investigation (equal); Methodology (equal); Visualization (equal); Writing – review & editing (equal) Martin Berg: Formal analysis (equal); Investigation (equal); Methodology (equal); Visualization (equal); Writing – review & editing (equal); Data Curation (lead); Qin Wang: Conceptualization (equal); Validation (lead); Supervision (equal); Michael Salter: 13  Conceptualization (equal): Funding acquisition (lead); Supervision (equal); Project administration (lead); Peter Ramvall: Formal analysis (equal); Investigation (equal); Methodology (equal); Visualization (equal); Writing – original draft (lead); Resources (lead);  REFERENCES [1] H. Amano, M. Kito, K. Hiramatsu, and I. Akasaki, “P-Type Conduction in Mg-Doped GaN Treated with Low-Energy Electron Beam Irradiation (LEEBI)” Jpn. J. Appl. Phys. 28, L2112 (1989). https://doi.org/10.1143/JJAP.28.L2112  [2] S. Nakamura, T. Mukai, M. Senoh, and N. Iwasa, “Thermal Annealing Effects on P-Type Mg-Doped GaN Films” Jpn. J. Appl. Phys. 31, L139 (1992). https://doi.org/10.1143/JJAP.31.L139  [3] S. Nakamura, N. Iwasa, M. Senoh, and T. Mukai, “Hole Compensation Mechanism of P-Type GaN Films” Jpn. J. Appl. Phys. 31, 1258 (1992). https://doi.org/10.1143/JJAP.31.1258  [4] S. Nakamura, T. Mukai, M. Senoh, “Candela‐class high‐brightness InGaN/AlGaN double‐heterostructure blue‐light‐emitting diodes” Appl. Phys. Lett. 64, 1687 (1994). https://doi.org/10.1063/1.111832  [5] I. Akasaki, H. Amano, M. Kito, and K. Hiramatsu, “Photoluminescence of Mg-doped p-type GaN and electroluminescence of GaN p-n junction LED” J. Lumin. 48–49, 666 (1991). https://doi.org/10.1016/0022-2313(91)90215-H  [6] S. Fischer, C. Wetzel, E. E. Haller, and B. K. Meyer, “On p‐type doping in GaN—acceptor binding energies” Appl. Phys. Lett. 67, 1298 (1995). https://doi.org/10.1063/1.114403  [7] W. Götz, N. M. Johnson, J. Walker, D. P. Bour, and R. A. Street, “Activation of acceptors in Mg‐doped GaN grown by metalorganic chemical vapor deposition” Appl. Phys. Lett. 68, 667 (1996). https://doi.org/10.1063/1.116503  [8] W. Kim, A. Salvador, A. E. Botchkarev, O. Aktas, S. N. Mohammad, and H. Morcoç, ”Mg‐doped p‐type GaN grown by reactive molecular beam epitaxy” Appl. Phys. Lett. 69, 559 (1996). https://doi.org/10.1063/1.117786  [9] B. A. Hull, S. E. Mohney, H. S. Venugopalan, and J. C. Ramer, “Influence of oxygen on the activation of p-type GaN” Appl. Phys. Lett. 76, 2271 (2000). https://doi.org/10.1063/1.126318  [10] T.-C. Wen, S.-C. Lee, W.-I. Lee, T.-Y. Chen, S.-H. Chan, and J.-S. Tsang, “Activation of p-Type GaN in a Pure Oxygen Ambient” Jpn. J. Appl. Phys. 40, L495 (2001). https://doi.org/10.1143/JJAP.40.L495  [11] C. H. Kuo, S. J. Chang, Y. K. Su, L. W. Wu, J. K. Sheu, C. H. Chen, and G. C. Chi, “Low Temperature Activation of Mg-Doped GaN in O2 Ambient” Jpn. J. Appl. Phys. 41, L112 (2002). https://doi.org/10.1143/JJAP.41.L112  [12] W. Götz, N. M. Johnson, J. Walker, D. P. Bour, H. Amano, and I. Akasaki, “Hydrogen passivation https://doi.org/10.1143/JJAP.28.L2112https://doi.org/10.1143/JJAP.31.L139https://doi.org/10.1143/JJAP.31.1258https://doi.org/10.1063/1.111832https://doi.org/10.1016/0022-2313(91)90215-Hhttps://doi.org/10.1063/1.114403https://doi.org/10.1063/1.116503https://doi.org/10.1063/1.117786https://doi.org/10.1063/1.126318https://doi.org/10.1143/JJAP.40.L495https://doi.org/10.1143/JJAP.41.L11214  of Mg acceptors in GaN grown by metalorganic chemical vapor deposition” Appl. Phys. Lett. 67, 2666 (1995). https://doi.org/10.1063/1.114330  [13] A. Castiglia, J.-F. Carlin, and N. Grandjean, “Role of stable and metastable Mg–H complexes in 𝑝𝑝-type GaN for cw blue laser diodes” Appl. Phys. Lett. 98, 213505 (2011). https://doi.org/10.1063/1.3593964  [14] W. Li, K. Nomoto, K. Lee, S. M. Islam, Z. Hu, M. Zhu, X. Gao, J. Xie, M. Pilla, D. Jena, and H. G. Xing, “Activation of buried p-GaN in MOCVD-regrown vertical structures” Appl. Phys. Lett. 113, 062105 (2018). https://doi.org/10.1063/1.5041879   [15] S. Usami, R. Miyagoshi, A. Tanaka, K. Nagamatsu, M. Kushimoto, M. Deki, S. Nitta, Y. Honda, and H. Amano, ”Effect of dislocations on the growth of p-type GaN and on the characteristics of p–n diodes” Phys. Status Solidi A 214, 1600837 (2017). https://doi.org/10.1002/pssa.201600837  [16] A. Kumar, K. Mitsuishi, T. Hara, K. Kimoto, Y. Irokawa, T. Nabatame, S. Takashima, K. Ueno, M. Edo, and Y. Koide, “Comparative Analysis of Defects in Mg-Implanted and Mg-Doped GaN Layers on Freestanding GaN Substrates” Nanoscale Res. Lett. 13, 403 (2018).   https://doi.org/10.1186/s11671-018-2804-y  [17] P. P. Michałowski, S. Złotnik, J. Sitek, K. Rosinski, and M. Rudzinski, “Oxygen-induced high diffusion rate of magnesium dopants in GaN/AlGaN based UV LED heterostructures” Phys. Chem. Chem. Phys. 20, 13890 (2018). https://doi.org/10.1039/C8CP01470A   [18] J.-K. Ho, C.-S. Jong, C. C. Chiu, C.-N. Huang, K. K. Shih, L. C. Chen, F. R. Chen, and J. J. Kai, “Low-resistance ohmic contacts to p-type GaN achieved by the oxidation of Ni/Au films” J. Appl. Phys. 86, 4491 (1999). https://doi.org/10.1063/1.371392  [19] Y. Koide, T. Maeda, T. Kawakami, S. Fujita, T. Uemura, N. Shibata, and M. Murakami, “Effects of annealing in an oxygen ambient on electrical properties of ohmic contacts to p-type GaN” J. Electron. Mater. 28, 341 (1999). https://doi.org/10.1007/s11664-999-0037-7  [20]  M. Schaffer, B. Schaffer and Q. Ramasse “Sample preparation for atomic-resolution STEM at low voltages by FIB” Ultramicroscopy 114, 62 (2012). https://doi.org/10.1016/j.ultramic.2012.01.005  [21] P. Kozodoy, H. Xing, S. P. DenBaars, U. K. Mishra, A. Saxler, R. Perrin, S. Elhamri, and W. C. Mitchel, “Heavy doping effects in Mg-doped GaN” J. Appl. Phys. 87, 1832 (2000). https://doi.org/10.1063/1.372098  [22] P. Vennéguès. M. Benaissa, B. Beaumont, E. Feltin, P. De Mierry, S. Dalmasso, M. Leroux, and P. Gibart, “Pyramidal defects in metalorganic vapor phase epitaxial Mg doped GaN” Appl. Phys. Lett. 77, 880 (2000). https://doi.org/10.1063/1.1306421  [23] A. Kumar, J. Uzuhashi, T. Ohkubo, R. Tanaka, S. Takashima, M. Edo and K. Hono, “Atomic-scale quantitative analysis of implanted Mg in annealed GaN layers on free-standing GaN substrates” J. Appl. Phys. 126, 235704 (2019). https://doi.org/10.1063/1.5132345  [24] A. Kumar, W. Yi, J. Uzuhashi, T. Ohkubo, J. Chen, T. Sekiguchi, R. Tanaka, S. Takashima, M. Edo https://doi.org/10.1063/1.114330https://doi.org/10.1063/1.3593964https://doi.org/10.1063/1.5041879https://doi.org/10.1002/pssa.201600837https://doi.org/10.1186/s11671-018-2804-yhttps://doi.org/10.1039/C8CP01470Ahttps://doi.org/10.1063/1.371392https://doi.org/10.1007/s11664-999-0037-7https://doi.org/10.1016/j.ultramic.2012.01.005https://doi.org/10.1063/1.372098https://doi.org/10.1063/1.1306421https://doi.org/10.1063/1.513234515  and K. Hono “Influence of implanted Mg concentration on defects and Mg distribution in GaN” J. Appl. Phys. 128, 065701 (2020). https://doi.org/10.1063/5.0014717  [25] J. Uzuhashi, J. Chen, A. Kumar, W. Yi, T. Ohkubo, R. Tanaka, S. Takashima, M. Edo, K. Sierakowski, M. Bockowski, H. Sakurai, T. Kachi, T. Sekiguchi, and K. Hono, J. Appl. Phys. 131, 185701 (2022). https://doi.org/10.1063/5.0087248  [26] E. Kano, K. Kataoka, J. Uzuhashi, K. Chokawa, H. Sakurai, A. Uedono, T. Narita, K. Sierakowski, M. Bockowski, R. Otsuki, K. Kobayashi, Y. Itoh, M. Nagao, T. Ohkubo, K. Hono, J. Suda, T. Kachi, N. Ikarashi “Atomic resolution analysis of extended defects and Mg agglomeration in Mg-ion-implanted GaN and their impacts on acceptor formation” J. Appl. Phys. 132, 065703 (2022). https://doi.org/10.1063/5.0097866  [27] L. T. Romano, M. Kneissl, J. E. Northrup, C. G. Van de Walle, and D. W. Treat, “Influence of microstructure on the carrier concentration of Mg-doped GaN films” Appl. Phys. Lett. 79, 2734 (2001). https://doi.org/10.1063/1.1413222  [28] H. Obloh, K.H. Bachem, U. Kaufmann, M. Kunzer, M. Maier, A. Ramakrishnan, and P. Schlotter, “Self-compensation in Mg doped p-type GaN grown by MOCVD” J. Cryst. Growth 195, 270 (1998). https://doi.org/10.1016/S0022-0248(98)00578-8  [29] O. Gelhausen, M. R. Phillips, E. M. Goldys, T. Paskova, B. Monemar, M. Strassburg, and A. Hoffmann, “Dissociation of H-related defect complexes in Mg-doped GaN” Phys. Rev. B 69, 125210 (2004). https://doi.org/10.1103/PhysRevB.69.125210  [30] A. Kumar, W. Yi, T. Ohkubo, J. Chen, T. Sekiguchi, R. Tanaka, S. Takashima, M. Edo and K. Hono “Impact of high-temperature Mg-implantation on defects and dopants distribution in GaN” J.  Appl. Phys. 133, 185702 (2023). https://doi.org/10.1063/5.0142766  [31] L. Amichi, I. Mouton, V. Boureau, E. D. Russo, P. Vennéguès, P. D. Mierry, A. Grenier, P.-H. Jouneau, C. Bougero and D. Cooper “Correlative investigation of Mg doping in GaN layers grown at different temperatures by atom probe tomography and off-axis electron holography” Nanotechnology 31, 045702 (2019). https://doi.org/10.1088/1361-6528/ab4a46  [32] W. Yi, A. Kumar, J. Uzuhashi, T. Kimura, R. Tanaka, S. Takashima, M. Edo, Y. Yao, Y. Ishikawa, J. Chen, T. Ohkubo, T. Sekiguchi, and K. Hono “Mg diffusion and activation along threading dislocations in GaN” Appl. Phys. Lett. 116, 242103 (2020). https://doi.org/10.1063/5.0009596  [33] D. Iida, K. Tamura, M. Iwaya, S. Kamiyama, H. Amano, and I. Akasaki, “Compensation effect of Mg-doped a- and c-plane GaN films grown by metalorganic vapor phase epitaxy” J. Cryst. Growth 312, 3131 (2010). https://doi.org/10.1016/j.jcrysgro.2010.07.038  [34] D. D. Koleske, A. E. Wickenden, R. L. Henry, and M. E. Twigg, “Influence of MOVPE growth conditions on carbon and silicon concentrations in GaN” J. Cryst. Growth 342, 55 (2002). https://doi.org/10.1016/S0022-0248(02)01348-9   [35] A. F. Wright, “Substitutional and interstitial carbon in wurtzite GaN” J. Appl. Phys. 92, 2575 (2002). https://doi.org/10.1063/5.0014717https://doi.org/10.1063/5.0087248https://doi.org/10.1063/5.0097866https://doi.org/10.1063/1.1413222https://doi.org/10.1016/S0022-0248(98)00578-8https://doi.org/10.1103/PhysRevB.69.125210https://doi.org/10.1063/5.0142766https://doi.org/10.1088/1361-6528/ab4a46https://doi.org/10.1063/5.0009596https://doi.org/10.1016/j.jcrysgro.2010.07.038https://doi.org/10.1016/S0022-0248(02)01348-916  https://doi.org/10.1063/1.1498879  [36] J. Yang, D. G. Zhao, D. S. Jiang, P. Chen, Z. S. Liu, L. C. Le, X. J. Li, X. G. He, J. P. Liu, S. M. Zhang, H. Wang, J. J. Zhu, and H. Yang, “Investigation on the compensation effect of residual carbon impurities in low temperature grown Mg doped GaN films” J. Appl. Phys. 115, 163704 (2014). https://doi.org/10.1063/1.4873957  [37] H.R. Qi, L.K. Yi, J.L. Huang, S.T. Liu, F. Liang, M. Zhou, D.G. Zhao, and D.S. Jiang, “Compensation of magnesium by residual carbon impurities in p-type GaN grown by MOCVD” J. Alloy. Compd. 765, 245 (2018). https://doi.org/10.1016/j.jallcom.2018.06.208  [38] C. H. Seager, A. F. Wright, J. Yu, and W. Götz, “Role of carbon in GaN” J. Appl. Phys. 92, 6553 (2002). https://doi.org/10.1063/1.1518794  [39] R. Niebuhr, K. H. Bachem, U. Kaufmann, M. Maier, C. Merz, B. Santic, P. Schlotter, and H. Jürgensen, “Electrical and optical properties of oxygen doped GaN grown by MOCVD using N2O” J. Electron. Mater. 26, 1127 (1997). https://doi.org/10.1007/s11664-997-0007-x . [40] R.Y. Korotkov and B.W. Wessels, “Electrical Properties of Oxygen Doped GaN Grown by Metalorganic Vapor Phase Epitaxy” MRS Internet J. Nitride Semicond. Res. 5, 301 (2000). https://doi.org/10.1557/S1092578300004427  [41] J. C. Zolper, R. G. Wilson, S. J. Pearton, and R. A. Stall, “Ca and O ion implantation doping of GaN” Appl. Phys. Lett. 68, 1945 (1996). https://doi.org/10.1063/1.115634  [42] S. J. Pearton, H. Cho, J. R. LaRoche, F. Ren, R. G. Wilson, and J. W. Lee, “Oxygen diffusion into SiO2-capped GaN during annealing” Appl. Phys. Lett. 75, 2939 (1999). https://doi.org/10.1063/1.125194  [43] Ł. Janicki, R. Korbutowicz, M. Rudzinski, P. P. Michałowski, S. Złotnik, M. Grodzicki, S. Gorantla, J. Serafinczuk, D. Hommel, R. Kudrawiec, “Thermal oxidation of [0001] GaN in water vapor compared with dry and wet oxidation: Oxide properties and impact on GaN” Surf Sci. 598, 153872 (2022). https://doi.org/10.1016/j.apsusc.2022.153872    https://doi.org/10.1063/1.1498879https://doi.org/10.1063/1.4873957https://doi.org/10.1016/j.jallcom.2018.06.208https://doi.org/10.1063/1.1518794https://doi.org/10.1007/s11664-997-0007-xhttps://doi.org/10.1557/S1092578300004427https://doi.org/10.1063/1.115634https://doi.org/10.1063/1.125194https://doi.org/10.1016/j.apsusc.2022.153872