Defective structure of doped carbons obtained from preceramic polymers through Cl 2 - and NH 3 -assisted thermolysis

The processing parameters such as the heat treatment temperature, type of preceramic precursor, and post-synthesis treatments are key factors for the development the different microstructures in polymer-derived ceramics. Moreover, doping with different heteroatoms has increased the ability of the polymer-derived ceramics to produce tunable nanostructures with a controlled pore size and distributions. A preceramic precursor containing P has been prepared from a commercial polysiloxane polymer and a phosphate alkoxide. It has been subjected to thermal treatments in N 2 , NH 3 , and Cl 2 atmospheres in different order sequences to create differentiated microstructures either in the ceramic matrix and the carbon phase. The structural, textural, and spectroscopic characterization revealed that the P atoms play a key role in the evolution of the microstructure during the thermal treatments. If the chlorination is carried out before the treatment in NH 3 , a silicophosphate matrix is formed and prevents from nitrogen incorporation into the free carbon phase. On contrary, if the NH 3 treatment is carried out before the chlorination, the carbon phase is predominantly modified by the incorporation of P atoms within the free carbon network.

solar cells (DSSCs), or supercapacitors.Heteroatom doping has been used as a recurring strategy to improve the carbon corrosion in FC cathodes, 1,2 and it has been demonstrated that introducing nitrogenated functionalities acts in favor of the overall performance of the FC under operating conditions. 3In FC cathodes, kinetics of the oxygen reduction reaction is strongly dependent on the availability of the catalyst, the accessibility of the pores to protons and oxygen, and the boundaries between the surface of the carbon support and the ionomer electrolyte.This ionomer-catalyst interaction can be improved by introducing N-containing functional groups on the surface of the carbon material. 4Similarly, introducing defects in the carbon matrix and creating more active sites for ion storage promote the surface-driven charge storage in lithium, 5,6 sodium, 7,8 and the most recent potassium ion batteries. 9Chemical doping of carbon nanomaterials has shown great promise in the reduction of the organic species in DSSCs.Although pristine carbon is catalytically inactive, the introduction of defects and specific functionalities on the carbon surface creates a feasible alternative toward the Pt-catalyzed reactions while taking the advantage of the superior conductivity of the carbon materials as well. 10s for capacitor electrodes, surface functionalization is the most common strategy to enhance the performance of a capacitor; moreover, doping with nitrogen has been proved a promising strategy to enhance the electrochemical behavior of a capacitor because of its contribution to the pseudocapacitance. 11he most common methods to produce heteroatomdoped carbons include carbonization, template strategies, or direct pyrolysis of organic precursors.The advantage of the template methods is that it can be finely tuned the pore-size distribution by modifying the template size, enabling extremely narrow pore-size distribution.The carbide-derived ceramic (CDC) route is a self-template approach that consists of etching metal carbides in a chlorine atmosphere to produce microporous carbons.The types of carbide precursor, 12,13 processing parameters, 12,14 and post-synthesis treatments 15,16 have been the object of multiple publications in the area of CDCs.With regard to the type of carbides, their production via the polymerderived ceramic route is easily feasible.In this route, the use of organosilicon polymers not only facilitates the shaping process but also the obtaining of a controllable composition either by selecting the chemistry of the starting precursors or through the addition of reactive fillers.
8][19][20] Introducing different heteroatoms into the preceramic structure has been studied since long.As an example, the sol-gel method allows incorporating Al from its hydrolyzed alkoxide, 20 and the inclusion of other heteroatoms such as Zr 21 or Hf 22 has found its application in high-temperature materials for harsh environments.6][27][28] The amorphous matrix can also be modified by using the same synthetic strategies.Contrary to what happens by the introduction of transition metals, the atoms surrounding Si in the periodic table are the ones that will conform the ceramic matrix.In spite of the wide variability of modifications that can be performed in the silicon-based matrix, there are just a few reports where phosphorus has been applied to produce polymer-derived ceramics.In this sense, Bernardo and Elsayed 29,30 were pioneers in describing the evolution of a preceramic matrix based on silicon oxycarbide precursors with the incorporation of a phosphate source.The microstructure of this material was described as a glassceramic composite, in which the crystalline phases were finely dispersed in a C-containing phosphorous-silicate melt. 31part from introducing different heteroatoms in the structure of the preceramic precursor, the uses of active fillers or reactive atmospheres are other common strategies to modify the microstructure and properties of the different phases contained in the ceramic material. 32Sorarù et al. used H 2 to obtain transparent SiOC where the presence of the free carbon phase was reduced to a minimum. 33he use of a CO 2 atmosphere has been also explored leading to the obtaining primarily a silica-based matrix with almost no Si-C bindings. 34The thermal treatment in ammonia atmosphere of polycarbosilanes leads to the formation of a tight network dominated by Si-N and Si-C bonds. 35Treating preceramic precursors in ammonia hinders the formation of Si-C-Si structures at the intermediate pyrolysis stages and reduces the amount of free carbon in the material. 36,37Moreover, in metal-containing preceramic polymers heat treated in ammonia, the crystalline metal nitride formation temperature depends on the metal and varies approximately from 300 to 700 • C, then metal nitrides formed in situ can easily be converted to metal silicides during further heat treatment up to 1000 • C. 38 In this manuscript, it has been explored the effect of using a combination of two reactive atmospheres in the microstructure of a preceramic polymer modified with different amounts of phosphorus.Cl 2 and NH 3 have been selected as reactive atmospheres.In a first place, a preceramic polymer has been produced by using a commercial polysiloxane and a phosphorous alkoxide.A first set of samples has been produced by heat treating the material in N 2 , Cl 2 , and NH 3 .These materials have been compared with those heat treated first in NH 3 and afterward in Cl 2 .The effect of the P in both the silicophosphate matrix and the carbon phase is thus described.

