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

1 micro second time unit LPC2106

Greetings,

I would like to put the timer to interrupt the LPC2106 CPU on a multiple of 1 microseconds. I got success with a range of 1 millisecond, but at intervals of 1 micro the error is very large, about 40%, one has any idea how to shorten this interval?

Best regards

  • How many instructions can your CPU execute in one microsecond? How many instructions does your ISR (with context save/restore) require?

  • If set up properly, the timer interval is independent of instructions executed in the ISR. As long as the ISR execution time doesn't exceed the interval Bruno should be fine.

    I think Bruno said that the granularity was supposed to be one microsecond -- not the duration of interval. But then, the problem description was not very clear to begin with.

    Regards
    Marcus

  • * Have you considered what this will do to your CPU usage? it will be spending most of its time servicing the interrupt. do you have other interrupt sources? do you do important work in your main loop as well?
    * Make sure that your ISR is not longer than the timer interrupt period otherwise you would miss interrupts, or have delays. Again, do note what this will impact your processor availability to do other work.

  • Hi,

    Thanks for your answers, the time spend in the ISR was bigger than the time unit. So, I changed my approach to use the timer only as a reference of time for the program without interruption. Compared the time of the program shown on Keil with the time of peripheral and saw that the counts were quite different. because i believe that any limitation on the counter. with a tick higher there is not much difference.

    bruno