Subversion Repositories BL-Ctrl

Compare Revisions

Ignore whitespace Rev 39 → Rev 40

/branches/v0.31_8kHz_PWM/main.c
50,8 → 50,14
Strom--;
}
else
{
OCR1A = tmp_pwm; OCR1B = tmp_pwm; OCR2 = tmp_pwm;
{
#ifdef _32KHZ
OCR1A = tmp_pwm; OCR1B = tmp_pwm; OCR2 = tmp_pwm;
#endif
 
#ifdef _16KHZ
OCR1A = 2 * (int)tmp_pwm; OCR1B = 2 * (int)tmp_pwm; OCR2 = tmp_pwm;
#endif
}
}
 
61,16 → 67,8
//############################################################################
{
PWM_OFF;
 
#ifdef _16KHZ
TCCR1B = (1 << CS10) | (0 << CS11) | (0 << CS12) | (0 << WGM12) |
TCCR1B = (1 << CS10) | (0 << CS11) | (0 << CS12) | (1 << WGM12) |
(0 << WGM13) | (0<< ICES1) | (0 << ICNC1);
#endif
 
#ifdef _32KHZ
TCCR1B = (1 << CS10) | (0 << CS11) | (0 << CS12) | (1 << WGM12) |
(0 << WGM13) | (0<< ICES1) | (0 << ICNC1);
#endif
}
 
//############################################################################
249,7 → 247,7
MotorAnwerfen = 0; // kein Startversuch
ZeitFuerBerechnungen = 0;
// nach 1,5 Sekunden den Motor als gestoppt betrachten
if(CheckDelay(MotorGestopptTimer))
if(CheckDelay(DrehzahlMessTimer))
{
DISABLE_SENSE_INT;
MotorGestoppt = 1;
340,7 → 338,7
while(!CheckDelay(MinUpmPulse)); // kurz Synchronisieren
PWM = 10;
SetPWM();
DrehzahlMessTimer = SetDelay(200);
MinUpmPulse = SetDelay(200);
while(!CheckDelay(MinUpmPulse)); // kurz Durchstarten
MinUpmPulse = SetDelay(1000);
altPhase = 7;