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
Hi Team,
My customer is using MSP432P401R base on keil IDE. Now, they meet an issue when do the code optimization. In TA0 interrupt service function, there are two tasks. One is trigger ADC interrupt, another is clear interrupt flag. If they set the optimization level as 01, the timer interrupt will be triggered frequently.
The code is as below:
void TA0_N_IRQHandler(void) { AdcStart(); Timer_A_clearInterruptFlag(TIMER_A0_BASE); }
void AdcStart(void) { /* According to the datasheet: When any other trigger source is used to start a sequence, * ADC14ENC must be toggled between each sequence. * ADC14ENC low pulse duration must be at least three ADC14CLK cycles. * Use timer to trigger conversion */ /* Triggering the start of the sample */ ADC14_disableConversion(); nopdelay(); /* fADCLK=MCLK/8*/ ADC14_enableConversion(); ADC14_toggleConversionTrigger(); }
The assembly is as below with code optimization (optimization level = 01):
The assembly is as below without code optimization (optimization level = 00):
So could you give some comments about the issue? Thanks.
Chris,
So do you mean that the issue is related with the keil compiler, not related with MSP432 driver or code? Thanks.
**Attention** This is a public forum