2017-08-29 02:32 AM
hello:
i use the encoder in encoder interface mode of TIMER,it can read the CNT of TIM4 correctly in main ,but this is not my target. i want to get the CNT when the TIMER count up or count down, so it must in a interrupt.
so i enable the capture/compare mode of TIM4,but in the capture callbak function,the printed CNT is wrong。the wrong; the correct。
now how can i transmit the CNT in interrupt upon encoder interface mode,i think the capture/compare mode is a wrong way.
Look forward to your reply
2017-08-29 02:44 AM
Do you read the CCRx for the channel you are capturing?
2017-08-29 05:04 AM
Actually,if i look for the CNT in main function ,it is correct。but it is wrong in capture interrupt。so i think Whether it can not transmit in that interrupt。
________________ Attachments : 2C05FB0B@5FEAA046.0A3CA559.jpg : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006HyHj&d=%2Fa%2F0X0000000b8E%2Fxp3z779JPjHmJ2njJmrV8fl.CaKyvqgrsS2xVvKtsfo&asPdf=false