config_for_gcc.h File Reference

#include "gcc_compiler.h"

Include dependency graph for config_for_gcc.h:

Go to the source code of this file.

Defines

#define ADVANCE   0
#define AMPLITUDE_IN_OPEN_LOOP   600
#define BAUDRATE   38400
#define BOARD_ID   1
#define Clear_PC1()   PORTC &= ~(1<<PORTC1)
#define Clear_PC7()   PORTC &= ~(1<<PORTC7)
#define Clear_PE1()   PORTE &= ~(1<<PORTE1)
#define Clear_PE2()   PORTE &= ~(1<<PORTE2)
#define COMPARATOR0_IT   1
 0: Disable Comparator Interrupt 1: Enable Comparator Interrupt
#define COMPARATOR0_IT_EVENT   0
 Comparator Interrupt on outut => 0: toggle 2: falling edge 3: rising edge.
#define COMPARATOR0_NEGATIVE_INPUT   2
 Comparator negative input selection => 0: vref/6.40 1: vref/3.20 2: vref/2.13 3: vref/1.60 4: ACMPM 5: DAC result.
#define COMPARATOR1_IT   1
 0: Disable Comparator Interrupt 1: Enable Comparator Interrupt
#define COMPARATOR1_IT_EVENT   0
 Comparator Interrupt on outut => 0: toggle 2: falling edge 3: rising edge.
#define COMPARATOR1_NEGATIVE_INPUT   2
 Comparator negative input selection => 0: vref/6.40 1: vref/3.20 2: vref/2.13 3: vref/1.60 4: ACMPM 5: DAC result.
#define COMPARATOR2_IT   1
 0: Disable Comparator Interrupt 1: Enable Comparator Interrupt
#define COMPARATOR2_IT_EVENT   0
 Comparator Interrupt on outut => 0: toggle 2: falling edge 3: rising edge.
#define COMPARATOR2_NEGATIVE_INPUT   2
 Comparator negative input selection => 0: vref/6.40 1: vref/3.20 2: vref/2.13 3: vref/1.60 4: ACMPM 5: DAC result.
#define DEAD_TIME   32
 32 => Dead Time = 0.5 µs at 64MHz
#define FOSC   16000
#define K_SPEED   39500
 K_SPEED = (255 * 60 * 4)/(p * t_timer0 * speed_max(rpm))
with t_timer0 : 48us at 16MHz
with p : the number of pairs of poles
8000 rpm/ 4 pairs/ 16MHz => K_SPEED = 39500
speed(rpm) = measured_speed * (60 * 4) / (K_SPEED * t_timer0 * p)
(The result must be multiplied by 31.65 to get a value in rpm).
#define MAX_AMPLITUDE   ((MAX_PWM / 2) - DEAD_TIME)
#define MAX_PWM   1333
#define MAX_THETA   80
#define PLLOCK   PLOCK
#define REGULATION_MODE   1
#define REV_ID   1
#define Set_PC1()   PORTC |= (1<<PORTC1)
#define Set_PC7()   PORTC |= (1<<PORTC7)
#define Set_PE1()   PORTE |= (1<<PORTE1)
#define Set_PE2()   PORTE |= (1<<PORTE2)
#define SOFT_ID   2
#define Toggle_PC1()   PINC |= (1<<PINC1)
#define Toggle_PC7()   PINC |= (1<<PINC7)
#define Toggle_PE1()   PINE |= (1<<PINE1)
#define Toggle_PE2()   PINE |= (1<<PINE2)
#define uart_putchar   putchar
#define USE_COMP0
#define USE_COMP1
#define USE_COMP2

Enumerations

enum  { RUN = TRUE, STOP = FALSE }
enum  { CCW = TRUE, CW = FALSE }


Define Documentation

#define ADVANCE   0

Definition at line 76 of file config_for_gcc.h.

#define AMPLITUDE_IN_OPEN_LOOP   600

Definition at line 73 of file config_for_gcc.h.

#define BAUDRATE   38400

Definition at line 28 of file config_for_gcc.h.

#define BOARD_ID   1

Definition at line 22 of file config_for_gcc.h.

 
#define Clear_PC1 (  )     PORTC &= ~(1<<PORTC1)

Definition at line 39 of file config_for_gcc.h.

 
#define Clear_PC7 (  )     PORTC &= ~(1<<PORTC7)

Definition at line 35 of file config_for_gcc.h.

 
#define Clear_PE1 (  )     PORTE &= ~(1<<PORTE1)

Definition at line 43 of file config_for_gcc.h.

 
#define Clear_PE2 (  )     PORTE &= ~(1<<PORTE2)

Definition at line 47 of file config_for_gcc.h.

#define COMPARATOR0_IT   1

0: Disable Comparator Interrupt 1: Enable Comparator Interrupt

Definition at line 51 of file config_for_gcc.h.

#define COMPARATOR0_IT_EVENT   0

Comparator Interrupt on outut => 0: toggle 2: falling edge 3: rising edge.

