This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

QDEC SAMPLEPER and REPORTPER relationship

Does anyone have additional information on the relationship between SAMPLEPER and REPORTPER in the nRF QDEC?

I understand that the SAMPLEPER sets the base sample period such that the QDEC will sample the inputs every SAMPLEPER time. Will this also generate the SAMPLERDY event every sample period, or only if there was a change in the inputs?

I see the REPORTPER register is used to set the number of samples to be accumulated before the REPORTRDY event is generated. However, the REPORTRDY event is only generated if the accumulator value is not 0. My question is, if the accumulator is 0 after REPORTPER samples, does the sample count get reset such that another REPORTPER samples must be taken before REPORTRDY gets generated? Or will the next sample that changes the accumulator trigger the REPORTRDY event?

For example, assume we're using REPORTPER = 10 samples/report and starting with a cleared accumulator (ACC = 0). After 10 samples, no motion has been detected, the accumulator is still 0, so the REPORTRDY event is not generated. Now assume sample 12 detects "forward" motion and increments the accumulator (ACC = 1). Is the REPORTRDY event generated immediately after sample 12, or does the REPORTRDY event not get generated until sample 20?

Thanks in advance for everyone's help with these questions.

Parents Reply Children
No Data
Related