stepper drivers pins
This commit is contained in:
parent
81e4ef67d0
commit
f8d181747a
@ -57,6 +57,14 @@ void Error_Handler(void);
|
|||||||
/* USER CODE END EFP */
|
/* USER CODE END EFP */
|
||||||
|
|
||||||
/* Private defines -----------------------------------------------------------*/
|
/* Private defines -----------------------------------------------------------*/
|
||||||
|
#define E_STEPPER_DIR_Pin GPIO_PIN_2
|
||||||
|
#define E_STEPPER_DIR_GPIO_Port GPIOE
|
||||||
|
#define E_STEPPER_STEP_Pin GPIO_PIN_3
|
||||||
|
#define E_STEPPER_STEP_GPIO_Port GPIOE
|
||||||
|
#define E_STEPPER_EN_Pin GPIO_PIN_4
|
||||||
|
#define E_STEPPER_EN_GPIO_Port GPIOE
|
||||||
|
#define LED_Pin GPIO_PIN_2
|
||||||
|
#define LED_GPIO_Port GPIOC
|
||||||
#define LCD_RST_Pin GPIO_PIN_4
|
#define LCD_RST_Pin GPIO_PIN_4
|
||||||
#define LCD_RST_GPIO_Port GPIOC
|
#define LCD_RST_GPIO_Port GPIOC
|
||||||
#define ADS7843_CS_Pin GPIO_PIN_12
|
#define ADS7843_CS_Pin GPIO_PIN_12
|
||||||
@ -71,6 +79,22 @@ void Error_Handler(void);
|
|||||||
#define LCD_CS_GPIO_Port GPIOD
|
#define LCD_CS_GPIO_Port GPIOD
|
||||||
#define ADS7843_Int_Pin GPIO_PIN_6
|
#define ADS7843_Int_Pin GPIO_PIN_6
|
||||||
#define ADS7843_Int_GPIO_Port GPIOC
|
#define ADS7843_Int_GPIO_Port GPIOC
|
||||||
|
#define X_STEPPER_DIR_Pin GPIO_PIN_3
|
||||||
|
#define X_STEPPER_DIR_GPIO_Port GPIOB
|
||||||
|
#define X_STEPPER_STEP_Pin GPIO_PIN_4
|
||||||
|
#define X_STEPPER_STEP_GPIO_Port GPIOB
|
||||||
|
#define X_STEPPER_EN_Pin GPIO_PIN_5
|
||||||
|
#define X_STEPPER_EN_GPIO_Port GPIOB
|
||||||
|
#define Y_STEPPER_STEP_Pin GPIO_PIN_7
|
||||||
|
#define Y_STEPPER_STEP_GPIO_Port GPIOB
|
||||||
|
#define Y_STEPPER_EN_Pin GPIO_PIN_8
|
||||||
|
#define Y_STEPPER_EN_GPIO_Port GPIOB
|
||||||
|
#define Z_STEPPER_DIR_Pin GPIO_PIN_9
|
||||||
|
#define Z_STEPPER_DIR_GPIO_Port GPIOB
|
||||||
|
#define Z_STEPPER_STEP_Pin GPIO_PIN_0
|
||||||
|
#define Z_STEPPER_STEP_GPIO_Port GPIOE
|
||||||
|
#define Z_STEPPER_EN_Pin GPIO_PIN_1
|
||||||
|
#define Z_STEPPER_EN_GPIO_Port GPIOE
|
||||||
|
|
||||||
/* USER CODE BEGIN Private defines */
|
/* USER CODE BEGIN Private defines */
|
||||||
#define PSE_UNITS_NUM 4
|
#define PSE_UNITS_NUM 4
|
||||||
|
@ -156,6 +156,7 @@ int main(void)
|
|||||||
MX_FSMC_Init();
|
MX_FSMC_Init();
|
||||||
MX_USART1_UART_Init();
|
MX_USART1_UART_Init();
|
||||||
/* USER CODE BEGIN 2 */
|
/* USER CODE BEGIN 2 */
|
||||||
|
|
||||||
// Reset the LCD to start clean
|
// Reset the LCD to start clean
|
||||||
HAL_GPIO_WritePin(LCD_RST_GPIO_Port, LCD_RST_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(LCD_RST_GPIO_Port, LCD_RST_Pin, GPIO_PIN_RESET);
|
||||||
HAL_Delay(5);
|
HAL_Delay(5);
|
||||||
@ -222,7 +223,7 @@ int main(void)
|
|||||||
// Run LVGL update loop
|
// Run LVGL update loop
|
||||||
lv_timer_handler();
|
lv_timer_handler();
|
||||||
HAL_Delay(5);
|
HAL_Delay(5);
|
||||||
/* USER CODE END WHILE */
|
/* USER CODE END WHILE */
|
||||||
|
|
||||||
/* USER CODE BEGIN 3 */
|
/* USER CODE BEGIN 3 */
|
||||||
}
|
}
|
||||||
@ -312,30 +313,47 @@ static void MX_GPIO_Init(void)
|
|||||||
/* USER CODE END MX_GPIO_Init_1 */
|
/* USER CODE END MX_GPIO_Init_1 */
|
||||||
|
|
||||||
/* GPIO Ports Clock Enable */
|
/* GPIO Ports Clock Enable */
|
||||||
__HAL_RCC_GPIOC_CLK_ENABLE();
|
|
||||||
__HAL_RCC_GPIOE_CLK_ENABLE();
|
__HAL_RCC_GPIOE_CLK_ENABLE();
|
||||||
|
__HAL_RCC_GPIOC_CLK_ENABLE();
|
||||||
__HAL_RCC_GPIOB_CLK_ENABLE();
|
__HAL_RCC_GPIOB_CLK_ENABLE();
|
||||||
__HAL_RCC_GPIOD_CLK_ENABLE();
|
__HAL_RCC_GPIOD_CLK_ENABLE();
|
||||||
__HAL_RCC_GPIOA_CLK_ENABLE();
|
__HAL_RCC_GPIOA_CLK_ENABLE();
|
||||||
|
|
||||||
|
/*Configure GPIO pin Output Level */
|
||||||
|
HAL_GPIO_WritePin(GPIOE, E_STEPPER_DIR_Pin|E_STEPPER_STEP_Pin|E_STEPPER_EN_Pin|Z_STEPPER_STEP_Pin
|
||||||
|
|Z_STEPPER_EN_Pin, GPIO_PIN_RESET);
|
||||||
|
|
||||||
|
/*Configure GPIO pin Output Level */
|
||||||
|
HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);
|
||||||
|
|
||||||
/*Configure GPIO pin Output Level */
|
/*Configure GPIO pin Output Level */
|
||||||
HAL_GPIO_WritePin(LCD_RST_GPIO_Port, LCD_RST_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(LCD_RST_GPIO_Port, LCD_RST_Pin, GPIO_PIN_SET);
|
||||||
|
|
||||||
/*Configure GPIO pin Output Level */
|
/*Configure GPIO pin Output Level */
|
||||||
HAL_GPIO_WritePin(ADS7843_CS_GPIO_Port, ADS7843_CS_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(GPIOB, ADS7843_CS_Pin|X_STEPPER_DIR_Pin|Z_STEPPER_DIR_Pin, GPIO_PIN_SET);
|
||||||
|
|
||||||
/*Configure GPIO pin Output Level */
|
/*Configure GPIO pin Output Level */
|
||||||
HAL_GPIO_WritePin(GPIOB, ADS7843_SCK_Pin|ADS7843_MOSI_Pin, GPIO_PIN_RESET);
|
HAL_GPIO_WritePin(GPIOB, ADS7843_SCK_Pin|ADS7843_MOSI_Pin|X_STEPPER_STEP_Pin|X_STEPPER_EN_Pin
|
||||||
|
|Y_STEPPER_STEP_Pin|Y_STEPPER_EN_Pin, GPIO_PIN_RESET);
|
||||||
|
|
||||||
/*Configure GPIO pin Output Level */
|
/*Configure GPIO pin Output Level */
|
||||||
HAL_GPIO_WritePin(LCD_CS_GPIO_Port, LCD_CS_Pin, GPIO_PIN_SET);
|
HAL_GPIO_WritePin(LCD_CS_GPIO_Port, LCD_CS_Pin, GPIO_PIN_SET);
|
||||||
|
|
||||||
/*Configure GPIO pin : LCD_RST_Pin */
|
/*Configure GPIO pins : E_STEPPER_DIR_Pin E_STEPPER_STEP_Pin E_STEPPER_EN_Pin Z_STEPPER_STEP_Pin
|
||||||
GPIO_InitStruct.Pin = LCD_RST_Pin;
|
Z_STEPPER_EN_Pin */
|
||||||
|
GPIO_InitStruct.Pin = E_STEPPER_DIR_Pin|E_STEPPER_STEP_Pin|E_STEPPER_EN_Pin|Z_STEPPER_STEP_Pin
|
||||||
|
|Z_STEPPER_EN_Pin;
|
||||||
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||||
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
HAL_GPIO_Init(LCD_RST_GPIO_Port, &GPIO_InitStruct);
|
HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/*Configure GPIO pins : LED_Pin LCD_RST_Pin */
|
||||||
|
GPIO_InitStruct.Pin = LED_Pin|LCD_RST_Pin;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
|
HAL_GPIO_Init(GPIOC, &GPIO_InitStruct);
|
||||||
|
|
||||||
/*Configure GPIO pins : ADS7843_CS_Pin ADS7843_SCK_Pin ADS7843_MOSI_Pin */
|
/*Configure GPIO pins : ADS7843_CS_Pin ADS7843_SCK_Pin ADS7843_MOSI_Pin */
|
||||||
GPIO_InitStruct.Pin = ADS7843_CS_Pin|ADS7843_SCK_Pin|ADS7843_MOSI_Pin;
|
GPIO_InitStruct.Pin = ADS7843_CS_Pin|ADS7843_SCK_Pin|ADS7843_MOSI_Pin;
|
||||||
@ -363,6 +381,15 @@ static void MX_GPIO_Init(void)
|
|||||||
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
GPIO_InitStruct.Pull = GPIO_PULLUP;
|
||||||
HAL_GPIO_Init(ADS7843_Int_GPIO_Port, &GPIO_InitStruct);
|
HAL_GPIO_Init(ADS7843_Int_GPIO_Port, &GPIO_InitStruct);
|
||||||
|
|
||||||
|
/*Configure GPIO pins : X_STEPPER_DIR_Pin X_STEPPER_STEP_Pin X_STEPPER_EN_Pin Y_STEPPER_STEP_Pin
|
||||||
|
Y_STEPPER_EN_Pin Z_STEPPER_DIR_Pin */
|
||||||
|
GPIO_InitStruct.Pin = X_STEPPER_DIR_Pin|X_STEPPER_STEP_Pin|X_STEPPER_EN_Pin|Y_STEPPER_STEP_Pin
|
||||||
|
|Y_STEPPER_EN_Pin|Z_STEPPER_DIR_Pin;
|
||||||
|
GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
|
||||||
|
GPIO_InitStruct.Pull = GPIO_NOPULL;
|
||||||
|
GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
|
||||||
|
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
|
||||||
|
|
||||||
/* USER CODE BEGIN MX_GPIO_Init_2 */
|
/* USER CODE BEGIN MX_GPIO_Init_2 */
|
||||||
/* USER CODE END MX_GPIO_Init_2 */
|
/* USER CODE END MX_GPIO_Init_2 */
|
||||||
}
|
}
|
||||||
|
134
PSE.ioc
134
PSE.ioc
@ -15,37 +15,49 @@ Mcu.IP4=USART1
|
|||||||
Mcu.IPNb=5
|
Mcu.IPNb=5
|
||||||
Mcu.Name=STM32F103V(C-D-E)Tx
|
Mcu.Name=STM32F103V(C-D-E)Tx
|
||||||
Mcu.Package=LQFP100
|
Mcu.Package=LQFP100
|
||||||
Mcu.Pin0=PC4
|
Mcu.Pin0=PE2
|
||||||
Mcu.Pin1=PE7
|
Mcu.Pin1=PE3
|
||||||
Mcu.Pin10=PB12
|
Mcu.Pin10=PE12
|
||||||
Mcu.Pin11=PB13
|
Mcu.Pin11=PE13
|
||||||
Mcu.Pin12=PB14
|
Mcu.Pin12=PE14
|
||||||
Mcu.Pin13=PB15
|
Mcu.Pin13=PE15
|
||||||
Mcu.Pin14=PD8
|
Mcu.Pin14=PB12
|
||||||
Mcu.Pin15=PD9
|
Mcu.Pin15=PB13
|
||||||
Mcu.Pin16=PD10
|
Mcu.Pin16=PB14
|
||||||
Mcu.Pin17=PD11
|
Mcu.Pin17=PB15
|
||||||
Mcu.Pin18=PD12
|
Mcu.Pin18=PD8
|
||||||
Mcu.Pin19=PD14
|
Mcu.Pin19=PD9
|
||||||
Mcu.Pin2=PE8
|
Mcu.Pin2=PE4
|
||||||
Mcu.Pin20=PD15
|
Mcu.Pin20=PD10
|
||||||
Mcu.Pin21=PC6
|
Mcu.Pin21=PD11
|
||||||
Mcu.Pin22=PA9
|
Mcu.Pin22=PD12
|
||||||
Mcu.Pin23=PA10
|
Mcu.Pin23=PD14
|
||||||
Mcu.Pin24=PD0
|
Mcu.Pin24=PD15
|
||||||
Mcu.Pin25=PD1
|
Mcu.Pin25=PC6
|
||||||
Mcu.Pin26=PD4
|
Mcu.Pin26=PA9
|
||||||
Mcu.Pin27=PD5
|
Mcu.Pin27=PA10
|
||||||
Mcu.Pin28=PD7
|
Mcu.Pin28=PD0
|
||||||
Mcu.Pin29=VP_SYS_VS_Systick
|
Mcu.Pin29=PD1
|
||||||
Mcu.Pin3=PE9
|
Mcu.Pin3=PC2
|
||||||
Mcu.Pin4=PE10
|
Mcu.Pin30=PD4
|
||||||
Mcu.Pin5=PE11
|
Mcu.Pin31=PD5
|
||||||
Mcu.Pin6=PE12
|
Mcu.Pin32=PD7
|
||||||
Mcu.Pin7=PE13
|
Mcu.Pin33=PB3
|
||||||
Mcu.Pin8=PE14
|
Mcu.Pin34=PB4
|
||||||
Mcu.Pin9=PE15
|
Mcu.Pin35=PB5
|
||||||
Mcu.PinsNb=30
|
Mcu.Pin36=PB7
|
||||||
|
Mcu.Pin37=PB8
|
||||||
|
Mcu.Pin38=PB9
|
||||||
|
Mcu.Pin39=PE0
|
||||||
|
Mcu.Pin4=PC4
|
||||||
|
Mcu.Pin40=PE1
|
||||||
|
Mcu.Pin41=VP_SYS_VS_Systick
|
||||||
|
Mcu.Pin5=PE7
|
||||||
|
Mcu.Pin6=PE8
|
||||||
|
Mcu.Pin7=PE9
|
||||||
|
Mcu.Pin8=PE10
|
||||||
|
Mcu.Pin9=PE11
|
||||||
|
Mcu.PinsNb=42
|
||||||
Mcu.ThirdPartyNb=0
|
Mcu.ThirdPartyNb=0
|
||||||
Mcu.UserConstants=
|
Mcu.UserConstants=
|
||||||
Mcu.UserName=STM32F103VETx
|
Mcu.UserName=STM32F103VETx
|
||||||
@ -86,6 +98,40 @@ PB15.GPIOParameters=GPIO_Label
|
|||||||
PB15.GPIO_Label=ADS7843_MISO
|
PB15.GPIO_Label=ADS7843_MISO
|
||||||
PB15.Locked=true
|
PB15.Locked=true
|
||||||
PB15.Signal=GPIO_Input
|
PB15.Signal=GPIO_Input
|
||||||
|
PB3.GPIOParameters=PinState,GPIO_Label
|
||||||
|
PB3.GPIO_Label=X_STEPPER_DIR
|
||||||
|
PB3.Locked=true
|
||||||
|
PB3.PinState=GPIO_PIN_SET
|
||||||
|
PB3.Signal=GPIO_Output
|
||||||
|
PB4.GPIOParameters=GPIO_Label
|
||||||
|
PB4.GPIO_Label=X_STEPPER_STEP
|
||||||
|
PB4.Locked=true
|
||||||
|
PB4.Signal=GPIO_Output
|
||||||
|
PB5.GPIOParameters=PinState,GPIO_Label
|
||||||
|
PB5.GPIO_Label=X_STEPPER_EN
|
||||||
|
PB5.Locked=true
|
||||||
|
PB5.PinState=GPIO_PIN_RESET
|
||||||
|
PB5.Signal=GPIO_Output
|
||||||
|
PB7.GPIOParameters=GPIO_Speed,GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||||
|
PB7.GPIO_Label=Y_STEPPER_STEP
|
||||||
|
PB7.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
|
||||||
|
PB7.GPIO_PuPd=GPIO_NOPULL
|
||||||
|
PB7.GPIO_Speed=GPIO_SPEED_FREQ_LOW
|
||||||
|
PB7.Locked=true
|
||||||
|
PB7.Signal=GPIO_Output
|
||||||
|
PB8.GPIOParameters=GPIO_Label
|
||||||
|
PB8.GPIO_Label=Y_STEPPER_EN
|
||||||
|
PB8.Locked=true
|
||||||
|
PB8.Signal=GPIO_Output
|
||||||
|
PB9.GPIOParameters=PinState,GPIO_Label
|
||||||
|
PB9.GPIO_Label=Z_STEPPER_DIR
|
||||||
|
PB9.Locked=true
|
||||||
|
PB9.PinState=GPIO_PIN_SET
|
||||||
|
PB9.Signal=GPIO_Output
|
||||||
|
PC2.GPIOParameters=GPIO_Label
|
||||||
|
PC2.GPIO_Label=LED
|
||||||
|
PC2.Locked=true
|
||||||
|
PC2.Signal=GPIO_Output
|
||||||
PC4.GPIOParameters=PinState,GPIO_Label
|
PC4.GPIOParameters=PinState,GPIO_Label
|
||||||
PC4.GPIO_Label=LCD_RST
|
PC4.GPIO_Label=LCD_RST
|
||||||
PC4.Locked=true
|
PC4.Locked=true
|
||||||
@ -123,6 +169,14 @@ PD8.Mode=16b-d1
|
|||||||
PD8.Signal=FSMC_D13
|
PD8.Signal=FSMC_D13
|
||||||
PD9.Mode=16b-d1
|
PD9.Mode=16b-d1
|
||||||
PD9.Signal=FSMC_D14
|
PD9.Signal=FSMC_D14
|
||||||
|
PE0.GPIOParameters=GPIO_Label
|
||||||
|
PE0.GPIO_Label=Z_STEPPER_STEP
|
||||||
|
PE0.Locked=true
|
||||||
|
PE0.Signal=GPIO_Output
|
||||||
|
PE1.GPIOParameters=GPIO_Label
|
||||||
|
PE1.GPIO_Label=Z_STEPPER_EN
|
||||||
|
PE1.Locked=true
|
||||||
|
PE1.Signal=GPIO_Output
|
||||||
PE10.Mode=16b-d1
|
PE10.Mode=16b-d1
|
||||||
PE10.Signal=FSMC_D7
|
PE10.Signal=FSMC_D7
|
||||||
PE11.Mode=16b-d1
|
PE11.Mode=16b-d1
|
||||||
@ -135,6 +189,24 @@ PE14.Mode=16b-d1
|
|||||||
PE14.Signal=FSMC_D11
|
PE14.Signal=FSMC_D11
|
||||||
PE15.Mode=16b-d1
|
PE15.Mode=16b-d1
|
||||||
PE15.Signal=FSMC_D12
|
PE15.Signal=FSMC_D12
|
||||||
|
PE2.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||||
|
PE2.GPIO_Label=E_STEPPER_DIR
|
||||||
|
PE2.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
|
||||||
|
PE2.GPIO_PuPd=GPIO_NOPULL
|
||||||
|
PE2.Locked=true
|
||||||
|
PE2.Signal=GPIO_Output
|
||||||
|
PE3.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||||
|
PE3.GPIO_Label=E_STEPPER_STEP
|
||||||
|
PE3.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
|
||||||
|
PE3.GPIO_PuPd=GPIO_NOPULL
|
||||||
|
PE3.Locked=true
|
||||||
|
PE3.Signal=GPIO_Output
|
||||||
|
PE4.GPIOParameters=GPIO_PuPd,GPIO_Label,GPIO_ModeDefaultOutputPP
|
||||||
|
PE4.GPIO_Label=E_STEPPER_EN
|
||||||
|
PE4.GPIO_ModeDefaultOutputPP=GPIO_MODE_OUTPUT_PP
|
||||||
|
PE4.GPIO_PuPd=GPIO_NOPULL
|
||||||
|
PE4.Locked=true
|
||||||
|
PE4.Signal=GPIO_Output
|
||||||
PE7.Mode=16b-d1
|
PE7.Mode=16b-d1
|
||||||
PE7.Signal=FSMC_D4
|
PE7.Signal=FSMC_D4
|
||||||
PE8.Mode=16b-d1
|
PE8.Mode=16b-d1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user