Definition at line 52 of file config_for_gcc.h.

#define COMPARATOR0_NEGATIVE_INPUT   2

Comparator negative input selection => 0: vref/6.40 1: vref/3.20 2: vref/2.13 3: vref/1.60 4: ACMPM 5: DAC result.

Definition at line 53 of file config_for_gcc.h.

#define COMPARATOR1_IT   1

0: Disable Comparator Interrupt 1: Enable Comparator Interrupt

Definition at line 57 of file config_for_gcc.h.

#define COMPARATOR1_IT_EVENT   0

Comparator Interrupt on outut => 0: toggle 2: falling edge 3: rising edge.

Definition at line 58 of file config_for_gcc.h.

#define COMPARATOR1_NEGATIVE_INPUT   2

Comparator negative input selection => 0: vref/6.40 1: vref/3.20 2: vref/2.13 3: vref/1.60 4: ACMPM 5: DAC result.

Definition at line 59 of file config_for_gcc.h.

#define COMPARATOR2_IT   1

0: Disable Comparator Interrupt 1: Enable Comparator Interrupt

Definition at line 63 of file config_for_gcc.h.

#define COMPARATOR2_IT_EVENT   0

Comparator Interrupt on outut => 0: toggle 2: falling edge 3: rising edge.

Definition at line 64 of file config_for_gcc.h.

#define COMPARATOR2_NEGATIVE_INPUT   2

Comparator negative input selection => 0: vref/6.40 1: vref/3.20 2: vref/2.13 3: vref/1.60 4: ACMPM 5: DAC result.

Definition at line 65 of file config_for_gcc.h.

#define DEAD_TIME   32

32 => Dead Time = 0.5 µs at 64MHz

Definition at line 70 of file config_for_gcc.h.

#define FOSC   16000

Definition at line 29 of file config_for_gcc.h.

#define K_SPEED   39500

K_SPEED = (255 * 60 * 4)/(p * t_timer0 * speed_max(rpm))
with t_timer0 : 48us at 16MHz
with p : the number of pairs of poles
8000 rpm/ 4 pairs/ 16MHz => K_SPEED = 39500
speed(rpm) = measured_speed * (60 * 4) / (K_SPEED * t_timer0 * p)
(The result must be multiplied by 31.65 to get a value in rpm).

Definition at line 80 of file config_for_gcc.h.

#define MAX_AMPLITUDE   ((MAX_PWM / 2) - DEAD_TIME)

Definition at line 71 of file config_for_gcc.h.

#define MAX_PWM   1333

Definition at line 68 of file config_for_gcc.h.

#define MAX_THETA   80

Definition at line 78 of file config_for_gcc.h.

#define PLLOCK   PLOCK

Definition at line 100 of file config_for_gcc.h.

#define REGULATION_MODE   1

Definition at line 74 of file config_for_gcc.h.

#define REV_ID   1

Definition at line 24 of file config_for_gcc.h.

 
#define Set_PC1 (  )     PORTC |= (1<<PORTC1)

Definition at line 38 of file config_for_gcc.h.

 
#define Set_PC7 (  )     PORTC |= (1<<PORTC7)

Definition at line 34 of file config_for_gcc.h.

 
#define Set_PE1 (  )     PORTE |= (1<<PORTE1)

Definition at line 42 of file config_for_gcc.h.

 
#define Set_PE2 (  )     PORTE |= (1<<PORTE2)

Definition at line 46 of file config_for_gcc.h.

#define SOFT_ID   2

Definition at line 23 of file config_for_gcc.h.

 
#define Toggle_PC1 (  )     PINC |= (1<<PINC1)

Definition at line 40 of file config_for_gcc.h.

 
#define Toggle_PC7 (  )     PINC |= (1<<PINC7)

Definition at line 36 of file config_for_gcc.h.

 
#define Toggle_PE1 (  )     PINE |= (1<<PINE1)

Definition at line 44 of file config_for_gcc.h.

 
#define Toggle_PE2 (  )     PINE |= (1<<PINE2)

Definition at line 48 of file config_for_gcc.h.

#define uart_putchar   putchar

Definition at line 31 of file config_for_gcc.h.

#define USE_COMP0

Definition at line 50 of file config_for_gcc.h.

#define USE_COMP1

Definition at line 56 of file config_for_gcc.h.

#define USE_COMP2

Definition at line 62 of file config_for_gcc.h.


Enumeration Type Documentation

anonymous enum

Define the two states of the motor

Enumerator:
RUN 
STOP 

Definition at line 92 of file config_for_gcc.h.

00092 {RUN = TRUE, STOP = FALSE};

anonymous enum

Define Direction of rotor : CCW and CW

Enumerator:
CCW 
CW 

Definition at line 97 of file config_for_gcc.h.

00097 {CCW = TRUE, CW = FALSE};


Generated on Tue Sep 16 18:11:21 2008 for Atmel BLDC Sinusoidal on ATAVRMC100 by  doxygen 1.5.3