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

17xx timer

hello all

i am very new in lpc17xx i want to introduce delay in program of 10ms. can any one give me some examples for lpc1768 .and i also want to know how to calculate MR0 value, is any formula for that??

Thanks in advance.

Parents Reply Children
  • As you notice that your times are off from what you want, you should by now have realized that your PCLK is not 9MHz. So your timer do not tick 9000000/1000 = 9000 ticks/ms. So 9000-1 is not the correct value to use for 1ms delay. And 18000-1 is not the correct value to get a 2ms delay.

    So you then have two options. Either figure out what PCLK you actually have (takes reading of the code and reading of the user manual). Or decide what PCLK you want and then change the code correspondingly. Which also requires reading of the same processor user manual.