config.h File Reference

#include "lib_mcu/compiler.h"
#include "lib_mcu/mcu.h"
#include "inavr.h"

Include dependency graph for config.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<<PC1)
#define Clear_PC7()   PORTC &= ~(1<<PC7)
#define Clear_PE1()   PORTE &= ~(1<<PE1)
#define Clear_PE2()   PORTE &= ~(1<<PE2)
#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 REGULATION_MODE   1
#define REV_ID   1
#define Set_PC1()   PORTC |= (1<<PC1)
#define Set_PC7()   PORTC |= (1<<PC7)
#define Set_PE1()   PORTE |= (1<<PE1)
#define Set_PE2()   PORTE |= (1<<PE2)
#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 77 of file config.h.

#define AMPLITUDE_IN_OPEN_LOOP   600

Definition at line 74 of file config.h.

#define BAUDRATE   38400

Definition at line 29 of file config.h.

Referenced by uart_init().

#define BOARD_ID   1

Definition at line 23 of file config.h.

Referenced by ushell_task().

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

Definition at line 40 of file config.h.

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

Definition at line 36 of file config.h.

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

Definition at line 44 of file config.h.

Referenced by main().

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

Definition at line 48 of file config.h.

#define COMPARATOR0_IT   1

0: Disable Comparator Interrupt 1: Enable Comparator Interrupt

Definition at line 52 of file config.h.

#define COMPARATOR0_IT_EVENT   0

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

Definition at line 53 of file config.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 54 of file config.h.

#define COMPARATOR1_IT   1

0: Disable Comparator Interrupt 1: Enable Comparator Interrupt

Definition at line 58 of file config.h.

#define COMPARATOR1_IT_EVENT   0

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

Definition at line 59 of file config.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 60 of file config.h.

#define COMPARATOR2_IT   1

0: Disable Comparator Interrupt 1: Enable Comparator Interrupt

Definition at line 64 of file config.h.

#define COMPARATOR2_IT_EVENT   0

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

Definition at line 65 of file config.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 66 of file config.h.

#define DEAD_TIME   32

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

Definition at line 71 of file config.h.

#define FOSC   16000

Definition at line 30 of file config.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 81 of file config.h.

Referenced by main().

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

Definition at line 72 of file config.h.

Referenced by mc_control_speed_16b().

#define MAX_PWM   1333

Definition at line 69 of file config.h.

Referenced by main().

#define MAX_THETA   80

Definition at line 79 of file config.h.

#define REGULATION_MODE   1

Definition at line 75 of file config.h.

#define REV_ID   1

Definition at line 25 of file config.h.

Referenced by ushell_task().

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

Definition at line 39 of file config.h.

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

Definition at line 35 of file config.h.

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

Definition at line 43 of file config.h.

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

Definition at line 47 of file config.h.

#define SOFT_ID   2

Definition at line 24 of file config.h.

Referenced by ushell_task().

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

Definition at line 41 of file config.h.

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

Definition at line 37 of file config.h.

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

Definition at line 45 of file config.h.

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

Definition at line 49 of file config.h.

#define uart_putchar   putchar

Definition at line 32 of file config.h.

Referenced by ushell_task_init().

#define USE_COMP0

Definition at line 51 of file config.h.

#define USE_COMP1

Definition at line 57 of file config.h.

#define USE_COMP2

Definition at line 63 of file config.h.


Enumeration Type Documentation

anonymous enum

Define the two states of the motor

Enumerator:
RUN 
STOP 

Definition at line 93 of file config.h.

00093 {RUN = TRUE, STOP = FALSE};

anonymous enum

Define Direction of rotor : CCW and CW

Enumerator:
CCW 
CW 

Definition at line 98 of file config.h.

00098 {CCW = TRUE, CW = FALSE};


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