This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: MSP432P401R
Tool/software: Code Composer Studio
Hi friends,
I am doing a project in MSP432P401R Launchpad. For my project I need an accurate delay function, because I need milliseconds and microseconds delays. Could anyone suggest me an accurate delay function for msp432 launchpad working with CCS studio.
Thank you.
Have a look at these code examples, especially
Dennis
Hi Dennis,
When I copy paste the code to ccs project, it shows many errors. I am sorry I am not an expert to solve this many errors.My CCS version is 6.1.2. I could only install this version because bigger versions shows error during installation. So could you give me just an led toggle project using timer for my version.
The below is my errors when I copy paste the msp432p401x_ta0_02 project.
Description Resource Path Location Type
#135 expected a field name blink.c /timer line 76 C/C++ Problem
#135 expected a field name blink.c /timer line 100 C/C++ Problem
#137 struct "<unnamed>" has no field "CCR" blink.c /timer line 87 C/C++ Problem
#137 struct "<unnamed>" has no field "CCTL" blink.c /timer line 85 C/C++ Problem
#137 struct "<unnamed>" has no field "CCTL" blink.c /timer line 86 C/C++ Problem
#137 struct "<unnamed>" has no field "CCTL" blink.c /timer line 98 C/C++ Problem
#137 struct "<unnamed>" has no field "CTL" blink.c /timer line 71 C/C++ Problem
#137 struct "<unnamed>" has no field "CTL" blink.c /timer line 88 C/C++ Problem
#20 identifier "P1" is undefined blink.c /timer line 75 C/C++ Problem
#20 identifier "P1" is undefined blink.c /timer line 100 C/C++ Problem
#20 identifier "TIMER_A_CCTLN_CCIE" is undefined blink.c /timer line 86 C/C++ Problem
#20 identifier "TIMER_A_CCTLN_CCIFG" is undefined blink.c /timer line 85 C/C++ Problem
#20 identifier "TIMER_A_CCTLN_CCIFG" is undefined blink.c /timer line 98 C/C++ Problem
#20 identifier "TIMER_A_CTL_MC__UP" is undefined blink.c /timer line 89 C/C++ Problem
#20 identifier "TIMER_A_CTL_SSEL__SMCLK" is undefined blink.c /timer line 88 C/C++ Problem
#20 identifier "WDT_A_CTL_HOLD" is undefined blink.c /timer line 72 C/C++ Problem
#20 identifier "WDT_A_CTL_PW" is undefined blink.c /timer line 71 C/C++ Problem
I like to mimic the arduino millis() function. This works well for millisecond delays - you need to test it for microsecond resolution.
// global volatile uint32_t Tick; // In main/init MAP_SysTick_enableModule(); MAP_SysTick_setPeriod(1500000); //Depends on your clock and tick requirements MAP_SysTick_enableInterrupt(); /* Enabling MASTER interrupts */ MAP_Interrupt_enableMaster(); // ... void SysTick_Handler(void) { Tick++; }
To time things you can simply save Tick at the start, and subtract the current Tick at the finish.
**Attention** This is a public forum