Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE
I have generated a sine wave using LUT.1) initialized phase to -pi
2)incremented phase in steps of 0.1*pi till phase = 1*pi
3)find the sine of the phase using LUT and stored it in an array (total 21 values in the array)
4)load the values in the array to DACVALS reg (DAC_setShadowValue(DACA_BASE, dacval)) and observed the sine wave on picoscope 6
set device_delay_us(2) after setting the shadow value
I've observed 15.067KHz sine wave.
From this I've calculated sampling frequency as Fs=(15067)*21=316400
Now, I 've generated a sine wave of desired frequency as follows:
a) f=3000 (3 KHz), Fs=316400
b) no of samples n = round(Fs/f)
c) stepPhase = (2.0/n)*pi
d) followed steps 1 to 4 with stepPhase obtained in the above step
Now I"ve observed 2.995KHz sine wave when I set f=3KHz
9.887KHz sine wave when f=10KHz
4.07KHz sine wave when f=4KHz
Q1) Does my sample frequency calculation approach make sense?
Q2) Is there a reason why the exact frequency is not observed? and how to get it?
Q3) when i removed the device delay of 2us after setting the shadow value, the frequency of the observed sine wave changed drastically. What is the reason for that?