Skip to main content
KMoge
Visitor II
August 8, 2018
Question

Reset and hold counter value on low level

  • August 8, 2018
  • 1 reply
  • 656 views

Dear community

I am trying to make a timer/counter reset it's counter value on a falling edge and then hold the value until a rising edge (see attached ​picture for illustration). I am at the moment working on a L152, but I might soon be working on a L471 and F373 as well.

From reading the L152 manual, it seems that I can either have the reset (Slave mode: Reset mode) or the holding of the value (Slave mode: Gated mode), but is there a smart way to achieve both? The dream is that the described functionality is done by the hardware without use of an interrupt. But any suggestions are more than welcome!

Thanks in advance!

    This topic has been closed for replies.

    1 reply

    waclawek.jan
    Super User
    August 8, 2018

    Maybe you could use the gated mode together with triggering a DMA transfer from a fixed memory position into the timer's CNT, which would perform the zeroing.

    JW