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?

15 visualizaciones (últimos 30 días)
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)?

Respuesta aceptada

Sameer Pujari
Sameer Pujari el 25 de Oct. de 2022
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.
I hope this information helps you!
  2 comentarios
SanG
SanG el 25 de Oct. de 2022
Hello Sameer,
Thank you for the answer.
I have attached the photo of my hardware implementation setup. I could not see the any GPIO set up. Please take a look in attached screenshot. The board I am using is STM32 Nucleo F767ZI. There are only settings for communication protocols. GPIO settings are not available. It is available for some discovery boards as you mentioned in answer.
Is there any way to solve this and make GPIO settings availabe in hardware recourses for STM32 Nucleo Boards?
Sameer Pujari
Sameer Pujari el 27 de Oct. de 2022
Hi Sandeep
I understand that GPIO setting is not available for the particular board you are using in Simulink. For now you could try setting the GPIO pull mode while configuring the pin as pull up/down in STM32CubeMX project itself.
You might be alredy familiar with configuring STM32CubeMX project for simulink. Refer this link is you need any help
Hope this solves your issue !

Iniciar sesión para comentar.

Más respuestas (0)

Productos


Versión

R2022a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by