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.

F28335 QEP not correct, and one doubt about DMA

Hi,

I tried the example Example_2833xEqep_freqcal from TI on my device, and it doesn't work very well. Here is my configuration.

The PWM frequency is still 5k Hz, but I changed one register (EPwm1Regs.TBCTL.bit.FREE_SOFT = 10) in CCS3.3 watch window before running the program, and I only put the variable freq in watch window, set a break point in function FREQCAL_Calc, DEBUG--> Animate, and the results:

freqhz_pr is about 5000, it seems correct,

freqhz_fr is exactly 10000 most of time (perhaps 99.9% time), and sometimes it jumped to 5000 and immediately jump back to 10000.

My questions:

1. Why is freqhz_fr double of freqhz_pr?

2. in function FREQCAL_Calc, when UPEVNT=1 is detected, it use QCPRDLAT as elapsed time between unit position events. According to datasheet, I don't think it is correct to use QCPRDLAT, the registed maybe not updated in time(by CPU reading position counter or unit timer out). However, QCPRD is exactly the elapsed time between last successive unit position events. Why not use QCPRD for the calculation?

One doubt about DMA :

Each word is transfered in burst loop. Is the word size defined by DATASIZE bit in MODE register? If so, then see Example_2833xDMA_xintf_to_ram (see beneath) , it seems this program is going to transfer 1024 thirtytwo-bit words instead of 1024 sixteen-bit words. Am I right?

PS: I am not able to simulate the DMAexample on my device for now, so I hope somebody can help me here.

Did I go wrong somewhere, or TI go wrong?

Many thanks to any response.

Fang