This is a sub-function of the ADC instrunction. It is useful as it cane be used in other part of the program such as detector bias setting and offset adjustement.
We manage the relais which take care of the deetector performances. The relay for the pre PGA gain x1 - x10 is managed here, too.
This instruction needs to know the gain to set and the channel to apply the setting. These informztion is at byte istruzione_byte_4_e_scelta_canale of the CAN message.
526 for( canale_=0; canale_<6; canale_++){
531 void Detector_PGA_Rele(
char discriminazione){
532 char chan=0, action=0;
534 if (discriminazione>=0x10) chan=1;
535 action= discriminazione & 0x0F;
541 PGA_pre_gain=PGA_pre_gain_1_ch1;
543 PGA_pre_gain=PGA_pre_gain_1_ch0;
548 PGA_pre_gain=PGA_pre_gain_10_ch1;
550 PGA_pre_gain=PGA_pre_gain_10_ch0;
553 GPIO_PinWrite(PGA_pre_gain.porta_num, PGA_pre_gain.pin_num, 1);
555 GPIO_PinWrite(PGA_pre_gain.porta_num, PGA_pre_gain.pin_num, 0);
559 Funzione_per_attivare( chan, (1 << action));
void PGA_set_reset_pre_PGA_gain(uint8_t scheda_su_scheda_giu, uint8_t canale, uint8_t set_2_reset_1_idle_0)
Here the 2 digital signals from the trimmer are exploited to set the gain of the input stage of the P...
#define PGA_set_pre_pga_low_gain
Set the amplifier gain in front of the PGA to 1 V/V, it is left shifted once in the trimmer.
#define wait_time_for_rele_setting
[ref_spi_clock_for_relais]
void instruction_Detector_PGA_Rele(void)
This is a sub-function of the ADC instrunction. It is useful as it cane be used in other part of the ...
void Aspetta_tanti_ms(int millisecondi)
The timing function.