Formamidinium halide salts as precursors of carbon nitrides

Pyrolysis of formamidinium halide salts (FAI, FABr) results in a new type of amorphous carbon nitride materials with a mass fraction of 40 – 50% nitrogen content. Pyrolysis temperature drives final chemical composition, morphology, optical and electrical properties of the material independently of the halide precursor and identifying triazine ring, instead of typical heptazine unit, as the main building block of this material. We elaborated a temperature dependent mechanism of formation for these materials and foresee its potential value as native passivation layer in the field of perovskite solar cells.


Introduction
Carbon nitrides (CNs) are a family of compounds composed by carbon, nitrogen and hydrogen atoms arranged as triazine or heptazine rings units linked through tri-coordinated N atoms and disposed to form structures ranging from condensed crystalline (graphitic) phases to disordered polymeric phases [1].Different approaches are available to synthesize CNs including physical/chemical vapor deposition and pyrolysis/condensation of carbon and nitrogen containing precursors as cyanamide, cyanide salts, urea, guanidinium salts, s-triazines, s-heptazines and thiocyanates [1][2][3].Precursor type and synthetic procedure tune the electronic properties of CN.Conventional yellow/orange CN presents a band gap energy range between 2.5 and 2.8 eV, but as condensation increases, crosslinking increases and terminal amine groups are lost, which leads to band gap narrowing and the formation of more disordered structures.This causes a dark brown or even black color like graphite analogs [4,5].Considering the possibilities of modifying the electronic, optical and chemical properties, a large number of commercially available precursors and a remarkable chemical resistance, CN materials have a relevant place at the forefront of research for their potential application in the area of free-metal catalysis, diamond-like electro-thermal materials and energy storage/conversion [6].Furthermore, unlike other inorganic elements of wide use in the electronic/semiconductor field, CNs are sustainable materials composed of abundant elements in the Earth crust.On the downside, their physical-chemical characterization is difficult and intensive research is needed to establish a precise control of their structure-properties relationships.
In this work, the precursor used for synthesizing CNs is the formamidinium cation (FA + , CN 2 H 5

+
).According to our bibliographic research, FA + has never been used before as a precursor to obtain carbon nitride materials.Then, the pyrolysis of formamidinium halide salts (FAI, FABr) at two different temperatures (630 and 830 • C) under inert atmosphere resulted in amorphous carbon nitride materials with a mass fraction of nitrogen ranging on 40-50%.We characterized the chars by elemental analysis, adsorption isotherms, X-ray diffraction (XRD), infrared spectroscopy (FTIR), Raman spectroscopy, ultraviolet-visiblenear IR reflectance spectroscopy (UV-vis-IR), X-ray photoelectron spectroscopy (XPS), ultraviolet photoelectron spectroscopy (UPS), scanning electron microscopy (SEM), energy dispersive X-Ray spectroscopy (EDS), transmission electron microscopy (TEM), electron energy loss spectroscopy (EELS), nuclear magnetic resonance (NMR) and pressure dependent electronic conductivity properties.We elaborated a temperature dependent mechanism of formation to uncover unique properties for these materials different to the conventional "melamine" route to obtain g-C 3 N 4 type carbon nitrides.
In recent years, we have attended the astonishing development of emerging perovskite halide-based photovoltaics [7].Despite excellent recorded efficiencies and low manufacturing energy costs compared to silicon-based PV, the current average lifetime of these devices precludes the ultimate commercial success of this technology [8,9].Then, we foresee the potential value of this finding to produce a native CN passivation layer on formamidinium-based thin-films for perovskite solar cells close equivalent to the role played by SiO 2 on Si-based solar cells.

Synthesis of the CN chars
CAUTION! Heat treatment of the FA + based starting materials evolve NH 3 , cyanogen and other harmful gases [10].Pyrolysis experiments must be carried out with proper vent which permits these gases to escape safely.
A horizontal tube Carbolite furnace equipped with an inner quartz pipe pyrolyzed 1 g of FAX (X = Br or I) under anoxic and anhydrous conditions flowing a dinitrogen current of 70 cm 3 /min.The heating program steps were 1) 1.75 h at room temperature to purge air out, 2) a temperature ramp of 20 • C/min until reach final temperature: 630 • C (low temperature) or 830 • C (high temperature), 3) 1 min of dwelling time at selected final temperature and 4) natural cooling of the sample from the maximum temperature of the experiment to ambient temperature.Then, the black powders with metallic shining obtained after pyrolysis were washed and filtered in a frit number 4 Buchner funnel with 20 mL of deionized water, 20 mL of acetone and 20 mL of ethanol.Then, a vacuum oven dried the samples at 110 • C and 26 mbar during 4 h.The mass yield of the reaction considering only initial C, N and H atom contents from precursor was ~50% and ~20% for low and high pyrolysis temperature, respectively.Names for the four samples are Br630, I630, Br830 and I830 depending on halogenated precursor (FABr or FAI) and highest pyrolysis temperature reached 630 • C (low temperature) or 830 • C(high temperature).The choice of these two pyrolysis temperatures is made on the basis of the thermogravimetry-mass spectrometry measurements for FABr and FAI reported elsewhere [10].The carbon nitride residue appears probably above 400 • C but only gas release stops above ~550 • C.Then, these two high pyrolysis temperatures (630 and 830 • C) were selected to obtain a carbon nitride highly stable, inert, and degassed material for further characterization.

Bulk elemental analysis
A Perkin-Elmer EA-2400 Series II microanalyzer determined the bulk chemical composition for C, H and N of the samples stored at ambient conditions.

Dinitrogen adsorption isotherms
Dinitrogen adsorption isotherms at 77 K in a Micromeritics TriStar 3000 established the specific surface area and pore volume distribution for samples previously out-gassed during 10 h at 200 • C and 20 Pa.

X-ray diffraction
An Empyrean diffractometer from Panalytical performed powder XRD on samples using Cu Kα radiation (λ = 1.5406Å) and a PIXcel-1D-Medipix3 detector recording between 10 and 50 • 2θ at a scan rate of 0.74 • /min and 0.026 • scan step.The sample holder was a silicon plate free of diffraction peak or shoulder rotating at 0.5 cycles per second to ensure uniformity in the detected signal.Scherrer equation determined crystallite size of samples using 0.9 as shape factor (spherical particle model).A FWHM of 0.170 • for the 30.46 • 2θ peak of the standard powder LaB 6 defined the instrumental peak broadening.

FTIR spectroscopy
A Bruker FTIR Vertex 70 equipped with a diamond ATR top-plate and referenced to the empty sample holder acquired Fourier-transform infrared spectroscopy (FTIR) spectra on samples over an average of 40 scans with a resolution of 4 cm − 1 .Multipeak fitting for peak deconvolution procedure needed a rubber band type baseline correction using OPUS 5 software from Bruker.

Raman spectroscopy
An alpha300R WITEC Raman confocal microscope acquired Raman spectra of samples at room temperature exciting at 488 nm and 785 nm laser wavelength at low power (1 mW) to avoid the burn out of the samples (as observed for > 20 mW power excitation).

UV-vis spectroscopy
A UV-VIS-NIR Jasco V6700 equipped with an ISN-723 integrating sphere and PbS photoconductive cell detector measured total reflectance in the 200-2500 nm range for a ~15% mass fraction sample and reflectance reference powder BaSO 4 .The Kubelka-Munk transformation of the reflectance data determined the pseudo-absorbance of the samples.The extrapolation to zero y-axis of the Tauc plot (indirect allowed band gap setting) allows an optical bandgap estimation of the samples.

XPS/UPS
A XPS X-Ray Photoelectron Spectroscopy AXIS SupraTM from Kratos with monochromated Al Kα = 1486.6eV and UPS He− Iα = 21.22 eV radiation source analyzed electronic transitions on the surface of the samples.A copper tape supported the powered sample before compressed air stream removed the excess of material.The vacuum chamber hosted the sample at pressure below 7⋅10 − 9 Torr.A unique O 1s peak ascribed to atmospheric contamination at 531.75 eV [11][12][13] was the reference peak instead of adventitious carbon peak.The Fermi edge (EF = 0 eV) and Au 4f7/2 (84.0 eV) on a clean Au surface calibrated the binding energy for UPS measurements.The software CasaXPS fitted the peak traces.

SEM/EDS
A FEG INSPECT 50 from FEI equipped with EDS spectrometer analyzed the non-metallized surface of the samples including elemental analysis.

STEM/EELS
Transmission electron microscopy (TEM) studies were performed in a FEI Titan Cubed 60-300 kV microscope, working at 80 kV and equipped with a spherical aberration corrector (CETCOR Cs-objective CEOS Company) and a Gatan GIF Tridiem 865 EELS spectrometer.Complementary EDS studies were carried out in a FEI Titan Low_Base 60-300 kV probe corrected TEM, also working at 80 kV and fitted with an Oxford Instruments Ultim Max TLE 100 EDS detector.For the TEM studies, the CN samples were dispersed onto copper grids coated with a holey carbon film.The mass density of the sample has been extracted after EELS data analysis [14][15][16][17][18][19].

NMR
A Bruker Avance III 400 MHz Wide Bore spectrometer equipped with a 4 mm CP MAS 1 H-BB probe acquired NMR spectra of ~100 mg of samples packed inside a zirconium rotor sealed with a Kel-F cap.The 13 C CP spectra were acquired with a MAS rate of 10 kHz, a ramp-CP contact time of 3 ms and 7 s recycle delay.

Conductivity measurements
A homemade holder consisting of thick isolating Teflon die vertically fixed in a heavy stainless steel support with two Cu pistons measured the electrical conductivity (σ) of powdered samples at room temperature (Fig. S1).A hydraulic press (RIKEN SEIKI P-163) controlled the load applied on the piston (0, 57.0, 115.4 and 173.2 MPa).An Autolab M204 applied four DC voltages (0, 1, 2 and 3 V) measuring the dielectric response over the frequency range of 10 2 -10 6 Hz [20].A fitting of the impedance spectra data on Randles model equivalent circuit determined the resistance of samples (Fig. S2).

Chemical composition analysis
We determined the chemical composition of the samples by 1) elemental bulk analysis and three surface methods, namely 2) XPS survey spectra, 3) EDS-SEM and 4) EDS-TEM (Table 1).
Samples analyzed by bulk chemical analysis left no ashes or uncombusted residues.According to EDS analysis (from SEM and TEM), there were no remnant halide from precursors in the pyrolyzed samples with exception of I630 which showed a contamination trace quantity of iodide (0.04 at %) in XPS survey (Figs.S3 and S4).XPS survey scans found oxygen on samples (2-3 at %).Instead, EDS (SEM and TEM) determined oxygen at trace level.Ambient oxygen after sample preparation caused this natural surface oxidation [11].Then, the main observation from bulk analysis is that regardless of the halide precursor and pyrolysis temperature, these materials contain a molar ratio of ~55-60% for C, 45-40% of N and 1-2% of H content.The pyrolysis temperature has larger influence than halide type of precursor in the final chemical composition of the chars.Indeed, increasing pyrolysis temperature produced a significant decrease in nitrogen and hydrogen contents.The simultaneous decrease of N and H contents with increasing pyrolysis temperature explains the presence of H in amine and/or imine groups (section 3.4 FTIR) released as NH 3 (g) and HCN(g) at high temperature [10].The molecular chemical formula for chars at low and high pyrolysis temperature are CN 0⋅85 H 0.04 and CN 0⋅65 H 0.02 , respectively.There is an excellent match between bulk chemical analysis and EDS (TEM).Instead, XPS and EDS (SEM) follow the general trend on regards C:N ratio on temperature dependency but overestimating C content because they are inherently techniques characterizing the surface of the sample and few nanometers deep in the material.EELS spectra showed C-K and N-K edges (Fig. S6) and the estimation of the mass density was 2.25, 2.09, 2.16 and 2.17 g/cm 3 for samples Br630, I630, Br830 and I830, respectively.According to chemical composition and density, these chars are not the conventional carbon (IV) nitride C 3 N 4 neither N doped carbon materials [3] but tunable composition carbon nitrides C x N y H z [21].

Textural properties
Adsorption N 2 isotherms of the four samples showed type II isotherms, Fig. 1.
All samples are non-porous with low adsorption capacity just occurring in their surface.BET surface area and total pore volume values (Table 2) as well as t-plot method confirm the lack of relevant micro-, Table 1 Chemical composition reported as atomic fraction (at %) of the samples analyzed by four methods and theoretical composition of formamidinium cation precursor (FA + , CH(NH 2 ) 2

Analysis type
Sample C (at %)  mesoporosity in these materials and their significantly low surface area.These textural properties are not conclusive on regards of dependence with halogen type employed as precursor but there is a significant increase of BET surface and pore volume for Br830 and I830.This result agrees with a larger quantity of NH 3 /HCN released gases [10] activating the material during pyrolysis at higher temperature.

X-ray diffraction
Powder XRD diffractogram of the four samples showed an amorphous material with a shoulder centered on ~27 • 2θ (Fig. 2).Table 3 summarizes the parameters obtained from peak fitting.
Qualitatively, there is no relevant difference between sample diffraction patterns, peak position and type of crystalline domain.The broad reflection, corresponding to d-spacing of ~3.24 Å, is reminiscent of the d 002 plane found in amorphous carbons or turbostratic carbons [21,22].Graphitic layers and discotic arrangements with regular ring stacking show this pattern in carbon nitrides [2,3].The broadness and absence of peaks at lower 2θ indicate amorphous, disordered in-plane and out-plane samples in contrast of the well-defined and sharp d 002 peak found in poly(triazine imide), poly(heptazine imide), triazine-based graphitic and melon type carbon nitrides [23,24].Furthermore, small-angle X-ray diffraction (SAXS) pattern confirmed neither diffraction peaks at low angle nor pore structure in these materials [25].Therefore, XRD data indicates a nanoscopic range order by stacking of fundamental structural units as heptazine motif, sym-triazine ring type or both.Despite FABr and FAI contain Br and I halides, and formamidinium is able to form sym-triazine rings, there is no evidence in the XRD pattern and chemical analysis for the presence of polytriazine imide (PTI) carbon nitrides which intercalates halide ion phases obtained using eutectic molten salt media [26].Halide precursor has no influence in the pyrolyzed product type obtained.However, quantitative curve fitting showed the width of the peak was broader for the high pyrolysis temperature samples Br830 and I830.It indicates further reduction in the nanoscopic crystallite size in both high temperature samples (Br830 and I830) compared to low temperature samples (Br630 and I630) according to the Scherrer equation (Table 3).

FTIR spectroscopy
FTIR spectra for the high temperature samples Br830 and I830 indicates no significant N-H stretching band in the 3200 cm − 1 zone (Fig. 3, Table 4).In contrast, low pyrolysis temperature samples show a faded shoulder for this region agreeing with their higher H content detected by bulk elemental analysis and discarding -OH contamination after atmospheric exposure [22,27].
There is neither stretching absorption bands for C sp3 -H, C sp2 -H nor C sp -H in the 3100-2900 cm − 1 range indicating that the formamidinium C(H)-(NH 2 ) 2 building block precursor was fully condensed in the material framework.The four samples contain terminal C sp -N sp group (nitrile) at 2220 cm − 1 [27] and probably oxygen contamination as isocyanate N=C=O at 2167 cm − 1 [28] but non-terminal groups involving carbodiimides appearing below 2100 cm − 1 [29].Also, there is no characteristic sharp absorption at ~800 cm − 1 corresponding to the heptazine motif [3] but small broad absorption for triazine unit.[13,30].
The large discrepancy between low and high temperature sample appears in the zone denominated the skeletal C sp2 -C sp2 and C sp2 -N sp2 mixed modes region.It consists of four main bands at 1584, 1516, 1373, 1250 cm − 1 for Br630 and I630 collapsing in two broader bands at 1516 and 1195 cm − 1 for Br830 and I830.Comparing with FTIR spectra reported in literature, our samples resemble the CN thin-films obtained by Kouvetkakis [22] using thermal decomposition of triazine based compounds, the paracyanogen reported by Maya [31] or the "pseudo-carbon nitrides" by Komatsu [23].Probably, the highest resemblance on FTIR terms found in literature is for spectra reported on porous carbon nitride frameworks obtained after pyrolysis of covalent triazine networks at high temperature 700 • C [25] but not from pyrolysis of triazine based compounds at low temperature < 400 • C [13].In contrast, our chars are different compared with the guanidinium based chars from Rangel because absence of the 1650 and sharp 800 cm − 1 peak absorption [32].Guanidinium is the building block most similar to formamidinium with the difference of three -NH 2 groups instead of two surrounding the sp 2 carbon atom.This atomic bonding connectivity difference has a major impact on the type of carbon nitride formed (Section 4 Discussion).
Instead, the similarity of our chars to carbon nitrides obtained from pyrolysis of triazine-based precursors is reasonable as thermal decomposition of formamidinium yields into sym-triazine molecules [10].In any case, there are significant differences depending on the synthesis temperature but the halide present in the precursor does not seem to have an influence on the final FTIR spectra.The analysis of deconvoluted FTIR peaks in the skeletal mixed modes indicates that, independently of halide precursor, the 830 • C sample increased the ~1150 cm − 1 intensity peak by ~3.5 times compared to 630 • C sample.In contrast, ~1370 and ~1525 cm − 1 peaks decreased ~50% and ~40%, respectively (Fig. S8 and Table S1).Tentatively, we ascribe these intensity peak changes to increased depletion of C 3 N 3 triazine aromatic ring because of the higher pyrolysis temperature producing further condensation or bonding with other rings or plain thermal decomposition.[a]: Curve fittings deposited in the SI file, Fig. S7.[b]: Br630 sample peak area normalized to 100 units.

Raman spectroscopy
In contrast with FTIR spectra, Raman spectra do not show obvious differences depending on temperature of pyrolysis for the samples (Fig. 4).
According to laser wavelength excitation, the 488 (785) nm excited Raman spectra show three (two) major peaks around ~1360 (~1325), ~1560 (~1550) and ~2825 cm − 1 , see Fig. 4.a (Fig. 4.b).Raman spectra excited with 785 nm near-IR photons resemble better the FTIR spectra because both techniques are probing similar sp 2 structures [29,33].In contrast, Raman spectra using 488 nm visible excitation (Fig. 4.a) are richer in features as: 1) A1 = 690 cm − 1 and A2 = 990 cm − 1 bands assigned to specific breathing modes of the C 3 N 3 triazine ring [34], 2) ~2220 cm − 1 band due to CN sp 1 vibration, 3) ~2825 cm − 1 shoulder peak as the D2 second-order overtone [25,35,36], and 4) lack of bands corresponding to sp 3 hybridization in the synthesized materials.The ~1360 (~1325) cm − 1 band accounts breathing modes ascribed uniquely to sp 2 six fold C=N rings (D band).Instead, the ~1560(~1550) cm − 1 band corresponds to stretching modes for all type of sp 2 bonds including rings and polymeric chains (G band).Noteworthy, 1) G peak maximum position, 2) G dispersion (~0.03 cm − 1 /nm), 3) full width at half maximum (FWHM) of G and 4) I D /I G ratio values agree with the high 40-45 at% N content in these CN materials [29].Furthermore, the upshift of the G peak and its decreased FWHM following the increase of pyrolysis temperature agrees with the loss of N content observed by chemical bulk analysis and crystalline nanodomain thinning (sample amorphization) observed by X-ray analysis, respectively [29].In the same way, the I D /I G ratio increases as pyrolysis temperature increases independently of the laser excitation (Table 5) but better observed for 488 nm excitation.
The increasing I D /I G ratio has to be associated to the condensation of triazine rings with temperature, since A1 and A2 breathing modes of triazine decreased (Fig. 4.a).Thus, some C-C bonds form, which can be  a Peak assignment values have been rounded to the nearest tens.The setting of the exact position of the maximum and integrated peak intensity is reported in the supplementary information (Fig. S8 and Table S1).