EXPERIMENTAL SECTION
Triethyl phosphate (TEP, Sigma Aldrich, Reagent Plus ≥99.8%) was hydrolyzed for 24 h in acidified EtOH (pH = 1) at 50  C in a flask connected to a water-cooled condenser.Overall, .5% titanium(IV) butoxide (Sigma Aldrich) was then incorporated as a catalyst to the solution and, after 5-min stirring, the solution was poured into a plastic container that was sealed and maintained at room temperature for 36 h before being dried at 50 and 110 • C until constant weight.Two sets of samples were studied.In the sample labeling, K stands for the preceramic polymer used, P, for the TEP (the number in the sample labeling refers to the amount of TEP incorporated in the synthesis of the preceramic precursor); KP refers to the materials pyrolyzed in N 2 atmosphere under the conditions described later.Samples labeled NKP were subjected to an NH 3 -assisted thermolysis in the conditions described later.The samples, labeled KPC and KPCN, correspond to the materials KP subjected to a further chlorination process under the conditions described later and chlorination plus NH 3 thermolysis under the same conditions as those are used to produce NKP, respectively.The samples NKP further heat treated in a chlorination process are then labeled KNPC.Sample labeling is also specified in Table 1.
Pyrolysis was carried out in an alumina tube furnace under a continuous N 2 flow of 150 ml/min (gas purity 99.9997%).NH 3 -assisted thermolysis was carried out in a quartz tube furnace with a continuous NH 3 /N 2 flow of 150 ml/min and a fixed NH 3 /N 2 ratio of 3:1.Chlorination was performed in a quartz tube furnace fed with a Cl 2 /N 2 gas flow of 100 ml/min and a fixed Cl 2 /N 2 ratio of 4:1.All the heating treatments were performed at a fixed heating/cooling rate of 5 • C/min with 2-h dwelling at 750 • C.
The chemical composition was calculated from the chemical analysis carried out in elemental analyzers (LECO Corp), CS-200 for the C determination, RC-420 for hydrogen content, and TC-500 to determine the oxygen and nitrogen amount.Silicon and phosphorus were determined by means X-ray fluorescence spectroscopy in an Axios PANalytical model equipped with a 4 kW Rh X-ray end-window tube.At least four analyses were carried out per sample and equipment, and the resulting value was calculated by average.
The thermal analysis of the as-prepared samples and the heat-treated materials was performed in a TA Q600 thermobalance fed with a constant airflow of 100 ml/min and recording the mass change of the materials placed in a platinum crucible.
The infrared spectra were acquired in the attenuated total reflectance mode in a Perkin Elmer BX spectrophotometer.The spectra recorded within the 600-1800 cm −1 range were averaged from at least 32 scans with a spectral resolution of 2 cm −1 .Raman characterization was performed in a Renishaw InVia spectrophotometer by using the 514-nm Ar + ion laser as an excitation source.The spectra were averaged from at least 50 collections focusing the laser spot in at least five different locations in each sample.Small-angle X-ray scattering (SAXS) experiments were carried out at the BL11-NCD-SWEET beamline at ALBA synchrotron (Spain).The X-ray beam with a wavelength of λ = .1 nm and a beam size of 150 μm impinged the sample loaded within quartz capillary tubes.The data are corrected for background scattering, detector sensitivity, and normalized to the primary flux.The scattering curves were calibrated in units of macroscopic scattering cross section, Nitrogen adsorption-desorption analysis was carried out at 77 K in a TriStar Micromeritics analyzer.The samples were previously degassed at 120 • C for 18 h in the Smart Prep unit (Micromeritics).The adsorptiondesorption curves provided data of specific surface area, average pore size, and pore volume.The surface area and pore-size distribution were determined by applying the Brunauer-Emmett-Teller (BET) and Barret-Joyner-Halenda methods, respectively. 39PS spectra were collected using a VG Escalab 200 R equipment from powdered samples homogenously deposited over copper substrates.The UV-Vis spectra were also collected in a Lambda 25 UV/Vis Spectrometer (PerkinElmer) equipped with an integrating sphere.The spectra were recorded over the UV-Vis range comprising between 190 and 1100 nm.The powdered samples were deposited over transparent glass surfaces.The reflectance spectra were also background corrected.
Field emission scanning electron microscope (FE-SEM) images were taken by using an FE-SEM microscope (Hitachi S4700, Tokyo, Japan) operating at 20 kV and backscattered electrons.The materials were gold-coated before observation.Transmission electron microscope (TEM) images were recorded in a high-resolution transmission electron microscope (HRTEM JEOL 2100F, Japan) operating at 200 kV.

