Part Number: MSP432P401R
Tool/software: Code Composer Studio
Hello TI experts,
I am trying to integrate Tachometer module inside RTOS using Posix Thread. I initially referred to the training and implemented tachometer using tirslkmaze project using the video in the link https://training.ti.com/ti-rslk-module-16-lecture-video-part-i-tachometer-input-capture?context=1135347-1139307-1134815. I used the TimerA3 as the Interrupt to capture to control speed of the motor. Both tachometers are under the same timer A3 (TA3_N_IRQHandler and TA3_0_IRQHandler). Everything is working before changing to RTOS platform.
Due to incompatibility issue, I redirected implementation to MSP432SDK library. But the library only defines one pin only in each timer (unlike the previous library). I refer to the program in this link and modify from one input capture to two. http://dev.ti.com/tirex/explore/node?node=AJnos0yvE0MmjXvUYxHYhQ__z-lQYNj__LATEST
Now it has insufficient pins for my tachometers to work as tachometers are supposed to work without preempting each other. I modified additional timer pin to capture the input. However, it didn't work and seems it is incompatible to define additional pin on the same timerA3. Then I changed to different pin on the other timerA1. It is also not working; only one side is working and preempting other side resulting issue during integration. May I know whether I can add additional pin on timerA3 so that it can work well or other ideas that can make both tachometers working? I am seeking suggestion from you so that I am able to complete this on time by this week. Thank you so much for help.
#include <ti/drivers/Capture.h> #include <ti/drivers/capture/CaptureMSP432.h> CaptureMSP432_Object captureMSP432Objects[MSP_EXP432P401R_CAPTURECOUNT]; const CaptureMSP432_HWAttrs captureMSP432HWAttrs[MSP_EXP432P401R_CAPTURECOUNT] = { /* Timer_A1 */ { .timerBaseAddress = TIMER_A1_BASE, .clockSource = TIMER_A_CLOCKSOURCE_SMCLK, .clockDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1, .capturePort = CaptureMSP432_P7_7_TA1, .intPriority = ~0 }, /* Timer_A2 */ { .timerBaseAddress = TIMER_A2_BASE, .clockSource = TIMER_A_CLOCKSOURCE_ACLK, .clockDivider = TIMER_A_CLOCKSOURCE_DIVIDER_64, .capturePort = CaptureMSP432_P6_7_TA2, .intPriority = ~0 }, /* Timer_A3 */ { .timerBaseAddress = TIMER_A3_BASE, .clockSource = TIMER_A_CLOCKSOURCE_SMCLK, .clockDivider = TIMER_A_CLOCKSOURCE_DIVIDER_1, .capturePort = CaptureMSP432_P10_4_TA3, .intPriority = ~0 } }; const Capture_Config Capture_config[MSP_EXP432P401R_CAPTURECOUNT] = { { .fxnTablePtr = &CaptureMSP432_captureFxnTable, .object = &captureMSP432Objects[MSP_EXP432P401R_CAPTURE_TA1], .hwAttrs = &captureMSP432HWAttrs[MSP_EXP432P401R_CAPTURE_TA1] }, { .fxnTablePtr = &CaptureMSP432_captureFxnTable, .object = &captureMSP432Objects[MSP_EXP432P401R_CAPTURE_TA2], .hwAttrs = &captureMSP432HWAttrs[MSP_EXP432P401R_CAPTURE_TA2] }, { .fxnTablePtr = &CaptureMSP432_captureFxnTable, .object = &captureMSP432Objects[MSP_EXP432P401R_CAPTURE_TA3], .hwAttrs = &captureMSP432HWAttrs[MSP_EXP432P401R_CAPTURE_TA3] } }; const uint_least8_t Capture_count = MSP_EXP432P401R_CAPTURECOUNT;
Regards
Min Min