Table 5
Area ratio between D and G Raman peaks depending on photon excitation and pyrolysis temperature.Peak fittings and deconvolution reported in SI file (Figs.S9 and S10 and Tables S2 and S3).chemically conjugated to surviving N-C ring bonds.However, an extended carbon network is still not possible even at the treatment temperature of 830 • C.This fact is in good agreement with the absence of any substantial development of the Raman G band and FTIR bands around 1580 cm-1.The I D /I G ratio of our samples is twice compared to those obtained from pyrolysis of covalent triazine framework [25,37], indicating that the presence of conjugated C-C-N sequences is higher pyrolyzing formamidinium precursors (a triazine-preserving event [10]) than directly triazine networks (a triazine-destruction event).The cluster size calculated using the Ferrari and Robertson equation Lc = [(I D /I G )/0.0055] 0.5 and I D /I G (485 nm) for Br630 and I630 low temperature samples is ~20 Å both.Instead, the Tuinstra-Koening expression for high temperature samples Lc = 44(I D /I G ) − 1 indicates 16 and 18 Å for Br830 and I830, respectively, in good accordance with a condensation process and with the crystallite size obtained from the Scherrer equation.Finally, this high I D /I G also indicates a low band gap for the samples [27,29] as measured from UV-Vis absorption and discussed in the next section.

UV-vis spectroscopy
In contrast with yellow, red or brown powders obtained for conventional C 3 N 4 type carbon nitrides [38], these black samples absorb all the visible and IR photon at least to 2500 nm wavelength (Fig. 5a).We found that high temperature samples show higher absorbance for photons above 1400 nm but there is no relevant difference in UV-Vis spectra considering the halide in precursor.Measuring optical properties in amorphous carbon and related materials is challenging [39].It is important to remark that a conventional photomultiplier tube detector (200-900 nm) in the UV-Vis equipment would have measured both high and low temperature materials with nearly identical UV-Vis absorption spectrum.The pseudo absorption F(R∞) of these materials calculated using the reflectance data and Kubelka-Munk transformation determined a Tauc plot profile (Fig. 5b).The extrapolation of the Tauc profile estimates a Tauc gap as small as ~ +300 meV for 630 • C samples and ~ − 300 meV for 830 • C samples.These low or even negative band gaps agree well with the high Raman I D /I G ratios empirically observed [29] and discussed in the before section.More conventional yellowish CNs present a band gap energy range between 2.5 and 2.8 eV due to π→π* transitions but as condensation increases and terminal amine groups are lost, the structure adopts a conformation in which electrons coming from nitrogen atoms can undergo the previous forbidden n→π* transition.As a consequence of this reduction of the band gap, these species adopt a dark brown color.Otherwise, the disordered structures show a black color like the graphite analogs [4,5].
Negative and indirect band gap indicates semimetal character for samples Br830 and I830.Recent first principles studies have predicted this semimetal behavior within C:N > 1 ratio carbon nitrides and chemical formula C 6 N, C 9 N 4 C 7 N 6 and C 10 N 3 [40][41][42].A first attempt to measure photoluminescence in the raw solid samples obtained gave negative or negligible signal.

UPS spectroscopy
UPS and XPS valence band spectra determined absolute band energy edges in these samples (Fig. 6).The UPS spectral shape for the valence band maximum (VBM) zone is featureless and smooth in shape corresponding to amorphous carbon nitride materials (inset of Fig. 6.a) [24,43].The 2p orbitals of sp 2 N and C atoms mainly constitute the occupied states near the energy gap [44].The position of the valence-band maximum with reference to the Fermi level of the instrument (VBM F ) is determined by the extrapolation of the steepest descent of the leading edge of the spectrum to the base line.In this case, there is different binding energy onset depending on halide precursors for low temperature pyrolysis samples Br630 (~2 eV) and I630 (~1 eV).In contrast, high temperature Br830 and I830 samples have the VBM F in the 0 eV Fermi level.The secondary electron cut off (SECO) zone grouped both high and low temperature samples with onset over 18.Despite the featureless UPS valence band spectra, the XPS data of the valence band zone (Fig. 6.b) show a common feature for all samples leading shoulder at the top of the valence band near 4 eV for 2p-π contributions and another peak at around 6 eV.Latter is only visible for high temperature samples suggesting an increased degree of