Composition and thermal analysis
The chemical composition of the materials, as determined by the elemental chemical analysis, is shown in Table 1 (notice that the Ti content, used as a catalyst in a .5%w/wconcentration in all the cases, was omitted in the calculation of the overall chemical composition).The NH 3assisted treatment carried out to produce the samples NKP has been proved as an effective method to incorporate N into the structure of the materials.It is noticed that if the NH 3 treatment is carried out after the chlorination process (as in samples KPCN) the amount of N incorporated decreases substantially.The highest oxygen content is found in the samples labeled KP and their derivatives (samples KPC and KPCN).In these samples, the molar amount of O increases gradually with the P content.There, it should be taken into account that O will bind either to the P and the Si atoms, whereas C will be linked exclusively to the Si atoms.Thus, in the samples, KP was expected an observed increase in the amount of O.By subtracting the H content from the oxygen atoms and the oxygen bonded to the P atoms, now it results in a linear increase of the O/C ratio with the amount of P incorporated.In addition to presenting minor amount of O at each P concentration (except in the case of the sample 20NKP, where the O/Si content is the highest amount of all the materials, a result which is attributed to the binding of either the Si or P atoms), the samples from the series NKP and NKPC also contain the lowest amount of C that experiments no significant variations with the amount of P incorporated into the material.
In Figure 1, derivative curves obtained from thermograms are shown.Figure 1A shows that for the samples KP, there are two significant weight losses occurring at about 450 and 650 • C indicating the oxidation of the ceramic network.These weight losses become more significant as the amount of P increases in the material.On the other side, for the same materials heat treated in ammonia (samples NKP, Figure 1B), only one event is detected in this temperature range and takes place in the sample containing the lowest amount of P suggesting that the NH 3 treatment has increased the resistance against the oxidation of the materials, and this resistance is higher with the incorporation of P.
After chlorination (Figure 1C,D), the thermal behavior of the materials varies significantly.In the case of the samples KPC and KPCN, the highest oxidation resistance is found in the samples KPC, and this characteristic is increased as the amount of P increases in the network.At temperatures beyond 700 • C, a slight oxidation event is also detected.In the samples subjected to the NH 3 treatment after the chlorination (KPCN), the most significant weight loss occurs at temperatures below 500 • C and also decreases with the amount of P in the material.This result indicates that if the materials are subjected to a chlorination treatment before the NH 3 -assisted thermolysis, the previously observed increase in the oxidation resistance is reversed, and the structure of the materials becomes more labile against the air atmosphere.
Figure 1D shows the absence of any weight loss at temperatures below 700 • C; nevertheless, beyond this temperature, the materials become more oxidized as the amount of P increases in the material.

Infrared spectroscopy
Infrared spectroscopy (FTIR) characterization allows distinguishing the modifications occurring into the materials because of the thermal treatments (Figure 2).As shown in Figure 2A  stretching at 1436 (ν 3 ), 870 (ν 2 ), and 740 cm −1 (ν 4 ), the characteristic vibrational modes of the Si-O-Si network as a broad band centered at about 1100 cm −1 , and the corresponding stretching modes of the Si-O and Si-C bonds at 800-830 cm −1 .PO 4 3− exhibits two fundamental modes of vibration in the analyzed region, that is, the symmetric stretching of Q 0 (P) tetrahedron appearing at about 960 cm −1 and its corresponding asymmetric stretching mode around 1000-1100 cm −1 , which overlaps with the Si-O-Si band. 40In the spectra of the samples KP and NKP (Figure 2B), it is observed an increase of the band assigned to the phosphate tetrahedron with increasing the P content.Moreover, the band attributed to the O-C-O stretches has almost disappeared because of the NH 3 treatment and shifts to 1445 cm −1 , which is attributed to the substitution of O by N atoms in C-N bonds.The main band of the spectra, that is, this centered at about 1100 cm −1 , becomes broader in NKP samples because of the increase of the amount of nonbonding siloxane bridges (Si-O NBO ).
After chlorination (Figure 2C,D), it is noticed that all the bands in the spectra are most defined and less broad suggesting a decrease in the complexity of the structure.The most significant change is the disappearance of the band centered at 1430-1440 cm −1 despite the remanence of some N in the structure (as reflected in the chemical composition).Although in the samples KPC (Figure 2C), the increase in the P content induces a shift to lower wave numbers probably because of the contribution to the phosphate bonds, after the further NH 3 treatment (samples KPCN), the bands experiment a shift to higher wave numbers suggesting an increase in the network polymerization degree.The spectra of the materials NKPC (Figure 2D) do not present significant modifications with the different P contents indicating that no matter about the P amount, the structure will remain almost invariable.
A detailed analysis of the FTIR results through band deconvolution by assuming Gaussian bands has been carried out (Figure 3). Figure 3A presents an example of the deconvolution of the spectra obtained for the samples, labeled KP, where it has been highlighted the band attributed to the phosphate tetrahedral.Notice that in all the cases, the analysis has been performed by studying the band area.In Figure 3B, it is shown the evolution of the area of the band attributed to the phosphate groups in all the studied samples.As expected, the intensity of this band increases with the amount of P incorporated, and this band acquires higher intensity in the as-prepared materials (i.e., the series KP and NKP) than in the chlorinated samples.The amount of nonbonding siloxane bridges (Si-O NBO ) is the highest in the materials NKP, as commented before, and this number shows almost no variation with the amount of P (Figure 3C).The contrary occurs in the samples KP, where the number of (Si-O NBO ) decreases in the materials as raising the P amount.In the chlorinated samples, however, different trends are observed: In the series NKPC and KPCN, the amount of (Si-O NBO ) remains almost constant independently of the amount of P incorporated, whereas dramatic increase of these units with the P content is observed in samples labeled KPC.

