Subversion Repositories BL-Ctrl

Rev

Rev 1 | Rev 51 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1 Rev 50
Line 9... Line 9...
9
extern volatile unsigned char CompInterruptFreigabe;
9
extern volatile unsigned char CompInterruptFreigabe;
Line 10... Line 10...
10
 
10
 
11
void Blc(void);
11
void Blc(void);
Line -... Line 12...
-
 
12
void Manuell(void);
-
 
13
 
-
 
14
// anselm
-
 
15
/*
-
 
16
#define COM1A           ((0 << COM1A0) | (1 << COM1A1))         // COM1A-> OC1A non inverting mode
-
 
17
#define COM1B           ((0 << COM1B0) | (1 << COM1B1))         // COM1B-> OC1B non inverting mode
-
 
18
#define COM2            ((0 << COM20) | (1 << COM21))           // COM2-> OC2 non inverting mode
-
 
19
 
-
 
20
#ifdef  _32KHZ
-
 
21
 #define WGM1           ((1 << WGM10) | (0 << WGM11))                           // WGM10:13-> fast PWM 8bit
-
 
22
 #define WGMCS2         ((1 << WGM20) | (1 << WGM21) | (1 << CS20))     // WGM20:21-> fast PWM, no prescale
-
 
23
#endif
-
 
24
 
-
 
25
#ifdef  _16KHZ
-
 
26
 #define WGM1           ((1 << WGM10) | (0 << WGM11))                           // WGM10:13-> phase corr, PWM 8bit
-
 
27
 #define WGMCS2         ((1 << WGM20) | (0 << WGM21) | (1 << CS20))     // WGM20:21-> phase corr. PWM, no prescale
-
 
28
#endif
-
 
29
 
-
 
30
#define PWM_C_ON  {TCCR1A = COM1A | WGM1 | COM1B; TCCR2  = WGMCS2;
-
 
31
                                   DDRB = 0x02;}                                                // Steuer_C+ output
-
 
32
#define PWM_B_ON  {TCCR1A = COM1B | WGM1 | COM1A; TCCR2  = WGMCS2; \
-
 
33
                                   DDRB = 0x04;}                                                // Steuer_B+ output
-
 
34
#define PWM_A_ON  {TCCR1A = WGM1; TCCR2  = COM2 | WGMCS2; \
-
 
35
                                   DDRB = 0x08;}                                                // Steuer_A+ output
-
 
36
#define PWM_OFF   {TCCR1A = WGM1; \
-
 
37
                                   TCCR2  = WGMCS2; \
-
 
38
                                   PORTB &= ~0x0E; DDRB = 0x0E;}                // OC1x & OC2 disconnected, Steuer_X+ output low
-
 
39
// anselm
12
void Manuell(void);
40
*/
13
 
41
 
14
#ifdef  _32KHZ 
42
#ifdef  _32KHZ 
15
 #define PWM_C_ON  {TCCR1A = 0xAD; TCCR2  = 0x49;DDRB = 0x0A;} 
43
 #define PWM_C_ON  {TCCR1A = 0xAD; TCCR2  = 0x49;DDRB = 0x0A;} 
16
 #define PWM_B_ON  {TCCR1A = 0xAD; TCCR2  = 0x49;DDRB = 0x0C;}
44
 #define PWM_B_ON  {TCCR1A = 0xAD; TCCR2  = 0x49;DDRB = 0x0C;}
17
 #define PWM_A_ON  {TCCR1A = 0xAD; TCCR2  = 0x69;DDRB = 0x08;}
45
 #define PWM_A_ON  {TCCR1A = 0xAD; TCCR2  = 0x69;DDRB = 0x08;}
Line 18... Line 46...
18
 #define PWM_OFF   {TCCR1A = 0x0D; TCCR2  = 0x49;PORTC &= ~0x0E;}
46
 #define PWM_OFF   {TCCR1A = 0x0D; TCCR2  = 0x49;PORTC &= ~0x0E;}
19
#endif 
47
#endif 
20
 
48
 
21
#ifdef  _16KHZ 
49
#ifdef  _16KHZ 
-
 
50
// #define PWM_C_ON  {TCCR1A = 0xA2; TCCR2  = 0x41; DDRB = 0x0A;} 
22
 #define PWM_C_ON  {TCCR1A = 0xA2; TCCR2  = 0x41; DDRB = 0x0A;} 
51
// #define PWM_B_ON  {TCCR1A = 0xA2; TCCR2  = 0x41; DDRB = 0x0C;}
23
 #define PWM_B_ON  {TCCR1A = 0xA2; TCCR2  = 0x41; DDRB = 0x0C;}
-
 
-
 
52
// #define PWM_A_ON  {TCCR1A = 0xA2; TCCR2  = 0x61; DDRB = 0x08;}
-
 
53
 
Line -... Line 54...
-
 
54
 #define PWM_C_ON  {TCCR2  = 0x41; if(PPM_Betrieb) { TCCR1A = 0xA1;DDRB = 0x0A;} else { TCCR1A = 0x81; DDRB = 0x0E;}} 
-
 
55
 #define PWM_B_ON  {TCCR2  = 0x41; if(PPM_Betrieb) { TCCR1A = 0xA1;DDRB = 0x0C;} else { TCCR1A = 0x21; DDRB = 0x0E;}} 
-
 
56
 #define PWM_A_ON  {TCCR2  = 0x61; if(PPM_Betrieb) { TCCR1A = 0xA1;DDRB = 0x08;} else { TCCR1A = 0x01; DDRB = 0x0E;}} 
-
 
57
 
-
 
58
// #define PWM_C_ON  {TCCR1A = 0x82; TCCR2  = 0x41; PORTB &= ~0x04; DDRB = 0x0E;} 
-
 
59
// #define PWM_B_ON  {TCCR1A = 0x22; TCCR2  = 0x41; PORTB &= ~0x02; DDRB = 0x0E;}
-
 
60
// #define PWM_A_ON  {TCCR1A = 0x02; TCCR2  = 0x61; PORTB &= ~0x06; DDRB = 0x0E;}
Line 24... Line 61...
24
 #define PWM_A_ON  {TCCR1A = 0xA2; TCCR2  = 0x61; DDRB = 0x08;}
61
 
25
 #define PWM_OFF   {TCCR1A = 0x02; TCCR2  = 0x41;PORTC &= ~0x0E;}
62
 
26
#endif 
63
 #define PWM_OFF   {TCCR1A = 0x01; TCCR2  = 0x41; DDRB = 0x0E; PORTB &= ~0x0E;}
Line 27... Line 64...
27
 
64
#endif 
28
 
65
 
29
#define  STEUER_A_H {PWM_A_ON}
66
#define  STEUER_A_H {PWM_A_ON}
30
#define  STEUER_B_H {PWM_B_ON}
67
#define  STEUER_B_H {PWM_B_ON}
Line 31... Line 68...
31
#define  STEUER_C_H {PWM_C_ON}
68
#define  STEUER_C_H {PWM_C_ON}
32
 
69
 
33
#define  STEUER_A_L {PORTD &= ~0x30; PORTD |= 0x08;}
70
#define  STEUER_A_L {PORTD &= ~0x30; PORTD |= 0x08;}