0
\$\begingroup\$

Using a microcontroller timer, is it possible to produce the following signals:

enter image description here

With the following constraints:

  • use only one timer (can count up or down or up and down)
  • output compare channel has only one comparison register
  • no software interactions after the initial setup

I don't want to couple the question to any particular MCU, but you can think of STM32 timers as an example.

I would say it is not possible, but maybe I am not seeing some clever register configuration.

\$\endgroup\$
5
  • \$\begingroup\$ Unlikely with the restrictions you have. However there might be a MCU with special abilities that makes it possible. Such as programmable logic. \$\endgroup\$
    – Justme
    Commented Sep 15 at 8:15
  • \$\begingroup\$ Some TI C2000 microcontrollers contain a Configurable Logic Block (CLB). The application report How to Migrate Custom Logic From an FPGA/CPLD to C2000™ Microcontrollers gives an overview of the capabilities. Posting as a comment to give a suggestion, and not an answer, as haven't checked if will meet all the constraints. \$\endgroup\$ Commented Sep 15 at 8:23
  • \$\begingroup\$ At what frequency would you these signals? \$\endgroup\$
    – Antonio51
    Commented Sep 15 at 12:25
  • \$\begingroup\$ @Antonio51 Why would it matter? At any frequency supported by the timer. \$\endgroup\$
    – user930473
    Commented Sep 15 at 13:11
  • \$\begingroup\$ Then, simple timer working under interrupt and outputting 2 signals in one defined byte (b00011110) would do it (shifting 2 bits, 4 x). \$\endgroup\$
    – Antonio51
    Commented Sep 15 at 13:46

1 Answer 1

0
\$\begingroup\$

If the signal is not high-frequency, within 1-1000 Hz, you can try to reinitialize the comparison register and the timer polarity in the interrupt callback function "on the go".

\$\endgroup\$
1
  • \$\begingroup\$ That idea is against the "no software interactions" so it does not qualify. \$\endgroup\$
    – Justme
    Commented Sep 15 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.