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.
Tool/software: TI C/C++ Compiler
Following this process , I created an independent Instaspin project which builds without errors. However, I am unable to run lab01.
I have LaunchXL-28069M kit and lab01, without the modifications for making a standalone project, runs well. So it is definitely a software problem.
With the independent project, the program gets stuck in HAL_AdcOffsetSelfCal() function inside HAL_Cal().
//Select VREFLO internal connection on B5 ADC_enableVoltRefLoConv(obj->adcHandle); //Select channel B5 for all SOC HAL_AdcCalChanSelect(handle, ADC_SocChanNumber_B5); //Apply artificial offset (+80) to account for a negative offset that may reside in the ADC core ADC_setOffTrim(obj->adcHandle, 80); //Capture ADC conversion on VREFLO AdcConvMean = HAL_AdcCalConversion(handle);
Inside HAL_AdcCalConversion(), the program tries to sample all ADCs a few times to calculate mean offset.
ADC_setSocFrcWord(obj->adcHandle, 0x00FF); while( index < SampleSize ) { //Wait for ADCINT1 to trigger, then add ADCRESULT0-7 registers to sum if (ADC_getIntFlag(obj->adcHandle, ADC_IntNumber_1) == 0){} //Must clear ADCINT1 flag since INT1CONT = 0 ADC_clearIntFlag(obj->adcHandle, ADC_IntNumber_1); Sum += ADC_readResult(obj->adcHandle, ADC_ResultNumber_0); Sum += ADC_readResult(obj->adcHandle, ADC_ResultNumber_1); Sum += ADC_readResult(obj->adcHandle, ADC_ResultNumber_2);
This will enable a software trigger for ADC and on completion the mean will be calculated.
It appears that ADC_setSocFrcWord does not actually trigger a conversion and the program gets stuck at the ADCINtFLG check. I tried to comment it out, but immediately get a bad ISR interrupt. Any attempt to bypass or comment out this calibration leads to a bad ISR interrupt. As this exact code runs in the normal project, I am not sure where to check for bugs.
Any ideas on why this would happen ?
Thanks for your help. My problem is resolved and I have no problem changing directory structure and linking files.
I don't know exactly why it did not work initially, must have been my inexperience. Everything's ok now.