Other Parts Discussed in Thread: CONTROLSUITE
HI,
<Sorry for this long message, but I have to explain to in details.>
I am now using CLA solar library with a F28069 Piccolo Experimenter Kit to implement the Phase Locked Loop. I follow the document “CLA C Solar Library” V.1.1 to implement the SPLL. There are few questions during the development. I hope if anyone can give me a hand.
- As described in the document page 23, the initialization function “SPLL_1ph_CLA_C_INIT(spll1, 50, (0.00005));” is put in the {ProjectName}-Main.c, I found that the function cannot gets problems. As I saw from the emulator that the variables inside the function cannot be inititialzed. Then, I put it into task 8 of the CLA ISR. The problem can be solved. I just wanna confirm is this initialization should be put into CLA task8 ISR instead of putting in the main.c?
- After that, I still not be able to implemnt the SPLL as the variables cos1 cos0 sin1 sin0 are all become zero after SPLL_1ph_CLA_C(spll1) onetime, seems from the CCS using the emulator.
P.S. I tried the following source of AC_input, the results are the same:
1. Using a signal generator to generate 0~3.3V sine wave with 1.165V offset and a ADC channel to pick it up:
//adcvalue = ADCDRV_1ch_CLA_C(AdcResult.ADCRESULT1);
//spll1.AC_input = (adcvalue - 0.5) * 2;
2. A global variable CLA_PLLVal ( a sine value generated using float point function sin()):
//1000 samples!
if (OpenPll.TimeTick == 1000)
{
OpenPll.TimeTick=0;
openpll_temp1 = 0;
CLA_PLLVal = 0;
} else {
OpenPll.TimeTick++;
openpll_temp1 = sin(PIX2*50*OpenPll.TimeStep*OpenPll.TimeTick);
CLA_PLLVal = openpll_temp1;
}
P.S2. The SPPL is put in CLA task1, triggered by PWM1 interrupt, 20kHz.
Thanks,
Barry