How can I set Internal Pull-Up or Pull-Down resistor for Digital I/O pins using Simulink Coder Support Package for STMicroelectronics Nucleo Board?
33 ビュー (過去 30 日間)
I am working on project where I have used external user button connected it to GPIO pin. I am reading the button input using Digital read block from Embedded Coder® Support Package for STMicroelectronics STM32 Processors in simulink. In block parameter, only pin name or pin number/port can be given as parameter. there is no option to enable or disable built in pull-up or down resistor. As per the data sheet, it is mostly available on digital IO pins in STM32 nucleo boards.
This resistor can be easily set to either mode if programming the micro controller using STM32 Cube IDE but not possible in Simulink.
Can any one help me how internal pull-up or down resistor can be enabled using simulink blocks (Digital read)?
Sameer Pujari 2022 年 10 月 25 日
Hi Sandeep Goyani,
I understand you are facing an issue regarding selecting pull mode for a certain GPIO PIN in Simulink.
You can select GPIO pull mode in Configuration parameters dialogue box. Go to Configuration parameters >Hardware Implementation > Target Hardware Resources > GPIO port. Under this tab, select required PIN and then select required pull mode.
Please refer to this documentation link for more details: Getting Started with Embedded Coder Support Package for STMicroelectronics Discovery Boards - MATLAB & Simulink Example - MathWorks India
I hope this information helps you!