High resolution XPS spectroscopy
High resolution XPS data from C 1s and N 1s core levels disclose the local structural environment of these atoms in the samples (data from survey spectra were included in section 3.1 for chemical composition analysis).Deconvoluted C 1s spectra peaks show two peaks of similar area at binding energies of ~284.2 and ~285.5 eV for all samples corresponding to unsaturated C sp2 -C sp2 (and/or C sp2 -H) and N sp2 -(C sp2 -H)-N sp2 (triazine ring), respectively (Fig. S5).There is no clear distinction on the C 1s pattern depending on halide precursor used to obtain the material but high pyrolysis temperature samples show an increased area for the 284.2 eV peak.It indicates correlation between N atom content loss and increased conjugation of the material samples at high temperature synthesis.However, it is not possible to know in absolute terms the quantity of decreased/increased triazine domain because the unknown true contribution of adventitious carbon to the 285.5C 1s peak area.Remarkably, the absence of ~288 eV peak corresponding to C sp2 -(N sp2 ) 3 indicates absence of heptazine units in these materials.[24,44,45].
The N 1s zone offers more clear insight about the chemical environment surrounding the N atom depending on sample (Fig. 8).Deconvoluted N 1s spectra show three peaks at 397.9, 399.1, 400.2 and small shoulder at 402.5 eV corresponding to pyridinic (C sp2 -N sp2 -C sp2 ) or sym-triazine ring, pyrrolic (C-N sp2 -H), tricoordinated quaternary N + (N sp3 + -(C sp2 ) 3 ) and oxidized NO, respectively [3,46].As before C 1s zone, there is no clear distinction for N 1s pattern depending on halide, but pyrrolic area showed a decreased area in 399.1 eV peak and increased area in 400.2 eV for high temperature samples.It indicated correlation between H atom content loss from pyrrolic moiety and an increased full condensation as tricoordinated quaternary N atom in the material samples obtained at high temperature pyrolysis.Furthermore, the oxidized N content also increased for high temperature samples.

SEM
SEM images obtained at different magnifications show that samples consist of a bunch of micron-size randomly oriented wrinkled sheets (Fig. 9, Fig. S11).
The material has amorphous arrangement at the microscale, in agreement with XRD (Section 3.3), even inside relatively large aggregate particles.Electron diffraction from TEM confirmed this result (Section 3.10 below).Despite this furry aspect of samples, the textural properties did not show significant adsorption area (Section 3.2).Under our understanding, there is no clear morphological distinction from SEM images between samples obtained using different halide precursor or even obtained at different temperature.However, the EDS chemical analysis from SEM (Section 3.1) showed compositional differences depending on pyrolysis temperature.

STEM
High/low-magnification TEM images of the samples show large amorphous flakes (Fig. 10) confirmed by selected area electron diffraction (SAED) (inset Fig. 10a-d) consisting of two diffuse large rings at ~1.85 and ~1.05 Å d-spacing which attest of nanocrystalline or amorphous structure.
TEM micrographs and SAED indicate no clear morphological distinction between samples obtained using different halide precursor or pyrolysis temperature.However, the EDS chemical analysis from TEM equipment (Section 3.1) showed compositional differences depending on pyrolysis temperature.

NMR
13 C-MAS-NMR spectra show that samples have a broad asymmetric resonance at ~150 ppm attributed to sp 2 C-N or C-atoms of heterocyclic compounds containing N (Fig. 11) [47].Triazine based graphitic carbon nitrides show this resonance [30].The asymmetry of the main peak is attributed to the existence of resonance band at 110-120 ppm range due to 1) contribution of terminal sp CN [13,31] and 2) Csp 2 -Csp 2 environment [47].Latter contribution increased in samples Br830 and I830 correlating with the loss of N and larger conjugation of high temperature pyrolysis samples.

