cancel
Showing results for 
Search instead for 
Did you mean: 

Pin assignments

RafaelSTM32
Associate III

Hi, I am using the Nucleo-F767ZI, when I am asigning a function to a pin (PD2) this make unselect the pin PG2, when I reassign the pin PG2 this makes the PD2 is deselected, the same when I try with the PF2, what is wrong? this using the graphic interface to configure automatically

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

For a given pin number, only one port can be selected as the EXTI.

So out of PD2, PG2, and PF2 (and PA2, PB2, etc...), only one can be EXTI at once.

This is a hardware limitation.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

8 REPLIES 8
RafaelSTM32
Associate III

This happens only when I configure them like as EXTI

TDK
Guru

For a given pin number, only one port can be selected as the EXTI.

So out of PD2, PG2, and PF2 (and PA2, PB2, etc...), only one can be EXTI at once.

This is a hardware limitation.

If you feel a post has answered your question, please click "Accept as Solution".
RafaelSTM32
Associate III

but manually, can I configure it as EXTI? both?

the tutorials and manual say I can differenciate them with a "if" checking the status in the port register, that's possible?

/*Configure GPIO pins : IN_3_Pin IN_4_Pin */

GPIO_InitStruct.Pin = IN_3_Pin|IN_4_Pin;

GPIO_InitStruct.Mode = GPIO_MODE_INPUT; ONLY CHANGE THIS for GPIO_MODE_IT_RISING_FALLING;?

GPIO_InitStruct.Pull = GPIO_NOPULL;

HAL_GPIO_Init(GPIOD, &GPIO_InitStruct);

TDK
Guru

> but manually, can I configure it as EXTI? both?

No, it's a hardware limitation. No coding can get around that. CubeMX is simply enforcing the limitations of the hardware.

Look at the SYSCFG->EXTICR1 register for the underlying limitation. For pin 2, EXTI2 can only be set to one port at a time.

TDK_0-1693535725698.png

 

If you feel a post has answered your question, please click "Accept as Solution".

Just for clarity, there is no problem setting PA0, PB1, PC2 all as EXTI at the same time. The limitation is that for a given number, only one pin with that number can be an EXTI.

If you have multiple EXTI you want to trigger, put them on different numbered pins.

If you feel a post has answered your question, please click "Accept as Solution".
RafaelSTM32
Associate III

Understood!!, in fact, I made the code and is working fine, thanks for your explanation, it's my first project with your processors and I am learning yet, but now I advanced with your comments!!