figuration (9600); _SelectOutputTrigger (TIM2, TIM_TRGOSource_Update); _Dac_Configuration (3000); _Configuration (); _Stream1_Chanel4_Configuration (); _Configuration (); _Stream6_Chanel7_Configuration (); _Chanel2_Configuration ();
while (1) {}}
void DMA1_Stream1_IRQHandler ( void )
{
if (DMA_GetITStatus (DMA1_Stream1, DMA_IT_TCIF1)!= RESET )
{ switch (recived_data [0])
{
case («1»):
{
switch (recived_data [1])
{ case («1»):
{_RegularChannelConfig (ADC1, ADC_Channel_0, 1, ADC_SampleTime_3Cycles);// Total conv. time=3 +8=11cycle at 36MHz (ADC freq.)=0.305 uS
break ;// 3278688 Hz
}
Малюнок ПБ.1 - Продовження
case («2»):
{_RegularChannelConfig (ADC1, ADC_Channel_0, 1, ADC_SampleTime_15Cycles);// Total conv. time=15 +8=23cycle at 36MHz (ADC freq.)=0.638 uS
break
}
case («3»):
{_RegularChannelConfig (ADC1, ADC_Channel_0, 1, ADC_SampleTime_28Cycles);// Total conv. time=28 +8=36cycle at 36MHz (ADC freq.)=1 uS
break
}
case («4»):
{_RegularChannelConfig (ADC1, ADC_Channel_0, 1, ADC_SampleTime_56Cycles);// Total conv. time=56 +8=64cycle at 36MHz (ADC freq.)=1.7 uS
break
}
case («5»):
{_RegularChannelConfig (ADC1, ADC_Channel_0, 1, ADC_SampleTime_84Cycles);// Total conv. time=84 +8=92cycle at 36MHz (ADC freq.)=2.5 uS
break
}
case («6»):
{_RegularChannelConfig (ADC1, ADC_Channel_0, 1, ADC_SampleTime_112Cycles);// Total conv. time=112 +8=120cycle at 36MHz (ADC freq.)=3.33 uS
break
}
case («7»):
{_RegularChannelConfig (ADC1, ADC_Channel_0, 1, ADC_SampleTime_144Cycles);// Total conv. time=144 +8=152cycle at 36MHz (ADC freq.)=4.2 uS
break
}
case («8»):
{_RegularChannelConfig (ADC1, ADC_Channel_0, 1, ADC_SampleTime_480Cycles);// Total conv. time=480 +8=488cycle at 36MHz (ADC freq.)=13.5 uS
break ;// 74074 Hz
}
}
}
break
case («2»): / / підстроювання з верхнього рівня періоду таймера генератора
{
switch (recived_data [1])
{
case («1»):