Freescale Semiconductor M68HC08 Stereo System User Manual


 
Definitions of Constants and Variables
Dimmable Light Ballast with Power Factor Correction, Rev. 1
Freescale Semiconductor 55
...represents the integral gain of the PI PFC stage regulator in run mode.
44. #define PI_SCALE 0
...represents the scaling factor of the PI PFC stage regulator (2^scale).
45. #define PI_MIN_VAL 0
...represents the minimum value of the PI PFC stage regulator output.
46. #define PI_MAX_VAL 255
...represents the maximum value of the PI PFC stage regulator output.
47. #define PI_KP_RUNI 2
...represents the proportional gain of the PI ballast stage regulator in run mode.
48. #define PI_KI_RUNI 1
...represents the integral gain of the PI ballast stage regulator in run mode.
49. #define PI_SCALEI 0
...represents the scaling factor of the PI ballast stage regulator (2^scale).
5.6.2 System Constants and Variables
This section describes the external global variables and constants used in the program.
1. extern tSW_FLAGS SW_FLAGS;
This variable represents auxiliary program control flags and is defined as:
typedef union uSW_FLAGS
{tU08byte;
struct
{
tU08 pi_en 1;// - bit enables or disables PI PFC stage regulator calculation
tU08 trim_comp_en :1;// - bit enables or disables trimmable value of internal
oscillator calculation
tU08 f_1_ms: 1;// - bit represents if 1 ms time interval has gone
tU08 pi_eni :1;// - bit enables or disables PI ballast stage regulator calculation
tU08: 4;// - the others five bits are not used
}bit;
}tSW_FLAGS;
2. extern tU08 pwm_sin_tab_pointer;
This variable acts as a pointer to a value in table bSinTab[].
3. extern tU08 m_avg_Dim[8];
This buffer saves the last eight AD conversion values of the required dimming value, for moving
average calculations.
4. extern tU08 p_m_avg_Dim;
This variable acts as a pointer to a value in the m_avg_Dim[8] array.
5. extern tU16 m_avg_sum_Dim;
This variable represents the sum of all values in the m_avg_Dim[8] array.
6. extern tU08 act_Uc;
This variable represents the actual value of the DC-bus voltage.
7. extern tU08 time1ms;
This variable counts PWM interrupts. The variable is incremented at every PWM interrupt. It is used