The question sounds simple, but I'm not able to reset a TC. I use a TC as quadrature decoder. It works fine. I periodically read the value of CV register to know the position. Now I'd like in my code to reset the position (to write 0 in CV). CV is read only, so not really possible.
When I do the tc_init() again, it sets TC_CCT_SWTRG, which, according to the datasheet, reset the counter. But in fact it seems the CV register goes to 0 on next clock pulse only. In my case this means wait for the next encoder pulse, which can never happen if I don't move. So counter will be reset only on next movement.
Is there a way to instantly (I mean without waiting externel pulse) set CV to 0?