Part Number: TMS320F28035
Tool/software: Code Composer Studio
Hi,
I intended to use CLA to read ADCRESULTs and do filtering. However, the code below implemented in CLA task1 kept erasing values I set in epwm1 register. And weirdly, this happened randomly after debugging and loading program, which means sometime it behaved normally, but sometimes it erased settings in epwm1 and wrote unwanted values to it. Do you have any clue why it happened?
depot.position++;
if(depot.position >= SMA_SIZE)
{
depot.position = 0;
}
depot.vin[depot.position] = VINDC;
VINDC refers to ADCRESULT1. The "depot" is a struct claimed in main.c and locates in "Cla1DataRam0". The datatype of the "position" is int16_t, and the "vin" is an array of int16_t.
Thanks a lot for helping me.
Amy