Raman spectroscopy
The Raman spectra of the chlorinated samples in the range 1200-1700 cm −1 are shown in Figure 4A,B.Before the chlorination process (i.e., samples labeled KP and NKP), the high fluorescence background limits the accuracy of the analysis.In this range, it appears the classical D band at about 1350 cm −1 , attributed to the A 1g mode of the boundaries of graphite crystallites because of a double resonance effect of the longitudinal optic mode, LO phonons, around the wavevector K in the Brillouin zone 41,42 ; it is also observed the G band, related with the in-plane bond stretching of sp 2 bonds (E 2g mode) in carbon clusters 43 and the band commonly labeled D″, which is due to interactions between the localized vibrational modes of defects in the graphene layers with the extended phonon modes of pure sp 2 carbon. 44,45At about 1520 cm −1 , the D″ band that is attributed to amorphous carbon and the D* band appearing between 1150 and 1200 cm −1 can also be distinguished. 46All the fittings are summarized in the Supplementary Material S1.The absence of clearly defined second order spectra but a modulated bump at Raman shifts comprising between 2500 and 3200 cm −1 is an indication of the amorphization of the carbon phase. 43here, the development of the D peak indicates ordering, exactly the opposite to grapheme; thus the I D /I G ratio is related to the average interdefect distance, L D , though the expression 45 As shown in Figure 4C, there are slight variations in the interdefect distance in all the samples with the P amount.The general trend in the samples subjected to any NH 3 treatment is a decrease in the L D as the amount of P incorporated increases but in the samples KPC, although the minimum interdefect distance is observed for the highest amount of P, and it is noticed a maximum at 15%P.It is interesting the variation of L D with the NH 3 -assisted thermolysis.In Figure 4D, it is represented the variation of L D of the samples KPCN and NKPC with respect to the samples KPC.In general, the variation of L D is more pronounced if the NH 3 treatment is carried out after chlorination (samples KPCN), and this is most noticed in the samples containing 15%P.

SAXS analysis
8][49][50] The scattered intensity is plotted as a function of the scattering angle (θ) by q = (4π/λ)sin2θ being the SAXS patterns of all the samples after background subtraction and normalization plotted in the Supplementary Material S2.On a log-log scale, several features can be found in the SAXS diagrams.According to the classical theories, at high q values, the exponent n of the q −n behavior is morphology dependent and can be correlated with the specific surface area of the particles. 51In all the cases, the curves present similar behavior at high q values; thus, it has been considered that despite the crystallinity of the samples, all the scatters present the same morphology.
The simplest approximation to analyze the SAXS data is considering that the scatters possess an aspect ratio close to 1 (spheroids) and the intensity scattered by a single particle will adopt the following expression 52 : where V i is the volume of the scatter, ϕ corresponds to their volume fraction, Δρ is the scattering length density (which takes into account the electron density of the material), and P i (q) is the form factor of the individual particle.In spheroids, the unified approach describes the form factor as The spheroid form factor combines the Guinier and Porod approaches with a smooth transition between both thanks to the error function (erf).At low angle region, (3) where R g is the radius of gyration of the particle that, for spherical particles (primary particle) of radius R,  = √ 5∕3   .Thus, in the Guinier approximation, plotting ln(I) against q 2 gives a straight line whose slope is-R g 2/3.In Figure 5, it is plotted the radius of the primary particle of radius R as a function of the phosphorous content.In Figure 5A, it is observed that for the samples KP, the radius of the particle increases progressively as the amount of phosphorous increases, but after the chlorination process, the general trend is a decrease of the particle with the increase of phosphorus.The same trend is observed if the material was subjected to the two treatments (samples labeled KPCN), but in this case the particles are slightly higher than in the samples subjected solely to the first chlorination process.In Figure 5B, where it is represented the evolution of the radius of the particles with the P amount, it is observed that in all the cases, the particles tend to be smaller as the amount of P increases and acquires mostly the same size independently of the process they have been subjected.
The second term of Equation ( 2) corresponds to the so-called Porod regime that takes into account both the surface (S p ) and the volume (V p ) of the particles: The Porod-Debye law is an approximation that occurs within a limited range of scattering angles and suggests that the scattering of a particle should decay as q −4 .Thus, the transformation of the scattering data I(q) versus q 4 (Porod-Debye plot) should display a curve asymptotically approaching a constant value as q approaches infinity.The application of the Porod-Debye approach is therefore valid at q values below 4 nm −1 and allows the calculation of the surface of the primary particles or scatters.In Figure 6A-C, it is represented the Porod-Debye plots of all the samples.In the samples KP, it is observed that the surface of the particles only increases as the P content is above 10% but in the materials from the series NKP, there is almost no variation in the surface of the particles except at the maximum P content (Figure 6A).After chlorination (Figure 6B), samples, labeled KPC, show a gradual increase of the surface of the particles but if the materials were subjected to the double treatment (samples KPCN), it is found that the primary particles do not vary their surfaces significantly.However, for the samples NKPC, the general trend is again an increase in the surface of the particles with the exception of the sample containing 15%P.
Another significant feature of the SAXS plots is the invariant.The invariant is a well-defined constant, which contains some instrumental factors that can be canceled with background correction and can be calculated by data integration.The value of Q depends on the concentration of the particles in the scattered volume and is proportional to the molecular mass: The volume of the scatters (or particles) is related to the invariant according to the following expression:  where I(0) was calculated through extrapolation to zero in the Guinier approach.Combining the expressions Equations ( 4) and ( 6), it is possible to calculate the surface-tovolume ratio (S/V) that is plotted in Figure 6D.There, it is observed that in the samples KP, the S/V ratio decreases progressively as the amount of P increases in the material.
In the materials KPC and KPCN, the opposite behavior is found, with an increase in the S/V ratio as the amount of P increases being this increase more pronounced in the materials KPC.In the samples NKP and NKPC, the S/V ratio remains mostly constant at all the P contents except for the materials containing the maximum amount of P where a dramatic increase in the S/V ratio is found in both series.

