I am writing a BLDC control program, in codewarrior11, this BLDC has a Hall sensor and the control chip is dsc 56f84763. I use the capture module to capture the hall pin (GPIOC8) for speed measurement, and the bitIO module to determine the level of the hall pin. There is a conflict between the capture module and the bitIO module. How can I solve this problem?Or give me a demo.
thank you very much!
Another method is to read the register of the pin. But I don't know how to view the registers? can you help me?
Hi, Fei,
Regarding your Hall sensor connection, I recommend you connect 3 Hall signal to the QuadTimer input pins, if you use quadTimerA, you have to connect the three Hall signals to TA0/TA1/TA2/TA3, in other words, three out of four quadTimer pins. You can set both rising/falling edge to trigger capture ISR, in the ISR, you can read the INPUT bit(bit 8) of TMRx_nSCTRL to get the hall signal logic. The INPUT bit reflects the current state of the pad.
There are two methods to route the capture signal to quadTimer input pin, which is selected by the Secondary Count Source bits(bit 8~7) in TMRx_nCTRL. The first one is to connect the Hall signal to quadTimer input pins directly for example TA0/TA1/TA2, you can set the SCS bits to select the pins. The second method is to connect the hall signal to XB_INx for example XB_IN2/XB_IN3/XB_IN4, you can use crossbar to route the signal to either quadTimerA input pin to quadTimerB input pins, but only one not both.
We do not recommend that user connect the 3 hall signals to GPIO pins.
Hope it can help you
BR
Xiangjun rong
1)quadTimer input pins:
2)Crossbar signal routing diagram: