Wrong Hall sensors alternate function
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-06 5:55 AM
Posted on April 06, 2015 at 14:55
Hi,
I'm using ST PMSM FOC 4.0 with STM32F303RB and Hall sensor. Hall sensors are on PORTC pins 6, 7 and 8. Used as TIM3 channel 1-3 inputs. Code is generated from the MC workbench. Symptom is - hall sensor signals are pulled low by the MCU. So i digged into peripheral registers with debugger and found that PC6, PC7 and PC7 have alternate function 1 which is EVENTOUT. They shoulduse AF2 which is TIM3_CHx. In library header file called SystemNDriveParams.h there's a struct which is initialized with Hall sensor alternate functions. There's also a default AF assignment:/* TBR after final test with WB */
#if !defined(H1_GPIO_AF)
#define H1_GPIO_AF GPIO_AF_1
#endif
#if !defined(H2_GPIO_AF)
#define H2_GPIO_AF GPIO_AF_1
#endif
#if !defined(H3_GPIO_AF)
#define H3_GPIO_AF GPIO_AF_1
#endif
As the H1/H2/H3_GPIO_AF are not generated by workbench then they get the default values (AF1). Maybe the Workbench can be updated so it also generates correct alternate functions?
#hall-alternate-function
Labels:
- Labels:
-
STM32 Motor Control
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2015-04-07 12:23 AM
Posted on April 07, 2015 at 09:23
Yes, it is someting that we already discovered in
/38f0550c
thread. We will fix in next version. Ciao GigiOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2021-06-27 10:53 PM
The question has been moved from the "Motor Control Hardware" section to the "STM32 Motor Control" section (the question is about the STM32 MC SDK).
Best regards