Electronic conductivity
The resistivity of samples becomes constant independently of the applied voltage applying pressure ≥ 57.0 MPa (Table 6, Fig. S2).Then, inner grain material assumes the electronic conductivity value discarding influence of other factors such as grain shape, electron percolation pathway, number and area of current conducting intergranular contacts and surface layers [48].
The electric conductivity of the two samples pyrolized at 830 • C is two orders of magnitude higher than the corresponding samples pyrolyzed at 630 • C. Besides, the chars obtained from iodide precursor show an order of magnitude higher in conductivity that the corresponding chars obtained from Br precursor.This result suggests that more extended and interconnected conductive domains are formed in the chars obtained from higher pyrolysis temperature, but it is unclear the difference observed depending on precursor.We hypothesized that I 2 and Br 2 molecule size and sublimation temperature play a relevant role in the formation of the amorphous CN network at early (low temperature) stages.On the other hand, Raman and high resolution XPS spectra (Section 3.5 and 3.8) detect an increase of six fold ring aromaticity or more conjugated nanodomains on samples pyrolyzed at higher temperatures explaining the improvement of conductivity in these samples  and the change from semiconductor to semimetallic character (Section 3.7, Fig. 7).

Mechanism of formation of triazine based amorphous carbon nitrides (TACN)
The key molecule in the synthetic route for extended CN materials is melamine [2].Melamine is a trimer of cyanamide with triazine ring skeleton and 1,3,5-carbon position atoms terminated in -NH 2 .Conventional CN precursors reaching melamine intermediate during pyrolysis include cyanamide, dicyanamide, urea, thiourea, cyanide, thiocyanate, guanidinium and dicyanamide salts.Instead, our CN precursor is the formamidinium cation, or more specifically, its conjugated base formamidine (Scheme 1.a).Formamidine has the special ability to polymerize with itself sequentially until linear trimer set (Scheme 1.b), then a cyclization reaction on the trimer forms the stable six units ring sym-triazine (Scheme 1.b.1) [10,49].This sym-triazine is the key molecule in the synthetic route of TACN.In essence, the carbon atom in melamine is surrounded by three N atoms and this atomic connectivity remains for all known synthesis pathways of extended CN based on triazine or heptazine units [2,3].Instead, sym-triazine with 1,3,5-carbon position terminated in acidic -H provides three different reactivity points for condensation reaction non-existent in melamine.
We think that at early stages of TACN formation, formamidine grows simultaneously sym-triazine (Scheme 1.b.1) and short oligomers of poly-HCN (H-(N=CH) n -NH 2 ) (Scheme 1.b.2).If only full sym-triazine was formed, the char would not be found because of the early sublimation and leakage from the reaction zone of the white powder sym-triazine (sublimation at ~80 • C).On the other hand, full linear poly-HCN formation does not match Raman and FTIR spectra signature [34] and chemical analysis composition indicates low hydrogen content (Section 3.1).Therefore, we rule out that one chemical pathway manifests prevalently.Then, early condensation of sym-triazine units with itself and with HCN oligomers might take place following the reaction network depicted in Scheme 1.c-g:Then, the temperature-dependent difference observed in chemical composition between Br630(I630) and Br830(I830) can be mainly attributed to the greater rate (or yield) of 1.c to 1.f pathways set in Scheme 1 at higher temperature favoring the release of volatiles NH 3 , H 2 and HCN.Noteworthy, the nitrogen content is high to consider TACN as nitrogen-doped carbons [3].The small amount of hydrogen remaining is = NH or -NH 2 but no -CH from sym-triazine (section 3.4 FTIR spectroscopy).Overall, the analysis of the spectra versus annealing temperature reveals that the major differences are microstructure changes and reorganization at atomic scale of C-N and C-C configurations.Halide anion (Br − and I − ) evolved at early low temperature as hydrogen halide gas (HI and HBr boiling point is − 35.4 • C and − 66 • C, respectively) noting the negligible effect of the precursor halide on the final pyrolysis product.A lower mass yield for high pyrolysis temperature chars (Section 2.1) indicates a material loss including HCN release favoring the spatial approximation of aromatic rings and conjugation that improves the electric conductivity (Scheme 1.f).Released gas components stated in this proposed self-polymerization mechanism, specifically HCN, were observed during previous TG-MS experiments in FAI and FABr [10].Although the material is amorphous (SAED), the interplanar distance of the condensed triazine rings in π− π stacking originates the XRD broad peak (Section 3.3).
We found in the scientific literature a great similarity in terms of chemical signature in FTIR, Raman and XPS spectroscopy with porous carbon nitride frameworks derived from pyrolysis of covalent triazine frameworks [25].In contrast to these compounds, our material is not porous but amorphous and compact, ideal for developing chemically inert protective coatings.Noteworthy, formamidine molecule is not limited to bulk pyrolysis methods but it could be envisaged as precursor for a vapor-phase transport assisted direct condensation method to prepare carbon nitride films with controllable thickness [50].