XPS spectroscopy
In order to further analyze this defective structure induced by the NH 3 -assisted thermolysis, we have carried out a XPS analysis in two sets of samples (Figure 7), KPCN and NKPC.In Figure 7A, the C1s peak centered at 285.5 should be assigned to graphite-like Csp 2 (notice that Csp 3 appearing at 286.9 is not highlighted here). 53Nitrogen-bonded to Csp 2 appears at about 287 eV, whereas the component at about 289 eV arises from carbon atoms bonded with oxygen through single and double bonds. 54Nitrogen can adopt several configurations, including pyrrolic (two C-N bonds in a pentagon, appearing at 400.5 eV), quaternary N (N that replaced the carbon atoms in the graphene plane, appearing at 401.3 eV), and pyridinic oxide (N-O and N=O bonds in a hexagon, at 402-405 eV), as shown in Figure 7. 53,55 The XPS spectra were deconvoluted by assuming Voigtshaped functions, and the intensity ratios of the bans were represented in Figure 7C,D (band areas given in the Supplementary Material S3).The samples KPCN and NKPC show very distinct trends in the intensity ratio of the bands C-C to C-O in the sense that by increasing the amount of P in the materials, the C-C/C-O ratio decreases in the sample KPCN, whereas this ratio increases in the sample NKPC.This result indicates that if the material is subjected to the ammonolysis before the chlorination, the oxidation of the carbon network is prevented.Additionally, the intensity of the C-N band decreases with the amount of P in the sample NKPC, whereas in the case of the material KPCN, it remains constant.There, it should be taken into account that oxygen groups in carbon are the responsible for reactions with NH 3 and the consequently C−N bond formation 4 ; therefore, the higher is the C-C/C-O band intensity ratio, the lower should be the C-N band area.In the case of the band analysis of the N 1s spectrum, it is observed that the presence of pyridinic and quaternary N occurs in mostly equal proportions in both samples.With regard to the oxygenated functionalities in the nitrogen atoms, although in the case of the sample KPCN they remain almost minimal and constant independently of the P amount, it is observed an increase in the N-O bonds with an increase of P in the NKPC sample.

UV-Vis spectroscopy
From the UV-Vis spectra (provided in the Supplementary Material S4), the Tauc's plot allows calculating the optical bandgap energy (E v ) of the materials.The bandgap energy of the materials KPCN and NKPC was calculated from Equation (7), which describes the relation between absorption coefficient (α) and incident photon energy (hv) as proposed by Mott 56 : In this equation, K is a constant and the index n adopts different values depending on the type of the transition taking place (being 2, 3, 1/2, and 3/2 for indirect allowed, indirect forbidden, direct allowed, and direct forbidden transitions, respectively).Here, direct allowed transitions (n = 1/2) were considered. 57The optical bandgap obtained for the samples KPCN and NKPC is plotted in Figure 8.The bandgap increases its value when the P amount reaches 10% in the samples KPCN and then decreases progressively as the amount of P increases.In the samples NKPC, it is observed that the value of the bandgap remains mostly constant independently of the P amount in the material.The higher value of the bandgap energy encountered for the materials labeled KPCN revealed an increase of the cross-linking network. 58 I G U R E 8 Optical bandgap calculated for samples KPCN and NKPC as a function of the P content

Textural characterization
Information about the surface of the materials can be obtained through the analysis of the gas adsorption isotherms.The nitrogen adsorption isotherms are all of type IV characteristic of porous materials with pores comprising the range of the mesopores and the specific surface area, calculated by the applications of the BET method that are provided in Table 2. Isotherms are provided in the Supplementary Material S5.As presented in Figure 9A, although it seems that there is no correlation of the specific surface area of the samples labeled KP and NKP with the P amount, after the chlorination process, there is observed a general decrease of the specific surface area with the P content.In Figure 9B, it is shown the pore-size distribution of the materials KP and NKP calculated by the application of the method developed by Barrett et al.
to the desorption branch of the isotherms by assuming cylindrical pores. 59There it is observed a broad poresize distribution in the whole mesopore range with the exception of the sample containing the maximum amount of P (20KP) that presents two types of pores, being the smaller pores of about 4 nm and the large pores whose distribution ranges between 6 and 60 nm.After chlorination, however, it is observed that in all the materials, the small mesopores of about 4 nm acquire higher significance in the distribution, being the samples labeled KPC the ones that present the largest amount of this sort of pores.
The t-plot method using the Harkins-Jura equation, which describes the value of the film thickness without accounting for adsorbate-adsorbent interactions, 60 has been applied to determine the pore volume of the materials.The micropore volumes calculated by this method are also collected in Table 2. There, two distinct behaviors can be detected.Before chlorination (samples KP and NKP), there is observed an increase in the micropore volume with the P content.In these samples, the micropore volume is quite similar (Table 2), and it is attributed to the large presence of O in the materials that hinders the formation of the carbidic units.After the chlorination process, the samples, labeled KPC and KPCN, experiment a decrease in the mesopore volume with the P amount, whereas in the case NKPC, the micropore volume shows the same trend as in the corresponding materials before the chlorination procedure.
It should be emphasized that the pore distributions have been calculated by assuming cylindrical pores of a different diameter.Nevertheless, not only the diameter of the pore but also their length should be taken into account.The method proposed by Pomonis and Armatas 61 allows determining the pore anisotropy b i , which is defined as b i = L i /D i , where L i and D i are the length and the diameter of each group of pores.In Figure 10A, it is represented the TA B L E 2 Specific surface area (Brunauer-Emmett-Teller [BET]) of the obtained materials, micropore volume (V micro ), and % of the specific surface area corresponding to mesopores (%S meso ) BET (m 2 /g)  anisotropy parameter calculated for all the materials as a function of the P content.It is noticed that at the lowest amount of P, all the materials present a low anisotropy, which can be assimilated to a rough surface.By increasing the P amount, no direct correlation with the P content or the thermal treatment can be found.Nevertheless, by comparing the anisotropy parameter before and after the chlorination, it is interesting to notice that in the samples KPC and KPCN, there is a gradual increase of the anisotropy with the P amount, that is, the length of the pores is larger than their diameters; however, in the samples subjected to the NH 3 thermolysis before chlorination, that is, the samples NKPC present a decrease of this parameter after the chlorination procedure has been applied, which is here assimilated to an increase in the smoothness of the surface.
The texture and microstructure of the materials have been also observed by SEM analysis.In Figure 11A-C,G, it is shown the representative images of the samples containing 15%P and subjected to the different thermal treatments.The material 15KP presents several fiber-like microstructures growing all along the surface (Figure 11A).After the chlorination (Figure 11B), these fibers have disappeared and several voids of hundred nanometers size appeared decorating the surface.After the NH 3 treatment (Figure 11C), the voids have increased in size but the surface appeared smothered.The surface of sample 15NKP (Figure 11D) is again covered by fiber-like structures, which disappeared after the chlorination procedure (Figure 11E-H).It is also observed that in the samples NKPC (Figure 11E-H), a gradual increase of the surface smoothness as rising the P amount in the material is observed.
TEM images shown in Figure 12 reveal significant microstructural differences between the two treatments applied.In the materials from the series KPNC (Figure 12A-D), it is observed a crystalline SiO 2 -based matrix that is maintained in all the cases independently of the P content (the presence of SiO 2 was further confirmed by XRD, not shown here).On contrary, for the samples NKPC, at low P content, the material is predominantly amorphous, but several carbonaceous structures start to appear when increased the amount of P in the material.The measured d-spacing of about .374nm confirms the presence of graphitic structures in the nanofibers.

