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

make a timer to ..,.well time

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

Parents
  • 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

Reply
  • 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

Children
No data