This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem in Timer

Hi,

I am using lpc1768. By using Timer, i have generated a square wave with time period of 16ms. The ON period should be 1ms and OFF period should be 15ms. I used two match registers MR0 and MR1. I done with MR0 for OFF period and MR1 for ON period. But am getting the signal as 15ms as ON period and 1ms as OFF period. Plz suggest some solutions.

Thank You

Parents
  • When and Where did OP mention cortex a8?
    OP mentions LPC1768 which happens to be Cortex-M3 series controller by NXP.

    you could write a program for a cortex a-8 that samples a port pin and feeds the inverted input to an output pin; but that might be a slight overkill for your problem.
    From the question itself, its very clear that the OP is unable to perform one of the simplest task of Toggling a pin correctly, and here you are, advicing OP to travel the globe.

Reply
  • When and Where did OP mention cortex a8?
    OP mentions LPC1768 which happens to be Cortex-M3 series controller by NXP.

    you could write a program for a cortex a-8 that samples a port pin and feeds the inverted input to an output pin; but that might be a slight overkill for your problem.
    From the question itself, its very clear that the OP is unable to perform one of the simplest task of Toggling a pin correctly, and here you are, advicing OP to travel the globe.

Children
  • "When and Where did OP mention cortex a8?"

    Sometimes, it helps to read all posts in a thread, to pick up the required context.

    No one in this thread have claimed that the OP has a Cortex A8. But the (very correct) insinuations is that the OP forgot to turn on the brain today.

    If match pins are used for full hardware operation, then I see at least three different solutions by just playing with the code.

    If having the ISR explicitly play with processor pins, then there are at least 2 different software options to invert the logic.

    None of the alternatives are advanced. All of them can be considered obvious.

    The OP seems to have selected this forum as the first step in his thought process, instead of using it as a fallback when actually stuck after having spent some time with this issue.