DISCUSSION
According to the previous results, it will be discussed in the first place the effect of the NH 3 treatment if it is carried out after the chlorination process (samples labeled KP, KPC, and KPCN).These materials present the highest amount of C although the incorporation of N is minimal.
During the synthesis of KP, the hydrolyzed TEP decomposes and forms H 3 PO 4 62 which will be incorporated into a carbon silicophosphate (xSiO 2 ⋅yP 2 O 5 ) matrix, in a process similar to the one described by Elsayed et al. 30 P 2 O 5 is a typical acid oxide generally acting as a network former in the glass structures, which generally increases the degree of polymerization of the glasses.The decrease in the amount of non-bridging oxygen (NBO) observed in the FTIR analysis (Figure 3C) is an indicative of the formation of this silicophosphate network.When KP was heat treated in air, the silicophosphate phase decomposes in two stages as correspond to the oxidation of the carbon phase embedded within the matrix.At room temperature, Si-O-P bonds are quite unstable; however, in an anhydrous atmosphere, the reaction S N 2(Si) addition reaction Si-Cl + P-OH → P-O-Si is favored. 63As reflected in the infrared analysis (Figure 3C), the amount of NBO increases in the sample KPC attributed to the formation of these P-O-Si linkages.In addition to the formation of these bindings, the thermal decomposition occurs in a single stage due to the segregation of the carbon phase.
It is known that for carbonaceous materials, the NH 3 treatment leads to the replacement of oxygenated functionalities in carbon, as reported for graphene oxide with varying degrees of oxidation and defect sites of graphene. 4he low N content of the samples KPCN suggests that despite the high O content in the materials, only a small amount of this O was attached to the C after the chlorination.The increase in the oxidation resistance after chlorination indicates that only nonbonded C produced from the segregation of the silicophosphate matrix remains in the material.The amount of NBO is minimal in these samples indicating a highly cross-linked network after the segregation.
According to the Raman analysis (Figure 4), the average interdefect distance L D ranges between 7 and 9.5 nm.In the samples KPC, it is found a slight increase in L D with a maximum at the intermediate P concentration (15%), whereas after the NH 3 treatment, this L D distance decreases substantially because of the substitution of the oxygenated functional groups by N atoms. 4It was observed that the G band in the Raman spectra in this KPC sample is shifted to lower Raman shift (Supplementary Material S1) suggesting that in this sample there is minor contribution of oxygenated functionalities than in the remainder samples, which in fact is translated to an increase in the interdefect distance.We speculate that below 15%P content, the formation of the silicophosphate network by S N 2(Si) addition is favored but at higher P content, the reaction is no longer favored and thus, the amount of NBO increases and the interdefect distance decreases as well.This point, however, should be confirmed in future.
The SAXS curves analyzed in the Guinier region allow calculating the radius of gyration of the primary particle (scatters) R g .R g is the average electron density-weighted distance of the scatters from the center of the object and ranges between 14 and 17 nm for the sample KP.The scatters take into account both the carbon phase and the silicophosphate matrix.In the sample KP, it was found an increase in the radius of the primary particle as the P content increased in the material, a result that was attributed to the larger size of the P atom with respect to the Si.After the chlorination, the increase in the polymerization degree of the silicophosphate network produces a decrease in the radius of the particle as increases the amount of P. The ammonolysis also produced a slight increase in the radius of the particles attributed to the substitution of the O atoms by nitrogenated functionalities.Yang et al. 64 reported that adding phosphorus to nanosized SiO 2 contributes to the reduction of the particle size.The presence of the carbon in the preceramic precursor might be the responsible of inverting this trend.
The specific surface area increases in the sample KPC with respect to the KP because of the dry etching process.In the samples KPCN, the ammonolysis reduces the amount of micropores and the %S meso increases with respect to the materials KPC.This observation is also in agreement with the SEM images (Figure 11) where the fiber-like structure disappeared from sample KP and several hundred-sized voids appeared instead.After the NH 3 treatment, SEM also shows that the pores are of larger size (increased %S meso ) and the surface becomes smoother.Schitco et al. 35 reported the disappearance of the microporosity generated during pyrolysis of polycarbosilanes when these materials were heat treated in NH 3 because of the enrichment of SiC 4 environments in the C-rich phase.
The analysis of the anisotropy parameter reported in Figure 10D indicated that after the chlorination, there were formed pores of higher length/diameter ratio and they do not disappear after the further NH 3 thermolysis treatment.These results are directly linked to the ones obtained in the SAXS analysis.The Porod region in SAXS is dependent on the surface of the scatters.As shown in Figure 6B, the surface of the scatters increases gradually with the P content in the chlorinated samples because of the formation of large throats.In the samples KPCN, despite the low incorporation of N, it reduces significantly the surface area of the scatters in spite of the increased anisotropy parameter.NH 3 -assisted thermolysis has been usually related to micropore formation in carbonaceous materials. 35,65,66However, the low free carbon content of these materials may hinder the formation of the microporosity.As Schitco et al. 66 demonstrated for carbosilane preceramic materials subjected to the NH 3 treatment, although no microporosity could be detected by gas adsorption techniques, SAXS revealed the formation of small inhomogeneities not accessible to the N 2 gas.The incorporation of the N thus reduces the surface of the scatters but no additional microporosity, which could affect the anisotropy of the material, is further detected.
For the samples subjected first to the NH 3 -assisted thermolysis, the incorporation of N is 10 times higher than in the previous materials.It is known that in preceramic polymers, the formation of imidonitride bonds occurs because of the reactions among the Si-H, Si-CH 3 , and Si-CH=CH 2 moieties with the NH 3 . 66The disappearance of these linkages in the material provokes the increased resistance against oxidation observed in Figure 1. Lee et al. 67 hypothesized that this oxidation resistance was improved because P can block active sites through the formation of C-P-O or C-O-P bonds at the edges of the carbon phase.As N atoms replace the C atoms, it is produced a largest segregation of the carbon phase within the network, and therefore, the formation of a phosphorous doped carbon phase is promoted.
Usually, the NH 3 thermolysis is considered to reduce the degree of polymerization of the materials.Now, the amount of NBO remains the highest among all the prepared materials and does not vary with the amount of P nor with the further chlorination treatment.Therefore, the formation of the silicophosphate phase is now hindered because of the substitution of the most labile functionalities by N atoms.As a result, after chlorination, it is observed a slight increase in the Si-C band area with respect to the Si-O band with the increase of the P content, a result that is directly correlated to the size of the carbon domains.As no reaction between the P and the Si takes place, after chlorination, the interdefect distance in the carbon phase is reduced because of the largest presence of P atoms attached to C.
The chlorination process after NH 3 treatment does not produce significant changes in the size of the primary particles nor the surface area of the materials.After the NH 3 treatment, the materials possess a broad mesopore distribution that is maintained after the chlorination.No significant increase in the micropore volume was either detected.However, it was observed, both by N 2 adsorption and SEM characterization, that the surface of the materials became smoother after the chlorination (Figure 10B).Although the surface of the material is not much affected by the chlorination rather than the previous mentioned smoothness increase, the surface of the primary particles is dependent on the P amount.In both cases, the surface of the primary particles increases with the P content (Figure 6A,C) except for the sample containing 15%P.The explanation for this behavior is found in the analysis of Figure 6C where it is plotted the S/V ratio.Below 15%P, the S/V ratio remains mostly constant and then increases at the highest P amount.Increasing the S/V ratio with the increase of the P content implies that in addition to the increase of the S, the V increases as well.In the case of the highest amount of P, the rapid increase of the S/V ratio implies that the V of the scatters decreased.Then, at 15%, there occurred a decrease in the V accompanied by a decrease of the surface of the scatters.The ultimate reason for this behavior should be studied in future.
The comparison between the two processes can be better observed in the XPS spectra shown in Figure 7.Although the same functionalities were observed in both cases, its behavior against the P content is completely different because in the case of the materials KPCN, the P is linked preferably to the Si atoms, whereas in the case of the samples NKPC the P is attached to the C phase.Thus, the amount of C-C bonds with respect to C-O bonds decreases progressively with the P content in the samples KPCN, and it experiments the exact opposite behavior in the samples NKPC.With regard to the C-N band, in the samples KPCN, the scarce presence of the free carbon phase not only reduces the intensity of this band but also is maintained constant at all the P contents.In the NKPC materials, the higher incorporation of P in the C network reduces the presence of C-N bindings.Additionally, in the NKPC material, it was observed an increase of the oxygenated functionalities with the increase of P in the samples.As P is expelled to the C phase, there are more N attached to Si, which remain as pyridinic oxide.
According to these results, the optical bandgap should consequently experiment different behaviors.Phosphorusdoped SiC:H films present optical bandgaps comprising between 1.9 and 2.9 eV as the amount of P increases in the material. 68Both the increased amount of the Si-C bonds and the incorporation of the P atoms lead to the enhancement of the optical bandgap. 69In silica glasses, their optical characteristics are directly dependent on the changes of the oxygen bindings leading to the formation of NBO.Higher energy is required to excite an electron from a bridging oxygen than from an NBO.As shown in Figure 3C, the amount of NBOs is higher in the sample NKPC than in the materials KPCN, and this is translated to the lower energy bandgap encountered in the materials KPCN. 58In phosphate glasses annealed in the presence of carbon materials, the bandgap broadens and increases from 3.4 to 5.2 eV due to the formation of a P-O-C-based network. 70In our materials, the bandgap falls within this range.In the case of the KPCN, the amount remains mostly constant up to 15%P, so the optical bandgap is dominated by the phosphate network; however, at higher P content, the amount of NBO increases, thus leading to a decrease of the optical bandgap.The maximum bandgap encountered for the 10%P must be attributed to the equilibrium of the amount of the NBO and the P-O-C-based network.As the amount of NBO remains mostly constant for the NKPC materials, the bandgap is exclusively dependent on the formation of the P-O-C bindings.

