cancel
Showing results for 
Search instead for 
Did you mean: 

Confusion about _C Pins (PA0_C) Behavior and Functionality

AAlis.23
Senior

I don’t understand the behavior of the _C ports. According to the datasheet, the pin type for PA0_C is listed as ANA (analog input only). However, I can configure it as an output and successfully generate a square wave by toggling it in a loop.

Given that, it seems the pin does have an output driver, but I can't get TIM5_CH1 to generate PWM on this pin. (Note: The same configuration works perfectly on TIM5_CH2, so it’s not a configuration issue.)

Additionally, when I configure PA0 as an ADC input, PA0_C no longer works as an output, only when PA0 is in reset state (not configured)

This behavior is confusing because it contradicts the pin type listed as ANA in the datasheet, and it’s not clearly explained how these _C pins should behave. Could someone clarify what can or cannot be done with the _C pins and why this behavior occurs?

The IC is an STM32H743XI (TFBGA 240+25).

Thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for your concern mƎALLEm, the best solution I found, since I could do it, was to use those pins for the ADCs and use other pins for the functions that were previously on the _C ones. It's not a solution to the problem, but it's the simplest one for me.

View solution in original post

8 REPLIES 8

AndrewNeil_0-1743020877714.png

https://www.st.com/resource/en/datasheet/stm32h743xi.pdf#page=87

 

AndrewNeil_1-1743020989248.png

https://www.st.com/resource/en/reference_manual/rm0433-stm32h742-stm32h743753-and-stm32h750-value-line-advanced-armbased-32bit-mcus-stmicroelectronics.pdf#page=539

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
AAlis.23
Senior

I understand that it is done by configuring the corresponding bit in the SYSCFG->PMCR register. However, I don't see CubeMX modifying any value in that register when generating the code (which is probably why it doesn’t work).

On the other hand, I don’t understand how PA0_C can function as a GPIO output, but when I configure it for PWM, it doesn’t work. I don’t see how that could be related to the configuration—either both modes should work or neither, which leaves me in the same situation as before.

So, it’s either a CubeMX bug (yet another one) or I’m missing something here.

Similar topic here:

https://community.st.com/t5/stm32-mcus-products/stm32h743vg-pin-pc2-c-and-pc3-c/m-p/787756

Which links to this article: FAQ: Default State of STM32H7 switches connecting Pxy_C and Pxy pads.

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
mƎALLEm
ST Employee

Hello @AAlis.23 ,


@AAlis.23 wrote:

The IC is an STM32H743XI (TFBGA 240+25).


According to the article, and with that package, all different pads PXC_C are exposed on the package and all the switches are off after reset leaving a given PXY_C disconnected from PXY pad. 

 


@AAlis.23 wrote:

the pin type for PA0_C is listed as ANA (analog input only). However, I can configure it as an output and successfully generate a square wave by toggling it in a loop.


Telling that you can toggle PA0_C pin without configuring the switch is something strange because after reset PA0_C is connected only to the ADC input (the switch is Off after reset).

You need to check the bit PA0SO value in SYSCFG_PMCR. Is is set to 1?

Knowing that:

0: Analog switch closed (pads are connected through the analog switch)
1: Analog switch open (2 separated pads)

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

All these explanations are very helpful, I appreciate them, but all that still doesn't explain why I can set a pin as GPIO output (meaning the switch configuration is correct) but it doesn't support PWM when it should.


@AAlis.23 wrote:

I can set a pin as GPIO output (meaning the switch configuration is correct) 


To me this is weird. That's why I asked you to check PA0SO bit in SYSCFG_PMCR.

 


@AAlis.23 wrote:

 but it doesn't support PWM when it should.


This is expected as the PA0_C switch is OFF.

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Helle @AAlis.23 

Were you able to solve your issue?

To give better visibility on the answered topics, please click on "Accept as Solution" on the reply which solved your issue or answered your question.

Thanks for your concern mƎALLEm, the best solution I found, since I could do it, was to use those pins for the ADCs and use other pins for the functions that were previously on the _C ones. It's not a solution to the problem, but it's the simplest one for me.