main.h

来自「非常实用的AD和pwm的ad公司21990dsp芯片的控制源代码」· C头文件 代码 · 共 63 行

H
63
字号
/*********************************************************************************************
*											    *
* Application: PWM three-phase sinewave generator		    *
*											    *
* File: Main.h										    *
*											    *
* Description: system include file							    *
* Purpose    : define system parameters, include all necessary library routines		    *
* 											    *
* Author     : JC									    *
* Version    : 1.0	
* Date		 : Feb, 2002
* Modification History:    none								    *
*											    *
* Embedded Control Systems								    *
* Analog Devices Inc.									    *
*********************************************************************************************/

#ifndef MAIN_INCLUDED
#define MAIN_INCLUDED

/**********************************************************************************************
* General System Parameters and Constants						     *
**********************************************************************************************/

#define  Cry_clock         			24576 	// Crystal clock frequency [kHz]
#define  PLL_clock_multiplier       1 		// Multiplier for core clock
#define  H_clock_ratio		        2 		// core/H clock ratio

#define  Core_clock  				Cry_clock * PLL_clock_multiplier// do not change
#define  H_clock  				    Core_clock / H_clock_ratio// do not change

#include <adsp-21990.h>;
#include <macro.h>;

/**********************************************************************************************
*	Library :PWM block																		*
*	File: pwm.dsp																		*
*	Application Note: Usage of the ADMC501 Pulse Width Modulation Block						*/

#define  PWM_freq          20000	//Desired PWM switching frequency [Hz]       
#define  Deadtime          2000		//Desired Deadtime [nsec]        
#define  PWM_syncpulse		440		//Desired PWMSYNC pulse time [nsec]	
 
/**********************************************************************************************/

/**********************************************************************************************
*	Library :Trigonometric functions															*
*	File: trigono.dsp																		*
																				
//None
**********************************************************************************************/

/**********************************************************************************************
*	Library :ADC block															*
*	File: adc.dsp																		*/
#define ADC_Number_of_samples		30  //using the first 30 samples from the ADC to calculate the offset
																			

/**********************************************************************************************/

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?