I am new so hang with me as i drivel on,
i just want to set up a timer on the MCB900 using an lpc935, all i want is to count to a second or 2 so i can use this to measure inputs a set time apart. And before someone replies 'its simple' bla bla bla, keep in mind i am very new to this baby steps first pleeeeeeeeese roy
all i want is to count to a second or 2 so i can use this to measure inputs a set time apart.
The actual execution will depend on your (more specific) requirements.
In general, you want to run an isr that counts time at a pre-set interval. And in the isr, you count the number of times the isr has been executed as a way to gauge if a long period of time has passed. You can then set a flag and process that flag accordingly, in the isr or in the main.
oh well baby steps, if you hit your toe, don't cry
1) the LPC935 is not 'none' it is a '51, enter type correctly
2) the timer can not do times as long as seconds, so what you do in paseudocode
either seconds_times_100 = whatever you need set_timer_to_run_for_10_milliseconds(); loop till timer flag loop2: restart timer decrement seconds_times_100 if seconds_times_100 expired you are done else loop2:
or seconds_times_100 = whatever you need set_timer_to_run_for_10_milliseconds(); when seconds_times_100 is zero, you have waited long enough
timer_ISR restart timer if seconds_times_100 not zero decrement seconds_times_100
Erik
View all questions in Keil forum