CONCLUSION
Addition of P to a preceramic polymer exerts significant modifications on the subsequent treatments carried out to introduce nitrogen functionalities by means of an NH 3 -assisted thermolysis.The structural characterization revealed phosphate units in the network of a preceramic polymer, thus indicating the successful incorporation of this atom.If a chlorination process is performed in these materials, chlorine attacks primarily to the silicon atoms that will react with the phosphorus thus forming a silicophosphate matrix where the C atoms are expelled.After the subsequent treatment in NH 3 atmosphere, there occurs a minimum incorporation of N in the carbon materials in form of pyridinic and quaternary N. When a previous NH 3assisted thermolysis is carried out before the chlorination, the incorporation of nitrogen is 10 times higher than in the previous case; however, the formation of P-O-C bindings hinders the nitrogenation of the carbon phase.
, samples KP presents the characteristic bands of the symmetric and asymmetric C-O F I G U R E 1 Derivative thermogrammes obtained in air atmosphere for samples (A) KP, (B) NKP, (C) KPC and KPCN (in dashed lines), and (D) NKPC F I G U R E 2 Infrared spectroscopy (FTIR) spectra of the series (A) KP and (B) NKP and the corresponding materials after being subjected to the chlorination treatments, that is, series (C) KPC and KPCN and (D) NKPC

F
I G U R E 3 (A) Deconvolution of the infrared spectroscopy (FTIR) spectra of the samples corresponding to KP series (B) area of the band centered at 960 cm −1 and attributed to the phosphate tetrahedron (C) area of the band corresponding to the Si-O bond in nonbonding structures and (D) relative intensity (area) of the bands attributed to the Si-C bonds to Si-O bonds F I G U R E 4 (A) Raman spectra of the samples, labeled KPC (solid lines) and KPCN (dotted lines), (B) samples, labeled NKPC, (C) interdefect distance of the carbon phase as a function of the P content in the materials (dotted lines are drawn to guide the eye), and (D) variation in the interdefect distance in the samples subjected to NH 3 thermolysis (samples KPCN and NKPC) with respect to the samples subjected to chlorination (samples KPC) 17447402, 2023, 1, Downloaded from https://ceramics.onlinelibrary.wiley.com/doi/10.1111/ijac.14220 by Readcube (Labtiva Inc.), Wiley Online Library on [06/03/2024].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License

F I G U R E 5
Radius of the primary particle (R) as a function of the phosphorous content in (A) samples, labeled KP, KPC, and KPCN, and (B) samples labeled NKP and NKPC F I G U R E 6 Porod-Debye plots of the samples (A) KP and NKP (dashed lines) (B) KPC and KPCN (dashed lines) (C) NKPC, and (D) surface-to-volume ratio of the primary particles

F
I G U R E 7 (A) C1s XPS spectra of samples KPCN (solid lines) and NKPC (dashed lines), (B) N1S spectra of samples KPCN (solid lines) and NKPC (dashed lines), (C) left axis, intensity ratio of the bands assigned to the C-C and C-O bonds and right axis, intensity of the band assigned to the C-N bond, and (D) left axis, intensity ratio of the bands assigned to pyrrolic N to quaternary N and right axis, intensity ratio of the bands assigned to pyridinic oxide to N pyrrolic and quaternary (N-C)

F I G U R E 9
(A) Evolution of the specific surface areas with the P content in the materials.Pore-size distributions of the materials labeled (B) KP and NKP, (C) KPC and KPCN, and (D) NKPC F I G U R E 1 0 (A) Anisotropy parameter of the materials and (B) variation of the anisotropy parameter because of the chlorination process

A
C K N O W L E D G M E N T S These experiments were performed at BL11-NCD-SWEET beamline at ALBA Synchrotron with the collaboration of ALBA staff.We are indebted to Eduardo Solano for valuable technical support during measurements at ALBA (Cerdanyola del Vallés, Barcelona, Spain).B, Perez acknowledges Comunidad de Madrid for the grant IND2020/IND-17375 pertaining to the program "Doctorados Industriales."O R C I D Aitana Tamayo https://orcid.org/0000-0002-9828-3461R E F E R E N C E S 17447402, 2023, 1, Downloaded from https://ceramics.onlinelibrary.wiley.com/doi/10.1111/ijac.14220 by Readcube (Labtiva Inc.), Wiley Online Library on [06/03/2024].See the Terms and Conditions (https://onlinelibrary.wiley.com/terms-and-conditions)on Wiley Online Library for rules of use; OA articles are governed by the applicable Creative Commons License Chemical composition of all the studied materials It is also indicated the chemical treatment carried out in each set of samples (N 2 stands for pyrolysis, NH 3 stands for ammonolysis, Cl 2 stands for chlorination, a "+" sign indicates an additional treatment, that is, pyrolysis + chlorination or ammonolysis + chlorination).