Perovskite solar cells
In contrast with FA + , methylammonium cation (MA + ), the second most commonly used cation in the field of hybrid halide perovskite semiconductors [51], does not produce carbon nitrides after pyrolysis [52].Because both low molecular weight organic cations have similar thermal evaporation temperatures [53], the ability of FA + to polymerize with itself is due to the sp 2 hybridized C and N atoms in contrast to the lower chemical potential of C and N as sp 3 atoms in MA + .Nowadays, the most efficient and most stable hybrid perovskite based solar cells contain > 85% formamidinium cation or larger amount in the A position of the perovskite structure being the remainder inorganic cesium cation followed by methylammonium cation if any [53].Therefore, this finding of FA salts forming bulk carbon nitride by thermal decomposition opens the door to a new strategy to improve operational stability in perovskite solar cells: sacrificing part of the active perovskite thin film to natively form a protective CN layer in a manner equivalent to the passivation role of SiO 2 natively generated in Si solar cells [54].In our opinion, it could be the first stone on the path to get stable and commercial hybrid perovskite solar cells.But it remains to be demonstrated that a CN based native passivation film can be partially formed on perovskite and the remaining active layer could still be functional in photovoltaic cells, LEDs and battery electrode applications.

Conclusions
Formamidinium halide salts pyrolysis led to amorphous and nonporous products that cannot be considered neither conventional carbon (IV) nitrides nor N doped carbon materials.Instead, they are chemically tunable carbon nitrides (C x N y H z ) composed by sp 2 six member rings and short unsaturated oligomers of poly-HCN conjugated domains.Heptazine type moiety is not detected in FTIR nor high resolution XPS C1s spectra, therefore we conclude that conjugated domains present in the synthesized samples are triazine or triazine-like structures.The halide used in the initial precursor leads to negligible differences in the carbon nitride product obtained.On the other hand, pyrolysis temperature plays a much more relevant role since samples synthesized at 830 • C present a lower nitrogen content, a higher degree of conjugation, a smaller crystallite size and a higher electronic conductivity.Regarding their potential applications, hybrid perovskites are of the outmost studied photovoltaic material in the last decade, being the formamidinium cation one of the most used A type cation in hybrid halogenated perovskite structure.A selective and controlled thermal degradation of the outer exposed thin-film of formamidinium based perovskite could be employed simultaneously as hole selective extraction layer and promising inert native passivation layer against environmental agents in perovskite solar cells.
CRediT authorship contribution statement E.J.J-P conceived the idea, designed experiments and supervised the work.M.H. designed experiments, supervised the work, performed and analysed conductivity measurements.I.C-R.wrote initial version of the manuscript, performed TACN preparation, UV-vis-IR and conductivity measurements.N.N. carried out adsorption isotherms, X-ray diffraction and Raman spectroscopy.F.D. prepared and characterized FAI and FABr precursors.R.A. supervised C.F. and they performed and analyzed TEM, EELS and EDS (TEM equipment)A.A-C performed X-ray, adsorption isotherms and XPS.All authors contributed to editing the paper.

Declaration of competing interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
2 eV (16.6 eV) for Br630 and I630 (Br830 and I830).Then, the absolute VBM with reference to vacuum level is VBM = SECO -hν -VBM F = − 5.0 eV for Br630, -4.0 eV for I630 and -4.6 eV for Br830 and I830.Fig. 7 depicts tentatively a scheme of the band energy levels for the samples.The optical band gap from Tauc plots determined the conduction band minimum (CBM) by subtraction to VBM.In contrast with wide band gap conventional graphite like C 3 N 4 or melon type polymers whose CBM and VBM energy levels align well for the standard potential of proton reduction reaction (− 4.44 eV) and water oxidation (− 5.67 eV), these samples are narrow band gap with CBM ideally aligned for proton reduction in the case of I630.Instead, Br630/Br830/I830 samples VBM level complies for hole (positive charge carrier) selective extraction material in perovskite solar cells (VBM ~ − 5.4 eV).

Fig. 5 .
Fig. 5. a) UV-vis total (specular or direct plus diffuse) reflectance of samples and b) Tauc plot (indirect allowed band gap setting) of the Kubelka-Munk transformation of the total reflectance data.Red arrow indicates the band gaps after extrapolation to zero axis.

Fig. 6 .
Fig. 6. a) UPS of the four samples measured with the 21.2 eV excitation energy corresponding to He I radiation.Inset: valence band spectra.b) XPS valence band spectra of the four samples measured with the 1486.7eVexcitation energy corresponding to Al Kα radiation.The zero of energy is the Fermi level.

Fig. 7 .
Fig. 7. Scheme depicting band structure and alignments in absolute scale (vacuum level) considering intrinsic indirect band gap (BG) type obtained from UV-Vis-IR spectrometry and Tauc plots.VBM energy level from UPS data for a) Br630 and I630 and b) semimetals Br830 and I830.

Scheme 1 .
Scheme 1. Proposed self-polymerization mechanism of FA to form TACN.

Table 2
Surface area and total pore volume of the samples.
Fig. 2. Powder XRD diffractograms of the four samples.

Table 3
Fittings parameters for the XRD peak.[a].

Table 4
Summary of FTIR peaks description.