![]() |
CROSS Technical Documentation User Manual and Technical Doc.
INFN Milano Bicocca
|
Trimmer managing
SUMMARY:
Trimmers are used for setting the detector bias, the preamplifier offset and the preamplifier thermal drift and the gain of the trimmer based PGA. The trimmer used is the AD5263 datasheet, a quad trimmer whose schematic diagram is in figure Figure_Trimmer_AD5263_trimmer. To manage the stuffs we have 3 main functions, quite similar: preamplifier_scrittura_lettura_trimmer(uint8_t scheda_su_scheda_giu, uint8_t canale, uint8_t trimmer, uint8_t valore, uint8_t scrivi_1_leggi_0 ), detector_scrittura_lettura_trimmer_bias(uint8_t scheda_su_scheda_giu, uint8_t canale, uint8_t trimmer, uint8_t valore, uint8_t scrivi_1_leggi_0) and trimmer_based_PGA(). We have a sort of tree: it needs to identify the board, the channel, the trimmer and the value to write, if we need to write, otherwise we read the content; reading writing is established with the boolean scrivi_1_leggi_0.
For detector and preamplifier the 4 trimmers of the chip have different functions. For what concern the preamplifier we have that (the bullet number is the addresss inside the chip):
Whereas for detector trimmer:
The content of every trimmer is stored in matrixes: contenuto_trimmer_detector, contenuto_trimmer_preamplifier and contenuto_trimmer_PGA_a_trimmer. They are listed here with their default values:
For the caseof the trimmer based PGA the number of trimmers used for the 12 channles is 6, one every 2 channels:
Although not necessary for its direct usage, let's give a bit of further details. Every trimmer chip is selectd by mean of a constant struct with which it is possible to select both the I2C and its I2C address:
First of all the I2C, the I2C mux and which of the 4 I2C mux output channels must be selcted with I2C_mux_select_ch( uint8_t scheda_su_scheda_giu, uint8_t mainboard_postmainboard , uint8_t canale_da_abilitare)
We have the 2 constant structures for trimmer selection address_detector_bias_trimmer and address_preamplifier_trimmer. The structures are used within the functions preamplifier_scrittura_lettura_trimmer() and detector_scrittura_lettura_trimmer_bias(). Here an example:
Offset regulation of preamplifier is based on 2 trimmers, a coarse and fine trimmer. The adjustment can be done by SAR tecnique or by setting the propoer value of the trimmers, if it is known their effects. The in-between solution is to set the value of the trimmers at a guess value, then use the SAR for a few bits. The function is quite long and reported here instr_offset_trimmer_calibration_function().
Once that the slope has been measured it is stored in the preamplifier EPROM. The 2 slopes are stored at 2 locations preceded by a location that says if the slopes have been characterized (the complete list is at Preamplifier EPROM location list):
Namely if Memory_preamplifier_slope_calibration_ON_0_OFF_ff is 0xFF, the initial default, the following 2 locations are not usable because not set. If Memory_preamplifier_slope_calibration_ON_0_OFF_ff is 0, then the 2 following location have been characterized and are usable. In this latter case the slopes stored could be either the actual value measured or the nominal value if, during characterizatin, the measured values resulted outside ± 20% of tolerance with respect to the nominla value.
Refer to Detector Bias and Preamplifier Offset Drift Correcttion for trimmer usage.
The code for mamnaging the trimmers is at: