12#define saturazione_positiva (int) 4.5e6
13#define saturazione_negativa (int) -4.5e6
19#define istruzione_codice 7
20#define istruzione_byte_0 2
21#define istruzione_byte_1 3
22#define istruzione_byte_2 4
23#define istruzione_byte_3 5
24#define istruzione_byte_4_e_scelta_canale 6
25#define byte_istr_dati_0 0
26#define byte_istr_dati_1 1
27#define byte_istr_dati_2 2
28#define byte_istr_dati_3 3
36#define instr_canale_1 1<<0
37#define instr_canale_2 1<<1
38#define instr_canale_3 1<<2
39#define instr_canale_4 1<<3
40#define instr_canale_5 1<<4
41#define instr_canale_6 1<<5
42#define instr_scheda_up 1<<7
43#define instr_all_channels instr_canale_1 | instr_canale_2 | instr_canale_3 | instr_canale_4 | instr_canale_5 | instr_canale_6
44#define instr_scheda_down 0
46#define write_trimmer (1<<6)
47#define board_up (1<<7)
157void instr_PGA_DAC_GAIN_CROSS_function(
void);
166#define ADC_GND_con_10k 16
167#define ADC_Vdig5V_micro_passed 17
170#define ADC_JFET_c_ch1_S2 20
171#define ADC_PRE_term_ch1 21
172#define ADC_ADC_PGA_pos_in_ch1 22
173#define ADC_ADC_PGA_neg_in_ch1 23
175#define ADC_Misura_bias_10_att_ch1_p 32
176#define ADC_Misura_bias_10_att_ch1_n 33
177#define ADC_Misura_bias_20_att_ch1_p 34
178#define ADC_Misura_bias_20_att_ch1_n 35
179#define ADC_CommonMode_ch1 36
180#define ADC_CommonMode_ch2 37
181#define ADC_ADC_PGA_pos_out_ch1 38
182#define ADC_ADC_PGA_neg_out_ch1 39
184#define ADC_Vdig5V_micro_in 48
187#define ADC_Vref_pos_in 51
188#define ADC_Vref_neg_in 52
189#define ADC_PRE_term_ch2 53
190#define ADC_ADC_PGA_pos_in_ch0 54
191#define ADC_ADC_PGA_neg_in_ch0 55
193#define ADC_Misura_bias_10_att_ch0_p 64
194#define ADC_Misura_bias_10_att_ch0_n 65
195#define ADC_Misura_bias_20_att_ch0_p 66
196#define ADC_Misura_bias_20_att_ch0_n 67
197#define ADC_JFET_c_ch0_S1 68
198#define ADC_JFET_c_ch0_S2 69
199#define ADC_ADC_PGA_pos_out_ch0 70
200#define ADC_ADC_PGA_neg_out_ch0 71
204extern int valore_target_per_offset[];
206enum parameters_to_set{
207set_value_for_wait_for_ADC_setting
228void Misura_della_temperatura(
int *misura_temperatura_locale);
234void Detector_PGA_Rele(
char discriminazione);
235void aggiustamento_SAR(
bool *saturazione_canale,
int attesa,
char *nodo_di_misura_1);
236void offset_Adjust_core(
char chi_aggiustiamo,
int *valore_target_per_ch,
char *nodo_di_misura_1,
char *nodo_di_misura_2, \
237 int tolleranza,
int *coarse_trimmer_step,
int *fine_trimmer_step,
unsigned int attesa,
int *misura_finale);
238void attiva_il_CMRR(
char chi_aggiustiamo ,
char attivare_si_no);
248enum instructions_position {
250 instr_ADC_LETTURA_mux_selection ,
251 instr_ADC_LETTURA_adc_line_selection
254enum instructions_position_rele {
256 instr_CONTROLLO_RELE_Rele_canale = 1 ,
257 instr_CONTROLLO_RELE_quale_rele ,
258 instr_CONTROLLO_RELE_che_fare
261enum instructions_position_PGA {
263 instr_PGA_GAIN_quale_canale = 1 ,
267enum instructions_position_Vbias {
269 instr_Vbias_set_quale_canale = 1 ,
273enum instructions_position_temp {
275 instr_preamplifier_temperature_meas_quale_canale = 1 ,
279enum instructions_position_power {
281 instr_Power_supply_ON_OFF_power_ON_OFF = 1 ,
291enum instructions_position_shut_down {
293 instr_Shut_Down_ON_OFF_Shut_Down_ON_OFF = 1 ,
297enum instructions_position_Vbias_and_offset {
299 instr_Vbias_and_OFFSET_SET_canale_0_1 = 1 ,
303enum instructions_position_trimmer_setting {
305 instr_Trimmer_setting_canale_e_cosa = 1 ,
310enum shut_down_ON_OFF {
312 instr_Shut_Down_ON_OFF_ShutDown_ON ,
313 instr_Shut_Down_ON_OFF_ShutDown_OFF
337enum Canale_per_rele {
345enum Canale_per_rele_1 {
353enum rele_stato_0_stato_1 {
void instr_readback_variables_function(void)
readback of some parameters
void Setting_of_the_pointer_for_command_parser(void)
The pointer to the instruction functions is constructed here.
void instr_readback_node_voltages_function(void)
readback of some node voltages from external ADC
void instr_connect_disconnect_mux_node_function(void)
Routing of available node voltage to outout by means of the analog mux.
void instr_PGA_gain_set_function(void)
PGA gain set.
void instr_preamplifier_gain_low_high_set_function(void)
preamplifier gain set large or small
void instr_preamplifier_memory_function(void)
void instr_preamplifier_temperature_meas_function(void)
void(* ptr_istruzioni[The_total_number_of_instrucions])(void)
This is the pointer array to the instructions set: the byte istruzione_codice of the CAN message is t...
void instr_PGA_set_reset_pre_PGA_gain_function(void)
PGA input stage gain set.
void instruction_Misura_della_temperatura(void)
The temperature from both preamplifier is read.
void instruction_lettura_ADC(void)
ADC instrunction implementation with node selection.
void instr_NO_operation_function(void)
The NOP sends backs the fw version.
void instr_Shut_Down_ON_OFF_function(void)
μ-controller power down ON/OFF
@ node_voltage_PreOut_ch_4
...
@ node_voltage_PreOut_neg_ch_4
...
@ node_voltage_PreOut_ch_5
Node voltage selection of PreOut 12+5 board down.
@ node_voltage_PreOut_ch_0
Node voltage selection of differential or positive PreOut 0, offset from 12.
@ node_voltage_PreOut_ch_2
...
@ node_voltage_PreOut_neg_ch_5
...
@ node_voltage_PreOut_neg_ch_0
Node voltage selection of negative PreOut.
@ node_voltage_PreOut_neg_ch_1
...
@ node_voltage_PreOut_ch_3
...
@ node_voltage_PreOut_neg_ch_3
...
@ node_voltage_PreOut_ch_1
...
@ node_voltage_PreOut_neg_ch_2
...
@ node_voltage_PreOut_offset
Starting Offset for this set of nodes.
int wait_for_ADC_setting
This is the time elapsed before the ADC starts to measure after that the Mux has been set.
@ node_voltage_PowSupp_offset
Starting Offset for this set of nodes.
@ node_voltage_sense_Vreg_n
Measured from postmainboardo only.
@ node_voltage_sense_GND
Measured from postmainboardo only.
@ node_voltage_sense_Vreg_p
Measured from postmainboardo only.
@ node_voltage_Vcc
Offset starts at 24.
node_voltage_pga
Node voltages that can be read from an external ADC.
@ node_voltage_PGA_neg_ch_4
...
@ node_voltage_PGA_neg_ch_5
...
@ node_voltage_PGA_ch_1
...
@ node_voltage_PGA_ch_4
...
@ node_voltage_PGA_ch_2
...
@ node_voltage_PGA_neg_ch_1
...
@ node_voltage_PGA_neg_ch_6
...
@ node_voltage_PGA_ch_5
Node voltage selection of PGA 5.
@ node_voltage_PGA_neg_ch_0
Negative output for PGA.
@ node_voltage_PGA_ch_0
Node voltage selection of PGA differential or positive.
@ node_voltage_PGA_neg_ch_3
...
@ node_voltage_PGA_ch_3
...
@ node_voltage_PGA_neg_ch_2
...
@ node_voltage_PGA_offset
Starting Offset for this set of nodes.
void instruction_Offset_compensation(void)
Output offset voltage compensation.
void aggiustamento_SAR(bool *saturazione_canale, int attesa, char *nodo_di_misura_1)
When the preamplifier output is saturated we start with the standard SAR.
void instruction_Some_parameters_to_set(void)
Some usefull parematers can be set here.