hi i am using lpc 2134 for my project.i have installed the real view Uvision3 kit. i have successfully run the hello world program. i now want to start my own project.i have included the lpc21**.h file in my program and also the appropriate startup.s file. i want to write a delay routine of 1200ms.which function should i call.also if i want to write serial port,timer functions or rtc functions which files should i include or which functions do i call. is there any function prototype defined for these. kindly reply thanks harshada
hi harashadara,
i use funktion delay with a number in brackets for how long i want. you must put in 97 for delay of 1200 becoz 1 is 12.37MS.
jalim barfok: Don't post random answers just for fun. It really isn't fun!
For your delay, you should configure a processor timer to tick at a suitable frequency. Then you can either have the timer generate an interrupt after 1200ms, or create a busyloop that samples the tick counter and then waits until the tick counter has stepped the required number of ticks.
Let's say that the counter ticks once/ms. Then you could do:
<code> void delay_ms(unsigned ms) { unsigned t0 = tick_counter; while (tick_counter - t0 < ms) ; } </code>
You really have to spend some time reading through the user manual for your processor. It contains the information about how to configure the UARTS etc. Also look at the available sample code. But in the end, _you_ will have to write code for your processor. The difference between microcontrollers and a PC is that you don't have a thick driver layer with a full set of functions to call.
per westermark see:
http://www.keil.com/forum/tips.asp
No, it's more a problem with posting to more than one forum, and of getting a phone call at the end of the post. Since I needed my keyboard for the phone call, the fastest method was Preview+Post in a very, very big hurry.
Anyway, I still think I have at lest 99% correctly formatted posts ;)
bcoz of past records and goodly excuse, we forgive you on this time ;)
Thank you very much!
I'll try to behave!
jalim, I really don't want to sound rude, but sometimes I regret that Keil do not automatically apply tags to verify correct and no-nonsense English! "bcoz?" like, duh?