![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
fork
Fork of LG by
Diff: Global.c
- Revision:
- 208:19150d2b528f
- Parent:
- 207:d1ce992f5d17
- Child:
- 209:224e7331a061
diff -r d1ce992f5d17 -r 19150d2b528f Global.c --- a/Global.c Fri Jan 13 08:27:28 2017 +0000 +++ b/Global.c Tue Feb 07 10:11:35 2017 +0000 @@ -6,6 +6,7 @@ unsigned char BuffTemp[100]; unsigned char Time[1000]; unsigned int Event1Hz; +unsigned int Event100Hz; unsigned int Event500Hz; unsigned int Event1K; unsigned int Event100K; @@ -18,6 +19,7 @@ unsigned int Time1K; unsigned int Time500Hz; unsigned int Time1Hz; +unsigned int Time100Hz; unsigned int Clock1Hz; unsigned int ShiftD; unsigned int ShiftL; @@ -32,10 +34,11 @@ void Param_init(void) { + int temp=0; + InitMOD(); - Gyro.RgConA = 0xffff; - Gyro.RgConB = 0xffff; + Global_Time = 0; Time_UART = 0; Time_Sec = 0; @@ -68,8 +71,7 @@ Pulse_16PointD = 0; Pulse_32Point = 0; Gyro.FlashMod=0; - - + ///////////////////////////////////////////// ///////////инициализация таймеров//////////// @@ -86,65 +88,79 @@ GyroP.Str.ParamMod=0; ReadFlash (); - if(GyroP.Str.ParamMod==11223) + if(GyroP.Str.ParamMod) { - Gyro.My_Addres = GyroP.Str.My_Addres; // Gyro.My_Addres = 0; - Gyro.GLD_Serial = GyroP.Str.GLD_Serial; - Gyro.Firmware_Version = GyroP.Str.Firmware_Version; - - Gyro.FrqHZ = GyroP.Str.FrqHZ; - Gyro.Frq = GyroP.Str.FrqHZ<<16; - Gyro.FrqHZmin = GyroP.Str.FrqHZmin<<16; - Gyro.FrqHZmax = GyroP.Str.FrqHZmax<<16; - Gyro.FrqChengSpeed = GyroP.Str.FrqChengSpeed; - - Gyro.ModAmp = GyroP.Str.ModAmp; + Gyro.My_Addres = GyroP.Str.My_Addres; // Gyro.My_Addres = 0; + Gyro.GLD_Serial = GyroP.Str.GLD_Serial; - Gyro.AmpPer = GyroP.Str.AmpPer; - Gyro.Amp = GyroP.Str.AmpPer<<16; - Gyro.AmpSpeed = GyroP.Str.AmpSpeed; - Gyro.AmpPerDel = GyroP.Str.AmpPerDel; - Gyro.AmpTarget = GyroP.Str.AmpTarget; - Gyro.AmpPerMin = GyroP.Str.AmpPerMin; - Gyro.AmpPerMax = GyroP.Str.AmpPerMax; - Gyro.AmpMin = GyroP.Str.AmpMin; - Gyro.AmpTD = GyroP.Str.AmpTD; + + Gyro.FrqHZ = GyroP.Str.FrqHZ; + Gyro.Frq = GyroP.Str.FrqHZ<<16; + Gyro.FrqHZmin = GyroP.Str.FrqHZmin<<16; + Gyro.FrqHZmax = GyroP.Str.FrqHZmax<<16; + Gyro.FrqChengSpeed = GyroP.Str.FrqChengSpeed; + Gyro.PLC_Gain = GyroP.Str.PLC_Gain; + Gyro.PLC_Phase = GyroP.Str.PLC_Phase; + Gyro.ModAmp = GyroP.Str.ModAmp; + Gyro.FrqPhase = GyroP.Str.FrqPhase; + Gyro.AmpPer = GyroP.Str.AmpPer; + Gyro.Amp = GyroP.Str.AmpPer<<16; + Gyro.AmpSpeed = GyroP.Str.AmpSpeed; + Gyro.AmpPerDel = GyroP.Str.AmpPerDel; + temp=((GyroP.Str.VB_Fdf_Hi<<16) | GyroP.Str.VB_Fdf_Lo); + temp=temp/18.2; + Gyro.AmpTarget=(unsigned int)(temp); + Gyro.AmpPerMin = GyroP.Str.AmpPerMin; + Gyro.AmpPerMax = GyroP.Str.AmpPerMax; + Gyro.AmpMin = GyroP.Str.AmpMin; + Gyro.AmpTD = GyroP.Str.AmpTD; + Spi.DAC_A = GyroP.Str.DAC_current_Work; + // Gyro.TermoNKU = GyroP.Str.TermoNKU<<2; - Gyro.TermoNKU = GyroP.Str.TermoNKU<<2; - - Spi.DAC_A = GyroP.Str.DAC_A<<2; - Spi.DAC_B = GyroP.Str.DAC_B<<2; + // Spi.DAC_A = GyroP.Str.DAC_A; + + // Spi.DAC_B = GyroP.Str.DAC_B; - Gyro.Gain_Sin = GyroP.Str.Gain_Sin; - Gyro.Gain_Cos = GyroP.Str.Gain_Cos; + Gyro.Gain_Sin = GyroP.Str.Gain_Sin; + Gyro.Gain_Cos = GyroP.Str.Gain_Cos; + Out_G_photo(Gyro.Gain_Sin, Gyro.Gain_Cos); } else { - + + Gyro.PLC_Phase = 3; + Gyro.PLC_Gain = 3; + Gyro.FrqPhase = 8; Gyro.FrqHZ = 403; Gyro.Frq = Gyro.FrqHZ<<16; Gyro.FrqHZmin = 350<<16; Gyro.FrqHZmax = 450<<16; Gyro.FrqChengSpeed = 100; Gyro.ModAmp = 250; - Gyro.AmpPer = 15; + Gyro.AmpPer = 20; Gyro.AmpPerMin = 2; Gyro.AmpPerMax = 90; Gyro.AmpSpeed = 1; Gyro.AmpPerDel = 3; - Gyro.AmpTarget = 7000;// целевая амплитуда ВП - Gyro.Amp = 15*65535; + Gyro.AmpTarget = 5500;// целевая амплитуда ВП + Gyro.Amp = 20*65535; Gyro.AmpMin = 20;// минимальное значение AmpT;5 - Gyro.AmpTD = 30;//////////////////////////////////////////////////////// + Gyro.AmpTD = 20;//////////////////////////////////////////////////////// Gyro.TermoNKU = 44700;//48824*0,0061-273=25 С° - Spi.DAC_A = 41000; - Spi.DAC_B = 35220; + Spi.DAC_B = 32220; Gyro.PLC_Error2Mode = 1400; //для записи мод Gyro.Gain_Sin = 175; Gyro.Gain_Cos = 215; Gyro.Firmware_Version = 0x9; //версия программы Gyro.GLD_Serial = 123; //серийный номер Gyro.My_Addres = 0; //адрес глд + Gyro.Tmp_OffsetT4 = 0; + Gyro.Tmp_OffsetT5 = 0; + Gyro.Tmp_scaleT4 = 1; //53 + Gyro.Tmp_scaleT5 = 1; + + Gyro.DAC_current_Work =50000; //3 + Gyro.DAC_current_Start =41000; } switch(Gyro.My_Addres){//смещение поджига и подсветки в зависимости от адреса ГЛД case 0: