⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 hardware.h

📁 采用dspic30f2010的变频器核心驱动程序,程序可以实现正转/反转,频率设定,保护等
💻 H
字号:
// This file contins details of the hardware for the project
// PCB : dsPIC30F Motor Control Development PCB 02-01648 REVB

// This is the clock frequency in Hz including any PLL factor
#define CLOCK_FREQ 7378000

// NB Using LAT Registers rather than PORT registers
// to prevent any read/modify/write issues with outputs

// These are the pushbutton pin connections
#define	BUTTON1	PORTBbits.RB0		//S4 on PCB
#define	BUTTON2	PORTBbits.RB1		//S5 on PCB
//#define	BUTTON3	!PORTGbits.RG8		//S6 on PCB
#define	BUTTON4	PORTCbits.RC13		//S7 on PCB
//#define TRIP_BUTTON !PORTEbits.RE8	//S3 on PCB

// These are the LEDs
//#define DIR_LED LATDbits.LATD7		//D5 on PCB
#define LED1 PORTBbits.RB2			//D6 on PCB
#define LED2 PORTBbits.RB3			//D7 on PCB
//#define LED3 PORTBbits.RB2			//D8 on PCB
//#define LED4 PORTBbits.RB3			//D9 on PCB

// This is the control line for the driver IC for the firing signals
// It must be low to activate the signals to the power module.
#define	PWM_OUTPUT_DISABLE LATDbits.LATD11

// Also declare some useful shortcuts
#define DISABLE_FIRING PWM_OUTPUT_DISABLE=1
#define ENABLE_FIRING PWM_OUTPUT_DISABLE=0

// This is the reset line for the hardware faults in the power module.
// It is also used to reset the 12C671 providing the isolated
// feedback of the |Vac| and Vdc signals. Therefore the min high time
// is 4us to allow for the opto and to ensure 12C671 has pulse > 2us.
//#define FAULT_RESET	LATEbits.LATE9

// This the RS485_TXENA (active high line)
//#define RS485_TXENA LATGbits.LATG1

// This the RS485_RXENA (active LOW line)
//#define RS485_RXENA !LATGbits.LATG0

// The following definitions are provided to allow direct
// access to peripheral output pins for development and testing.

// PFC switch firing line
//#define	PFC_FIRE	LATDbits.LATD5

// BRAKE circuit firing line
//#define BRAKE_FIRE	LATDbits.LATD4

//This is the RS485_TX line
//#define RS485_TX LATFbits.LATF5

//This is the RS485_RX line
//#define RS485_RX PORTFbits.RF4

//This is the CAN_TX line
//#define CAN_TX LATFbits.LATF1

//This is the CAN_RX line
//#define CAN_RX PORTFbits.RF0

//This is the RS232_TX line
//#define RS232_TX LATFbits.LATF3

//This is the RS232_RTS line
//#define RS232_RTS LATGbits.LATG2

//This is the RS232_RX line
//#define RS232_RX PORTFbits.RF2

//This is the RS232_CTS line
//#define RS232_CTS PORTGbits.RG3


⌨️ 快捷键说明

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