I am porting instaspin to run on my own board. It uses a TI320F28069M. I found and fixed the following three bugs in instaspin reference code. You may want to include them in future release if I am right.
1- For the topology shown in section 5.2.2.2 in the User's guide (SPRUHJ1C) for current feedback. In addition to the changes stated in the manual, you also need to edit the code in the function DRV_readAdcData() in drv.h file. You need to replace:
pAdcData->I.value[x] = -value;
with
pAdcData->I.value[x] = value;
for all the currents A, B and C reads (x above = 0,1,2).
2- Function ADC_disableInt() in adc.c has a serious error. It actually does not work. You need to replace the line:
(ADC_INTSELxNy_NUMBITS_PER_REG - ((intNumber & 0x1) << ADC_INTSELxNy_LOG2_NUMBITS_PER_REG));
with
(ADC_INTSELxNy_NUMBITS_PER_REG - (((intNumber+1) & 0x1) << ADC_INTSELxNy_LOG2_NUMBITS_PER_REG));
makeing calculation the same and correct as like in function ADC_enableInt() and ADC_setIntMode() in the same file.
3- Function DRV_setupAdcs() in drv.c is missing the following lines:
ADC_setupSocTrigSrc(obj->adcHandle, ADC_SocNumber_x, ADC_NoIntTriggersSOC);
for x = {0 through 15)
This is needed in order for the following calls to ADC_setSocTrigSrc() in the DRV_Adcs() function to have an effect. The code currently work on TI boards because bug (2) and bug (3) interact in a fortuitous way. Code fails if you use more than 8 ADC conversions.