TCPWM QuadDec counter reset after DeepSleep

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

I'm having an issue with TCPWM QuadDec. To my knowledge the counter value should be retained during DeepSleep. However, it does not survive DeepSleep. The settings of the QuadDec was saved and restored. But the counter value (qdec_count below) resets, i.e. returns to the initial value 0x8000 after the DeepSleep.

QuadDec_WriteCounter(12345)

QuadDec.Sleep()

CySysPmDeepSleep();

QuadDec.Wakeup()

qdec_count = QuadDec_ReadCounter() // always 32768

You can reproduce it with the project included.

Thanks,

0 Likes
1 Reply
Anonymous
Not applicable

Well... a fix is to save the counter value in RAM, and then rewrite it upon wakeup 😕

0 Likes