![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
forkd
Fork of LGstaandart by
SPI.c@221:53b256368ca1, 2017-10-23 (annotated)
- Committer:
- Kovalev_D
- Date:
- Mon Oct 23 05:31:10 2017 +0000
- Revision:
- 221:53b256368ca1
- Parent:
- 220:04c54405b82d
- Child:
- 222:7de7b3bf3a1d
- Child:
- 223:2344d5f4aa50
plc
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
igor_v | 0:8ad47e2b6f00 | 1 | #include "Global.h" |
igor_v | 0:8ad47e2b6f00 | 2 | struct SPI Spi; |
Kovalev_D | 112:4a96133a1311 | 3 | //unsigned int Temp_AMP; |
Kovalev_D | 96:1c8536458119 | 4 | unsigned int Temp_AMP64P; |
Kovalev_D | 196:f76dbc081e63 | 5 | int ttt=1; |
Kovalev_D | 99:3d8f206ceac2 | 6 | unsigned int Count_AMP, ADD_AMP, Cur_Amp; |
Kovalev_D | 99:3d8f206ceac2 | 7 | int Znak_Amp; |
Kovalev_D | 109:ee0cff33ad3b | 8 | int AD_Regul = 0; |
Kovalev_D | 190:289514f730ee | 9 | int temp9,tempADC5; |
Kovalev_D | 148:7ce8c1fd00f7 | 10 | int AD_MAX=0; |
Kovalev_D | 220:04c54405b82d | 11 | unsigned int SPIlog; |
Kovalev_D | 196:f76dbc081e63 | 12 | int k=0,l=0,r=0,n=0;//счетчики для регулировки периметра |
Kovalev_D | 188:4c523cc373cc | 13 | int flagmod=0,Bdelta; |
Kovalev_D | 191:40028201ddad | 14 | int start=10; |
Kovalev_D | 197:7a05523bf588 | 15 | int dispersion=0,side=1,tempstrafe=15000; |
Kovalev_D | 214:4c70e452c491 | 16 | int ADC_5_T; |
Kovalev_D | 147:1aed74f19a8f | 17 | unsigned int TempA; |
Kovalev_D | 158:0c8342e1837a | 18 | unsigned int TempTermLM; |
Kovalev_D | 211:ac8251b067d2 | 19 | unsigned int conuntPLS; |
Kovalev_D | 197:7a05523bf588 | 20 | int ADC5Old,ADCDIF=0; |
Kovalev_D | 215:b58b887fd367 | 21 | /*int DACModReg;*/ |
Kovalev_D | 197:7a05523bf588 | 22 | int SinPls=0,SinMns=0; |
Kovalev_D | 214:4c70e452c491 | 23 | int TSinPls=0,TSinMns=0; |
Kovalev_D | 213:9953db9543d6 | 24 | int timer=750; |
Kovalev_D | 216:189b0ea1dc38 | 25 | int sum=0; |
Kovalev_D | 216:189b0ea1dc38 | 26 | unsigned int testcount=0,faza, fazaFlag=0; |
Kovalev_D | 197:7a05523bf588 | 27 | unsigned int ADC5New; |
Kovalev_D | 95:dd51e577e114 | 28 | unsigned int Buff_ADC_1 [32]; |
Kovalev_D | 95:dd51e577e114 | 29 | unsigned int Buff_ADC_2 [32]; |
Kovalev_D | 95:dd51e577e114 | 30 | unsigned int Buff_ADC_3 [32]; |
Kovalev_D | 95:dd51e577e114 | 31 | unsigned int Buff_ADC_4 [32]; |
Kovalev_D | 220:04c54405b82d | 32 | int Buff_OUT1 [64]; |
Kovalev_D | 220:04c54405b82d | 33 | int Buff_OUT [64]; |
Kovalev_D | 213:9953db9543d6 | 34 | int RegulADC,DeltaRegul,tempDeltaRegul; |
Kovalev_D | 220:04c54405b82d | 35 | int count10v=0,AMPSUM,AMPSUMP,AMPSUMM,AMPSUM_DESP,AMPSUMPout,AMPSUMMout,SumDelta,PLC_EROR,PLC_Flag,HFO_Flag,HFOdelta,HFOregul,HFOSumDelta; |
Kovalev_D | 214:4c70e452c491 | 36 | |
Kovalev_D | 215:b58b887fd367 | 37 | |
Kovalev_D | 215:b58b887fd367 | 38 | //int BuffADC_32Point [64]; |
Kovalev_D | 214:4c70e452c491 | 39 | |
Kovalev_D | 215:b58b887fd367 | 40 | //unsigned int Buff_ADC_5 [255]; |
Kovalev_D | 197:7a05523bf588 | 41 | |
Kovalev_D | 215:b58b887fd367 | 42 | |
Kovalev_D | 197:7a05523bf588 | 43 | |
Kovalev_D | 197:7a05523bf588 | 44 | |
Kovalev_D | 215:b58b887fd367 | 45 | //unsigned int PulseADC_16Point; |
Kovalev_D | 215:b58b887fd367 | 46 | //unsigned int PulseADC_32Point; |
Kovalev_D | 215:b58b887fd367 | 47 | //unsigned int PulseADC_64Point; |
Kovalev_D | 215:b58b887fd367 | 48 | //unsigned int PulseADC_32PointD; |
Kovalev_D | 215:b58b887fd367 | 49 | |
Kovalev_D | 215:b58b887fd367 | 50 | |
Kovalev_D | 215:b58b887fd367 | 51 | //unsigned int Buff_AMP [256]; |
Kovalev_D | 215:b58b887fd367 | 52 | //unsigned int Buff_AMP64P [256]; |
Kovalev_D | 220:04c54405b82d | 53 | unsigned int TypeMod=0; |
Kovalev_D | 197:7a05523bf588 | 54 | unsigned int ModArraySin [64] = {50,55,59,64,68,73,77,81,85,88,91,94,96,98,99,99,100,99,99,98,96,94,91,88,85,81,77,73,68,64,59,55,50,45,41,36,32,27,23,19,16,12,9,7,4,2,1,1,0,1,1,2,4,7,9,12,16,19,23,27,32,36,41,45}; |
Kovalev_D | 218:b4067cac75c0 | 55 | unsigned int ModArraySin32 [32] = {50,59,68,77,85,91,96,99,100,99,96,91,85,77,68,59,50,41,32,23,16,9,4,1,0,1,4,9,16,23,32,41}; |
Kovalev_D | 216:189b0ea1dc38 | 56 | unsigned int ModArrayTriangle [64]; |
Kovalev_D | 216:189b0ea1dc38 | 57 | unsigned int ModArraySaw [64]; |
Kovalev_D | 216:189b0ea1dc38 | 58 | unsigned int Mod=0; |
Kovalev_D | 216:189b0ea1dc38 | 59 | int znak; |
Kovalev_D | 197:7a05523bf588 | 60 | |
Kovalev_D | 197:7a05523bf588 | 61 | void InitMOD(void) |
Kovalev_D | 197:7a05523bf588 | 62 | { |
Kovalev_D | 220:04c54405b82d | 63 | for (int i = 0; i < 64; i++ ) |
Kovalev_D | 197:7a05523bf588 | 64 | { |
Kovalev_D | 220:04c54405b82d | 65 | if(i<32) { ModArrayTriangle[i]=Mod; Mod=100;} |
Kovalev_D | 220:04c54405b82d | 66 | else { ModArrayTriangle[i]=Mod; Mod=0;} |
Kovalev_D | 197:7a05523bf588 | 67 | } |
Kovalev_D | 197:7a05523bf588 | 68 | |
Kovalev_D | 207:d1ce992f5d17 | 69 | for (int i = 0; i < 16; i++ ) |
Kovalev_D | 197:7a05523bf588 | 70 | { |
Kovalev_D | 216:189b0ea1dc38 | 71 | ModArraySaw[i]=Mod; |
Kovalev_D | 216:189b0ea1dc38 | 72 | Mod+=1; |
Kovalev_D | 220:04c54405b82d | 73 | } |
Kovalev_D | 197:7a05523bf588 | 74 | } |
Kovalev_D | 197:7a05523bf588 | 75 | void Modulator(void) |
Kovalev_D | 197:7a05523bf588 | 76 | { |
Kovalev_D | 197:7a05523bf588 | 77 | switch(TypeMod) |
Kovalev_D | 197:7a05523bf588 | 78 | { |
Kovalev_D | 220:04c54405b82d | 79 | |
Kovalev_D | 220:04c54405b82d | 80 | // case 0: LPC_DAC->DACR = (ModArraySin [(CountV64+Gyro.PLC_Phase)&0x3f])*Gyro.ModAmp + Gyro.ShiftMod-32000; break; |
Kovalev_D | 220:04c54405b82d | 81 | case 0: LPC_DAC->DACR = (ModArraySin [(CountV64+Gyro.PLC_Phase)&0x3f])*Gyro.ModAmp + Gyro.ShiftMod-32000; break; |
Kovalev_D | 220:04c54405b82d | 82 | |
Kovalev_D | 216:189b0ea1dc38 | 83 | case 1: LPC_DAC->DACR = (ModArraySaw [CountV64]*Gyro.ModAmp); break; |
Kovalev_D | 216:189b0ea1dc38 | 84 | case 2: LPC_DAC->DACR = (ModArrayTriangle [(CountV64-2)&0x3f]*Gyro.ModAmp); break; |
Kovalev_D | 216:189b0ea1dc38 | 85 | case 3: LPC_DAC->DACR = (ModArrayTriangle [(CountV64-2)&0x3f]*Gyro.ModAmp); break; |
Kovalev_D | 220:04c54405b82d | 86 | |
Kovalev_D | 220:04c54405b82d | 87 | //case 4: LPC_DAC->DACR = ((ModArraySin32 [(CountV31)&0x1f]+150)*Gyro.ModAmp); break;ShiftMod |
Kovalev_D | 220:04c54405b82d | 88 | case 4: LPC_DAC->DACR = ((ModArraySin32 [(CountV31+8)&0x1f])*Gyro.ModAmp + Gyro.ShiftMod-32000); break; |
Kovalev_D | 218:b4067cac75c0 | 89 | case 5: break; |
Kovalev_D | 197:7a05523bf588 | 90 | } |
Kovalev_D | 197:7a05523bf588 | 91 | } |
Kovalev_D | 215:b58b887fd367 | 92 | |
Kovalev_D | 209:224e7331a061 | 93 | void PLCRegul250(void) |
Kovalev_D | 209:224e7331a061 | 94 | { |
Kovalev_D | 209:224e7331a061 | 95 | unsigned int temp; |
Kovalev_D | 209:224e7331a061 | 96 | static int CountFaza; |
Kovalev_D | 209:224e7331a061 | 97 | temp = MODCount; |
Kovalev_D | 215:b58b887fd367 | 98 | |
Kovalev_D | 216:189b0ea1dc38 | 99 | /*for (CountFaza = 0; CountFaza <16; CountFaza++) SinPls+= (Buff_Restored_Mod[ (CountFaza - Gyro.PLC_Phase) & 0x3f]); |
Kovalev_D | 215:b58b887fd367 | 100 | for (CountFaza = 16; CountFaza <32; CountFaza++) SinMns-= (Buff_Restored_Mod[ (CountFaza - Gyro.PLC_Phase) & 0x3f]); |
Kovalev_D | 215:b58b887fd367 | 101 | for (CountFaza = 32; CountFaza <48; CountFaza++) SinPls+= (Buff_Restored_Mod[ (CountFaza - Gyro.PLC_Phase) & 0x3f]); |
Kovalev_D | 215:b58b887fd367 | 102 | for (CountFaza = 48; CountFaza <64; CountFaza++) SinMns-= (Buff_Restored_Mod[ (CountFaza - Gyro.PLC_Phase) & 0x3f]);*/ |
Kovalev_D | 215:b58b887fd367 | 103 | |
Kovalev_D | 214:4c70e452c491 | 104 | /* for (CountFaza = 0; CountFaza <32; CountFaza++ ) SinPls+= BuffADC_64Point[ (CountFaza - Gyro.PLC_Phase) & 0x3f]; |
Kovalev_D | 214:4c70e452c491 | 105 | for (CountFaza = 32; CountFaza <64; CountFaza++) SinMns+= BuffADC_64Point[ (CountFaza - Gyro.PLC_Phase) & 0x3f];*/ |
Kovalev_D | 209:224e7331a061 | 106 | Gyro.PLC_Eror = SinMns-SinPls; |
Kovalev_D | 214:4c70e452c491 | 107 | /* sprintf((Time)," %d %d %d %d %d\r\n",Spi.ADC5, Spi.DAC_B, SinPls, SinMns, Gyro.PLC_Eror); |
Kovalev_D | 209:224e7331a061 | 108 | WriteCon(Time);*/ |
Kovalev_D | 209:224e7331a061 | 109 | if(Gyro.RgConA&0x8) |
Kovalev_D | 209:224e7331a061 | 110 | { |
Kovalev_D | 209:224e7331a061 | 111 | if(Gyro.PLC_Eror>0) {Spi.DAC_B+=1 * Gyro.PLC_Gain;} |
Kovalev_D | 209:224e7331a061 | 112 | else {Spi.DAC_B-=1 * Gyro.PLC_Gain;} |
Kovalev_D | 209:224e7331a061 | 113 | } |
Kovalev_D | 215:b58b887fd367 | 114 | /* if(Gyro.PLC_Eror>0) {Gyro.PLC_Eror_count++;} |
Kovalev_D | 215:b58b887fd367 | 115 | else {Gyro.PLC_Eror_count--;}*/ |
Kovalev_D | 209:224e7331a061 | 116 | |
Kovalev_D | 209:224e7331a061 | 117 | if ( Spi.DAC_B < 10300 ) Spi.DAC_B = 32000; //проверка на переваливание за границу. |
Kovalev_D | 209:224e7331a061 | 118 | else if ( Spi.DAC_B > 57000 ) Spi.DAC_B = 32000; |
igor_v | 110:6406b7ac0442 | 119 | |
Kovalev_D | 209:224e7331a061 | 120 | SinPls=0; |
Kovalev_D | 209:224e7331a061 | 121 | SinMns=0; |
Kovalev_D | 209:224e7331a061 | 122 | } |
Kovalev_D | 220:04c54405b82d | 123 | |
Kovalev_D | 220:04c54405b82d | 124 | |
Kovalev_D | 220:04c54405b82d | 125 | |
Kovalev_D | 220:04c54405b82d | 126 | void HFORegul2(void) |
Kovalev_D | 213:9953db9543d6 | 127 | { |
Kovalev_D | 216:189b0ea1dc38 | 128 | static unsigned int countHFO; |
Kovalev_D | 220:04c54405b82d | 129 | |
Kovalev_D | 216:189b0ea1dc38 | 130 | countHFO=0; |
Kovalev_D | 216:189b0ea1dc38 | 131 | if(Gyro.RgConA&0x2) |
Kovalev_D | 216:189b0ea1dc38 | 132 | { |
Kovalev_D | 220:04c54405b82d | 133 | if(HFO_Flag) |
Kovalev_D | 220:04c54405b82d | 134 | { |
Kovalev_D | 220:04c54405b82d | 135 | DeltaRegul+=(Gyro.HFO_ref-(AMPSUM>>8)); |
Kovalev_D | 220:04c54405b82d | 136 | |
Kovalev_D | 220:04c54405b82d | 137 | sprintf((Time),"%d %d %d\r\n", AMPSUM>>8, DeltaRegul, Gyro.HFO_ref); |
Kovalev_D | 220:04c54405b82d | 138 | WriteCon(Time); |
Kovalev_D | 220:04c54405b82d | 139 | HFO_Flag=0; |
Kovalev_D | 220:04c54405b82d | 140 | AMPSUM=0; |
Kovalev_D | 220:04c54405b82d | 141 | } |
Kovalev_D | 218:b4067cac75c0 | 142 | switch(DeltaRegul) { |
Kovalev_D | 218:b4067cac75c0 | 143 | case 1: DeltaRegul=0; break; |
Kovalev_D | 218:b4067cac75c0 | 144 | case -1: DeltaRegul=0; break; |
Kovalev_D | 220:04c54405b82d | 145 | } |
Kovalev_D | 220:04c54405b82d | 146 | Spi.DAC_A-=(DeltaRegul>>2)*Gyro.HFO_Gain; |
Kovalev_D | 220:04c54405b82d | 147 | DeltaRegul=0; |
Kovalev_D | 216:189b0ea1dc38 | 148 | } |
Kovalev_D | 216:189b0ea1dc38 | 149 | else DeltaRegul=0; |
Kovalev_D | 213:9953db9543d6 | 150 | if(Spi.DAC_A>Gyro.HFO_Min-1) Spi.DAC_A=Gyro.HFO_Min-2; |
Kovalev_D | 213:9953db9543d6 | 151 | else if(Spi.DAC_A<Gyro.HFO_Max+1) Spi.DAC_A=Gyro.HFO_Max+2; |
Kovalev_D | 220:04c54405b82d | 152 | |
Kovalev_D | 220:04c54405b82d | 153 | } |
Kovalev_D | 208:19150d2b528f | 154 | |
Kovalev_D | 208:19150d2b528f | 155 | // Spi.DAC_B-=ADCDIF>>6; |
Kovalev_D | 208:19150d2b528f | 156 | |
Kovalev_D | 147:1aed74f19a8f | 157 | void ADS_Acum(void) |
Kovalev_D | 147:1aed74f19a8f | 158 | { |
Kovalev_D | 157:1069c80f4944 | 159 | Spi.ADC_NewData = 0; |
Kovalev_D | 209:224e7331a061 | 160 | // Gyro.Termo = (unsigned int)(((Spi.ADC1>>1) + Gyro.Tmp_OffsetT4) * Gyro.Tmp_scaleT4); |
Kovalev_D | 209:224e7331a061 | 161 | Gyro.Termo = (unsigned int)(Spi.ADC1>>1); |
Kovalev_D | 209:224e7331a061 | 162 | Gyro.IN1_Accum += Spi.ADC2; |
Kovalev_D | 209:224e7331a061 | 163 | Gyro.IN2_Accum += Spi.ADC3; |
Kovalev_D | 209:224e7331a061 | 164 | // Gyro.DeltaT = (unsigned int)(((Spi.ADC4>>1) + Gyro.Tmp_OffsetT5) * Gyro.Tmp_scaleT5); |
Kovalev_D | 221:53b256368ca1 | 165 | switch(Gyro.LG_Type) |
Kovalev_D | 221:53b256368ca1 | 166 | { |
Kovalev_D | 221:53b256368ca1 | 167 | case 1: Gyro.DeltaT = (unsigned int)(Spi.ADC2>>1); break; |
Kovalev_D | 221:53b256368ca1 | 168 | |
Kovalev_D | 221:53b256368ca1 | 169 | case 0: Gyro.DeltaT = (unsigned int)(Spi.ADC4>>1); break; |
Kovalev_D | 221:53b256368ca1 | 170 | } |
Kovalev_D | 221:53b256368ca1 | 171 | |
Kovalev_D | 208:19150d2b528f | 172 | |
Kovalev_D | 172:ef7bf1663645 | 173 | TempA = (0xffff - Spi.ADC5); // перевернем знак и умножим на два (было 32000...0 стало 0 ...32000 /*сдвиг(<<1) стало 0 ...64000*/) |
Kovalev_D | 211:ac8251b067d2 | 174 | Gyro.TermLM = Spi.ADC1; |
Kovalev_D | 157:1069c80f4944 | 175 | Gyro.ADF_Accum += TempA; |
Kovalev_D | 157:1069c80f4944 | 176 | Gyro.ADS_Accum += TempA; |
Kovalev_D | 208:19150d2b528f | 177 | /// Gyro.ADS_AccumTermLM+=TempTermLM; |
Kovalev_D | 157:1069c80f4944 | 178 | Gyro.ADF_Count ++; |
Kovalev_D | 157:1069c80f4944 | 179 | Gyro.ADS_Count ++; |
Kovalev_D | 209:224e7331a061 | 180 | Gyro.ADM_Count ++; |
Kovalev_D | 209:224e7331a061 | 181 | /* sprintf((Time),"%d %d\r\n",((Gyro.In1>>1) - 0x4fff),(Spi.DAC_B-0x4fff)); |
Kovalev_D | 209:224e7331a061 | 182 | WriteCon(Time);*/ |
Kovalev_D | 209:224e7331a061 | 183 | if (Gyro.ADM_Count > 255) { |
Kovalev_D | 209:224e7331a061 | 184 | Gyro.In1 = Gyro.IN1_Accum>>8; |
Kovalev_D | 209:224e7331a061 | 185 | Gyro.In2 = Gyro.IN2_Accum>>8; |
Kovalev_D | 209:224e7331a061 | 186 | Gyro.IN1_Accum=0; |
Kovalev_D | 209:224e7331a061 | 187 | Gyro.IN2_Accum=0; |
Kovalev_D | 209:224e7331a061 | 188 | Gyro.ADM_Count=0; |
Kovalev_D | 147:1aed74f19a8f | 189 | |
Kovalev_D | 209:224e7331a061 | 190 | } |
Kovalev_D | 207:d1ce992f5d17 | 191 | if (Gyro.ADF_Count > 15) { // если прошло 16 тактов виброподвеса |
Kovalev_D | 172:ef7bf1663645 | 192 | Gyro.AD_Fast = Gyro.ADF_Accum << 11; //обновляем данные и приводим в один масштаб |
Kovalev_D | 157:1069c80f4944 | 193 | Gyro.ADF_Count = 0;// |
Kovalev_D | 157:1069c80f4944 | 194 | Gyro.ADF_Accum = 0; |
Kovalev_D | 157:1069c80f4944 | 195 | Gyro.ADF_NewData = 1; |
Kovalev_D | 157:1069c80f4944 | 196 | } |
Kovalev_D | 207:d1ce992f5d17 | 197 | if (Gyro.ADS_Count > 255) { // если прошло 256 тактов виброподвеса |
Kovalev_D | 172:ef7bf1663645 | 198 | Gyro.AD_Slow = Gyro.ADS_Accum << 7; //обновляем данные и приводим в один масштаб |
Kovalev_D | 211:ac8251b067d2 | 199 | // Gyro.TermLM = Gyro.ADS_AccumTermLM << 3; |
Kovalev_D | 157:1069c80f4944 | 200 | Gyro.ADS_Count = 0; |
Kovalev_D | 157:1069c80f4944 | 201 | Gyro.ADS_Accum = 0; |
Kovalev_D | 158:0c8342e1837a | 202 | Gyro.ADS_AccumTermLM=0; |
Kovalev_D | 207:d1ce992f5d17 | 203 | Gyro.ADS_NewData = 1; |
Kovalev_D | 209:224e7331a061 | 204 | } |
Kovalev_D | 147:1aed74f19a8f | 205 | } |
Kovalev_D | 220:04c54405b82d | 206 | void ModFilt(void) |
Kovalev_D | 220:04c54405b82d | 207 | { |
Kovalev_D | 220:04c54405b82d | 208 | static int SumBuff,Delta, OldDelta; |
Kovalev_D | 220:04c54405b82d | 209 | |
Kovalev_D | 220:04c54405b82d | 210 | |
Kovalev_D | 220:04c54405b82d | 211 | |
Kovalev_D | 220:04c54405b82d | 212 | if (count10v>=64*8) |
Kovalev_D | 220:04c54405b82d | 213 | { |
Kovalev_D | 220:04c54405b82d | 214 | count10v=0; |
Kovalev_D | 220:04c54405b82d | 215 | |
Kovalev_D | 220:04c54405b82d | 216 | /* for(int q=0; q<5; q++) |
Kovalev_D | 220:04c54405b82d | 217 | { |
Kovalev_D | 220:04c54405b82d | 218 | AMPSUMP+=BuffADC_10v[q]; |
Kovalev_D | 220:04c54405b82d | 219 | }*/ |
Kovalev_D | 220:04c54405b82d | 220 | |
Kovalev_D | 220:04c54405b82d | 221 | /* for(int q=0; q<32; q++) |
Kovalev_D | 220:04c54405b82d | 222 | { |
Kovalev_D | 220:04c54405b82d | 223 | AMPSUMP += BuffADC_10v[q]; |
Kovalev_D | 220:04c54405b82d | 224 | |
Kovalev_D | 220:04c54405b82d | 225 | } |
Kovalev_D | 220:04c54405b82d | 226 | for(int q=32; q<64; q++) |
Kovalev_D | 220:04c54405b82d | 227 | { |
Kovalev_D | 220:04c54405b82d | 228 | AMPSUMM += BuffADC_10v[q]; |
Kovalev_D | 220:04c54405b82d | 229 | } |
Kovalev_D | 220:04c54405b82d | 230 | */ |
Kovalev_D | 220:04c54405b82d | 231 | ///////////////////////////// |
Kovalev_D | 220:04c54405b82d | 232 | |
Kovalev_D | 220:04c54405b82d | 233 | /* for(int q=32; q<32+5; q++) |
Kovalev_D | 220:04c54405b82d | 234 | { |
Kovalev_D | 220:04c54405b82d | 235 | AMPSUMM+=BuffADC_10v[q]; |
Kovalev_D | 220:04c54405b82d | 236 | }*/ |
Kovalev_D | 220:04c54405b82d | 237 | /* for(int q=32+12; q<32+20; q++) |
Kovalev_D | 220:04c54405b82d | 238 | { |
Kovalev_D | 220:04c54405b82d | 239 | AMPSUMM+=BuffADC_10v[q]; |
Kovalev_D | 220:04c54405b82d | 240 | }*/ |
Kovalev_D | 220:04c54405b82d | 241 | /* for(int q=32+28; q<32+32; q++) |
Kovalev_D | 220:04c54405b82d | 242 | { |
Kovalev_D | 220:04c54405b82d | 243 | AMPSUMM+=BuffADC_10v[q]; |
Kovalev_D | 220:04c54405b82d | 244 | } */ |
Kovalev_D | 220:04c54405b82d | 245 | |
Kovalev_D | 220:04c54405b82d | 246 | |
Kovalev_D | 220:04c54405b82d | 247 | /* sprintf((Time),"%d %d %d %d \r\n", AMPSUM, AMPSUMP, AMPSUMM,AMPSUMP - AMPSUMM); |
Kovalev_D | 220:04c54405b82d | 248 | WriteCon(Time);*/ |
Kovalev_D | 220:04c54405b82d | 249 | |
Kovalev_D | 220:04c54405b82d | 250 | |
Kovalev_D | 220:04c54405b82d | 251 | |
Kovalev_D | 220:04c54405b82d | 252 | for(int q=0; q<32; q++) |
Kovalev_D | 220:04c54405b82d | 253 | { |
Kovalev_D | 220:04c54405b82d | 254 | SumBuff += BuffADC_10v[q]; |
Kovalev_D | 220:04c54405b82d | 255 | SumBuff -= BuffADC_10v_OLD[q+32]; |
Kovalev_D | 220:04c54405b82d | 256 | BuffADC_10v_F [q] = SumBuff; |
Kovalev_D | 220:04c54405b82d | 257 | } |
Kovalev_D | 220:04c54405b82d | 258 | for(int q=32; q<64; q++) |
Kovalev_D | 220:04c54405b82d | 259 | { |
Kovalev_D | 220:04c54405b82d | 260 | SumBuff += BuffADC_10v[q]; |
Kovalev_D | 220:04c54405b82d | 261 | SumBuff -= BuffADC_10v[q-32]; |
Kovalev_D | 220:04c54405b82d | 262 | BuffADC_10v_F [q] = SumBuff; |
Kovalev_D | 220:04c54405b82d | 263 | } |
Kovalev_D | 220:04c54405b82d | 264 | |
Kovalev_D | 220:04c54405b82d | 265 | for(int q=0; q<32; q++) |
Kovalev_D | 220:04c54405b82d | 266 | { |
Kovalev_D | 220:04c54405b82d | 267 | AMPSUMP +=BuffADC_10v_F [q]; |
Kovalev_D | 220:04c54405b82d | 268 | |
Kovalev_D | 220:04c54405b82d | 269 | } |
Kovalev_D | 220:04c54405b82d | 270 | for(int q=32; q<64; q++) |
Kovalev_D | 220:04c54405b82d | 271 | { |
Kovalev_D | 220:04c54405b82d | 272 | AMPSUMM += BuffADC_10v_F [q]; |
Kovalev_D | 220:04c54405b82d | 273 | } |
Kovalev_D | 220:04c54405b82d | 274 | |
Kovalev_D | 220:04c54405b82d | 275 | |
Kovalev_D | 220:04c54405b82d | 276 | |
Kovalev_D | 220:04c54405b82d | 277 | |
Kovalev_D | 220:04c54405b82d | 278 | for(int q=0; q<64; q++) |
Kovalev_D | 220:04c54405b82d | 279 | { |
Kovalev_D | 220:04c54405b82d | 280 | AMPSUM+=BuffADC_10v[q]; |
Kovalev_D | 220:04c54405b82d | 281 | //Buff_OUT[q]=BuffADC_1Point[q]; |
Kovalev_D | 220:04c54405b82d | 282 | Buff_OUT[q]=BuffADC_10v_F [q]; |
Kovalev_D | 220:04c54405b82d | 283 | //Buff_OUT1[q]= |
Kovalev_D | 220:04c54405b82d | 284 | BuffADC_10v_OLD[q]= BuffADC_10v[q]; |
Kovalev_D | 220:04c54405b82d | 285 | BuffADC_10v[q] =0; |
Kovalev_D | 220:04c54405b82d | 286 | } |
Kovalev_D | 220:04c54405b82d | 287 | sprintf((Time),"%d \r\n", Spi.DAC_A); |
Kovalev_D | 220:04c54405b82d | 288 | WriteCon(Time); |
Kovalev_D | 220:04c54405b82d | 289 | |
Kovalev_D | 220:04c54405b82d | 290 | AMPSUMPout=AMPSUMP; |
Kovalev_D | 220:04c54405b82d | 291 | AMPSUMMout=AMPSUMM; |
Kovalev_D | 220:04c54405b82d | 292 | |
Kovalev_D | 220:04c54405b82d | 293 | Delta= (AMPSUMPout - AMPSUMMout); |
Kovalev_D | 220:04c54405b82d | 294 | SumDelta+=Delta; |
Kovalev_D | 220:04c54405b82d | 295 | Gyro.PLC_Eror_count=SumDelta/Gyro.PLC_Gain; |
Kovalev_D | 220:04c54405b82d | 296 | SumDelta-=Gyro.PLC_Gain*Gyro.PLC_Eror_count; |
Kovalev_D | 220:04c54405b82d | 297 | |
Kovalev_D | 220:04c54405b82d | 298 | AMPSUM=AMPSUM>>6; |
Kovalev_D | 220:04c54405b82d | 299 | AMPSUM=AMPSUM>>3; |
Kovalev_D | 220:04c54405b82d | 300 | |
Kovalev_D | 220:04c54405b82d | 301 | AMPSUM_DESP=AMPSUM; |
Kovalev_D | 220:04c54405b82d | 302 | HFOdelta=(int)((Gyro.HFO_ref)-AMPSUM); |
Kovalev_D | 220:04c54405b82d | 303 | PLC_EROR=Gyro.PLC_Eror_count; |
Kovalev_D | 220:04c54405b82d | 304 | |
Kovalev_D | 220:04c54405b82d | 305 | HFOSumDelta+=HFOdelta; |
Kovalev_D | 220:04c54405b82d | 306 | HFOregul=HFOSumDelta/(int)(Gyro.HFO_Gain); |
Kovalev_D | 220:04c54405b82d | 307 | |
Kovalev_D | 220:04c54405b82d | 308 | HFOSumDelta-=Gyro.HFO_Gain*HFOregul; |
Kovalev_D | 220:04c54405b82d | 309 | tempDeltaRegul=HFOregul; |
Kovalev_D | 220:04c54405b82d | 310 | |
Kovalev_D | 220:04c54405b82d | 311 | HFO_Flag=1; |
Kovalev_D | 220:04c54405b82d | 312 | PLC_Flag=1; |
Kovalev_D | 220:04c54405b82d | 313 | AMPSUMM=0; |
Kovalev_D | 220:04c54405b82d | 314 | AMPSUMP=0; |
Kovalev_D | 220:04c54405b82d | 315 | AMPSUM=0; |
Kovalev_D | 220:04c54405b82d | 316 | } |
Kovalev_D | 220:04c54405b82d | 317 | } |
Kovalev_D | 220:04c54405b82d | 318 | |
igor_v | 114:5cc38a53d8a7 | 319 | void SPI_Exchange(void) // новая функция чтения, в нецй не должно быть ничего лишнего |
Kovalev_D | 157:1069c80f4944 | 320 | { |
Kovalev_D | 220:04c54405b82d | 321 | |
Kovalev_D | 157:1069c80f4944 | 322 | unsigned int DummySPI; |
Kovalev_D | 220:04c54405b82d | 323 | |
Kovalev_D | 197:7a05523bf588 | 324 | //unsigned int ADC5Dif; |
Kovalev_D | 197:7a05523bf588 | 325 | ADC5New = LPC_SSP0->DR;// Чтение АЦП |
Kovalev_D | 207:d1ce992f5d17 | 326 | //Spi.ADC5_Accum += LPC_SSP0->DR; |
igor_v | 110:6406b7ac0442 | 327 | Spi.ADC4_Accum += LPC_SSP0->DR; |
igor_v | 110:6406b7ac0442 | 328 | Spi.ADC3_Accum += LPC_SSP0->DR; |
igor_v | 110:6406b7ac0442 | 329 | Spi.ADC2_Accum += LPC_SSP0->DR; |
igor_v | 110:6406b7ac0442 | 330 | Spi.ADC1_Accum += LPC_SSP0->DR; |
Kovalev_D | 207:d1ce992f5d17 | 331 | Spi.ADC5_Accum += ADC5New; |
Kovalev_D | 209:224e7331a061 | 332 | |
Kovalev_D | 207:d1ce992f5d17 | 333 | while (LPC_SSP0->SR & RX_SSP_notEMPT) |
Kovalev_D | 207:d1ce992f5d17 | 334 | { |
Kovalev_D | 170:d099c3025f87 | 335 | DummySPI = LPC_SSP0->DR; //если буфер SPI не пуст.//очистить буфер. |
Kovalev_D | 157:1069c80f4944 | 336 | } |
Kovalev_D | 112:4a96133a1311 | 337 | DAC_OutPut(); |
Kovalev_D | 157:1069c80f4944 | 338 | if (CountV31 == 0) { // просто фильтруем по 32 точкам. |
Kovalev_D | 197:7a05523bf588 | 339 | // выставояем бит, что есть новы данные |
Kovalev_D | 157:1069c80f4944 | 340 | Spi.ADC1 = Spi.ADC1_Accum >> 5; // подгоотавливаем данные (в той эе сетке) те ADC1 0..65535 |
Kovalev_D | 157:1069c80f4944 | 341 | Spi.ADC2 = Spi.ADC2_Accum >> 5; |
Kovalev_D | 157:1069c80f4944 | 342 | Spi.ADC3 = Spi.ADC3_Accum >> 5; |
Kovalev_D | 157:1069c80f4944 | 343 | Spi.ADC4 = Spi.ADC4_Accum >> 5; |
Kovalev_D | 157:1069c80f4944 | 344 | Spi.ADC5 = Spi.ADC5_Accum >> 5; |
Kovalev_D | 157:1069c80f4944 | 345 | Spi.ADC1_Accum = 0; // сбрасывкем аккамулятор |
Kovalev_D | 157:1069c80f4944 | 346 | Spi.ADC2_Accum = 0; |
Kovalev_D | 157:1069c80f4944 | 347 | Spi.ADC3_Accum = 0; |
Kovalev_D | 157:1069c80f4944 | 348 | Spi.ADC4_Accum = 0; |
Kovalev_D | 157:1069c80f4944 | 349 | Spi.ADC5_Accum = 0; |
Kovalev_D | 157:1069c80f4944 | 350 | Spi.ADC_NewData = 1; |
Kovalev_D | 209:224e7331a061 | 351 | |
Kovalev_D | 207:d1ce992f5d17 | 352 | } |
Kovalev_D | 215:b58b887fd367 | 353 | if(Time1Hz>6) |
Kovalev_D | 215:b58b887fd367 | 354 | { |
Kovalev_D | 220:04c54405b82d | 355 | BuffADC_1Point[CountV255] = (0x7fff-ADC5New)&0x7fff; |
Kovalev_D | 218:b4067cac75c0 | 356 | BuffADC_1Point_64[CountV31]=(0x7fff-ADC5New)&0x7fff; |
Kovalev_D | 216:189b0ea1dc38 | 357 | |
Kovalev_D | 220:04c54405b82d | 358 | /* ADC_128Point += BuffADC_1Point[CountV255]; |
Kovalev_D | 220:04c54405b82d | 359 | ADC_128Point -= BuffADC_1Point[(CountV255 - 128) & 0xff]; // заполнение буфера накопленых приращений за 64 тактов |
Kovalev_D | 220:04c54405b82d | 360 | BuffADC_128Point[CountV64] = ADC_128Point;*/ |
Kovalev_D | 220:04c54405b82d | 361 | |
Kovalev_D | 220:04c54405b82d | 362 | |
Kovalev_D | 220:04c54405b82d | 363 | // Buff_Restored_Mod[CountV31] =(int)(BuffADC_1Point_64[CountV31] - ((BuffADC_128Point[CountV64])>>7)); |
Kovalev_D | 220:04c54405b82d | 364 | // Buff_Restored_Mod[CountV64] =(int)(BuffADC_32PointD[CountV64]*2 - BuffADC_64Point[CountV64]); |
Kovalev_D | 220:04c54405b82d | 365 | |
Kovalev_D | 220:04c54405b82d | 366 | |
Kovalev_D | 220:04c54405b82d | 367 | count10v++; |
Kovalev_D | 220:04c54405b82d | 368 | BuffADC_10v[CountV64] += BuffADC_1Point[CountV255]; |
Kovalev_D | 220:04c54405b82d | 369 | |
Kovalev_D | 220:04c54405b82d | 370 | ModFilt(); |
Kovalev_D | 220:04c54405b82d | 371 | |
Kovalev_D | 220:04c54405b82d | 372 | } |
Kovalev_D | 220:04c54405b82d | 373 | |
Kovalev_D | 220:04c54405b82d | 374 | } |
Kovalev_D | 220:04c54405b82d | 375 | |
Kovalev_D | 220:04c54405b82d | 376 | void HFORegul(void) |
Kovalev_D | 220:04c54405b82d | 377 | { |
Kovalev_D | 220:04c54405b82d | 378 | static unsigned int countHFO; |
Kovalev_D | 220:04c54405b82d | 379 | |
Kovalev_D | 220:04c54405b82d | 380 | countHFO=0; |
Kovalev_D | 220:04c54405b82d | 381 | |
Kovalev_D | 220:04c54405b82d | 382 | if(Gyro.RgConA&0x2) |
Kovalev_D | 220:04c54405b82d | 383 | { |
Kovalev_D | 220:04c54405b82d | 384 | if(HFO_Flag) |
Kovalev_D | 220:04c54405b82d | 385 | { |
Kovalev_D | 220:04c54405b82d | 386 | switch(HFOregul){ |
Kovalev_D | 220:04c54405b82d | 387 | |
Kovalev_D | 220:04c54405b82d | 388 | // case 1: HFOregul=0; break; |
Kovalev_D | 220:04c54405b82d | 389 | // case -1: HFOregul=0; break; |
Kovalev_D | 220:04c54405b82d | 390 | // case 2: HFOregul=1; break; |
Kovalev_D | 220:04c54405b82d | 391 | // case -2: HFOregul=1; break; |
Kovalev_D | 220:04c54405b82d | 392 | |
Kovalev_D | 220:04c54405b82d | 393 | |
Kovalev_D | 220:04c54405b82d | 394 | } |
Kovalev_D | 220:04c54405b82d | 395 | Spi.DAC_A -= HFOregul; |
Kovalev_D | 220:04c54405b82d | 396 | HFO_Flag=0; |
Kovalev_D | 220:04c54405b82d | 397 | DeltaRegul=0; |
Kovalev_D | 220:04c54405b82d | 398 | } |
Kovalev_D | 220:04c54405b82d | 399 | } |
Kovalev_D | 220:04c54405b82d | 400 | |
Kovalev_D | 220:04c54405b82d | 401 | else DeltaRegul=0; |
Kovalev_D | 220:04c54405b82d | 402 | |
Kovalev_D | 220:04c54405b82d | 403 | if(Spi.DAC_A>Gyro.HFO_Min-1) Spi.DAC_A=Gyro.HFO_Min-2; |
Kovalev_D | 220:04c54405b82d | 404 | else if(Spi.DAC_A<Gyro.HFO_Max+1) Spi.DAC_A=Gyro.HFO_Max+2; |
Kovalev_D | 220:04c54405b82d | 405 | |
Kovalev_D | 220:04c54405b82d | 406 | } |
Kovalev_D | 220:04c54405b82d | 407 | |
Kovalev_D | 214:4c70e452c491 | 408 | |
Kovalev_D | 220:04c54405b82d | 409 | void PLCRegul(void) |
Kovalev_D | 215:b58b887fd367 | 410 | |
Kovalev_D | 220:04c54405b82d | 411 | { |
Kovalev_D | 220:04c54405b82d | 412 | static unsigned int Flag_64=0, count; |
Kovalev_D | 220:04c54405b82d | 413 | static int CountFaza,Sin; |
Kovalev_D | 216:189b0ea1dc38 | 414 | |
Kovalev_D | 216:189b0ea1dc38 | 415 | |
Kovalev_D | 220:04c54405b82d | 416 | if(Gyro.RgConA&0x8) |
Kovalev_D | 220:04c54405b82d | 417 | { |
Kovalev_D | 220:04c54405b82d | 418 | if(PLC_Flag) |
Kovalev_D | 220:04c54405b82d | 419 | { |
Kovalev_D | 220:04c54405b82d | 420 | PLC_Flag=0; |
Kovalev_D | 220:04c54405b82d | 421 | Spi.DAC_B+=(Gyro.PLC_Eror_count); |
Kovalev_D | 220:04c54405b82d | 422 | |
Kovalev_D | 220:04c54405b82d | 423 | |
Kovalev_D | 220:04c54405b82d | 424 | } |
Kovalev_D | 220:04c54405b82d | 425 | } |
Kovalev_D | 220:04c54405b82d | 426 | Gyro.PLC_Eror_count=0; |
Kovalev_D | 220:04c54405b82d | 427 | if(Gyro.LG_Type==1) |
Kovalev_D | 220:04c54405b82d | 428 | { |
Kovalev_D | 220:04c54405b82d | 429 | if ( Spi.DAC_B < Gyro.HighTreshold ) Spi.DAC_B = (Gyro.ResetLevelHeat); |
Kovalev_D | 220:04c54405b82d | 430 | else if ( Spi.DAC_B > Gyro.DownTreshold ) Spi.DAC_B = (Gyro.ResetLevelCool); |
Kovalev_D | 220:04c54405b82d | 431 | } |
Kovalev_D | 220:04c54405b82d | 432 | else |
Kovalev_D | 220:04c54405b82d | 433 | { |
Kovalev_D | 220:04c54405b82d | 434 | if ( Spi.DAC_B < 10300 ) Spi.DAC_B = 32000; //проверка на переваливание за границу. |
Kovalev_D | 220:04c54405b82d | 435 | else if ( Spi.DAC_B > 57000 ) Spi.DAC_B = 32000; |
Kovalev_D | 220:04c54405b82d | 436 | } |
Kovalev_D | 220:04c54405b82d | 437 | } |
Kovalev_D | 216:189b0ea1dc38 | 438 | |
Kovalev_D | 220:04c54405b82d | 439 | |
Kovalev_D | 220:04c54405b82d | 440 | |
Kovalev_D | 113:8be429494918 | 441 | |
Kovalev_D | 190:289514f730ee | 442 | void ShowMod(void)//технологическая функция для просмотра в ориджине мод на всем диапазпне цап |
Kovalev_D | 158:0c8342e1837a | 443 | { |
Kovalev_D | 158:0c8342e1837a | 444 | |
Kovalev_D | 158:0c8342e1837a | 445 | ////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 158:0c8342e1837a | 446 | //////////////////////////////////смотрим все моды///////////////////////////////////////////////// |
Kovalev_D | 158:0c8342e1837a | 447 | /////////////////////////////////////////////////////////////////////////////////////////////////// |
Kovalev_D | 197:7a05523bf588 | 448 | if(dispersion>5) |
Kovalev_D | 197:7a05523bf588 | 449 | { |
Kovalev_D | 197:7a05523bf588 | 450 | if( (Gyro.PLC_Lern<60000)&&(Gyro.PLC_Error2Mode >1))//пробигаем по нескольким значениям цап(60*0х3с=0хВВ8) для определения максимальной амплитуды. |
Kovalev_D | 158:0c8342e1837a | 451 | { |
Kovalev_D | 158:0c8342e1837a | 452 | Gyro.PLC_Error2Mode--; |
Kovalev_D | 158:0c8342e1837a | 453 | Gyro.PLC_Lern++; |
Kovalev_D | 197:7a05523bf588 | 454 | Spi.DAC_B += tempstrafe*side; |
Kovalev_D | 197:7a05523bf588 | 455 | if(side>0)side=(-1); |
Kovalev_D | 197:7a05523bf588 | 456 | else side = 1; |
Kovalev_D | 197:7a05523bf588 | 457 | tempstrafe-=40; |
Kovalev_D | 197:7a05523bf588 | 458 | dispersion=0; |
Kovalev_D | 168:f4a6abb18358 | 459 | } |
Kovalev_D | 197:7a05523bf588 | 460 | else {Gyro.LogPLC=0;} |
Kovalev_D | 197:7a05523bf588 | 461 | } |
Kovalev_D | 197:7a05523bf588 | 462 | else dispersion++; |
Kovalev_D | 197:7a05523bf588 | 463 | sprintf((Time),"%d %d %d %d \r\n", Gyro.CuruAngle, Spi.DAC_B, Gyro.AD_Slow, Gyro.Termo); |
Kovalev_D | 197:7a05523bf588 | 464 | Gyro.CuruAngle=0; |
Kovalev_D | 197:7a05523bf588 | 465 | WriteCon(Time); |
Kovalev_D | 158:0c8342e1837a | 466 | } |
Kovalev_D | 209:224e7331a061 | 467 | void ShowMod2(void)//технологическая функция для просмотра в ориджине мод на всем диапазпне цап |
Kovalev_D | 209:224e7331a061 | 468 | { |
Kovalev_D | 211:ac8251b067d2 | 469 | if(dispersion>3) |
Kovalev_D | 211:ac8251b067d2 | 470 | { |
Kovalev_D | 213:9953db9543d6 | 471 | unsigned int step = 50, ENDMOD=65400; |
Kovalev_D | 209:224e7331a061 | 472 | sprintf((Time),"%d %d %d %d %d %d %d\r\n", Gyro.CuruAngle, Spi.DAC_B, Gyro.AD_Slow, Spi.ADC5, 0xfFFf-Spi.ADC1, Spi.ADC1, Gyro.Termo); |
Kovalev_D | 209:224e7331a061 | 473 | Gyro.CuruAngle=0; |
Kovalev_D | 209:224e7331a061 | 474 | WriteCon(Time); |
Kovalev_D | 213:9953db9543d6 | 475 | Spi.DAC_B+=step; |
Kovalev_D | 213:9953db9543d6 | 476 | if(Spi.DAC_B>ENDMOD) |
Kovalev_D | 211:ac8251b067d2 | 477 | { |
Kovalev_D | 214:4c70e452c491 | 478 | // Gyro.LogMod=0; |
Kovalev_D | 211:ac8251b067d2 | 479 | PlcON |
Kovalev_D | 213:9953db9543d6 | 480 | Spi.DAC_B = 48000; |
Kovalev_D | 211:ac8251b067d2 | 481 | } |
Kovalev_D | 211:ac8251b067d2 | 482 | dispersion=0; |
Kovalev_D | 209:224e7331a061 | 483 | } |
Kovalev_D | 211:ac8251b067d2 | 484 | else dispersion++; |
Kovalev_D | 191:40028201ddad | 485 | } |
Kovalev_D | 112:4a96133a1311 | 486 | void DAC_OutPut(void)//выдача в цапы |
igor_v | 0:8ad47e2b6f00 | 487 | { |
Kovalev_D | 220:04c54405b82d | 488 | /*if(Gyro.RgConA&0x10)*/ Modulator(); |
Kovalev_D | 157:1069c80f4944 | 489 | LPC_SSP0->DR=0x5555; |
igor_v | 31:c783288001b5 | 490 | LPC_SSP0->DR=0x5555; |
igor_v | 31:c783288001b5 | 491 | LPC_SSP0->DR=0x5555; |
igor_v | 0:8ad47e2b6f00 | 492 | |
Kovalev_D | 209:224e7331a061 | 493 | if (CountV31 & 1) |
Kovalev_D | 209:224e7331a061 | 494 | { //если нечетный такт то |
Kovalev_D | 218:b4067cac75c0 | 495 | LPC_SSP0->DR = WRITE_DAC0; //e.команда для ЦАП_0 передавать. |
Kovalev_D | 220:04c54405b82d | 496 | LPC_SSP0->DR = (Spi.DAC_A); //e. передача 12 бит |
Kovalev_D | 209:224e7331a061 | 497 | } |
Kovalev_D | 209:224e7331a061 | 498 | else |
Kovalev_D | 209:224e7331a061 | 499 | { //если такт четный. |
Kovalev_D | 157:1069c80f4944 | 500 | LPC_SSP0->DR = WRITE_DAC1 ; //e.команда для ЦАП_1 передавать. |
Kovalev_D | 220:04c54405b82d | 501 | LPC_SSP0->DR = (Spi.DAC_B) ; |
igor_v | 31:c783288001b5 | 502 | } |
Kovalev_D | 112:4a96133a1311 | 503 | } |
Kovalev_D | 112:4a96133a1311 | 504 | |
Kovalev_D | 112:4a96133a1311 | 505 | |
Kovalev_D | 113:8be429494918 | 506 | |
Kovalev_D | 113:8be429494918 | 507 | |
Kovalev_D | 113:8be429494918 | 508 | |
Kovalev_D | 113:8be429494918 | 509 |