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

measuring time between two pulses

Hi all,

first time posting here. Ive got a most simple goal, measure the time between a bit going low and a second bit going low.

I can only use P1, so Im assuming

loop
while p1.0 = 1

p1.0 = 0?

start a timer, could count up to 10 seconds

now loop waiting for p1.1 = 0

p1.1 = 0?

stop the timer, calculate how many seconds

display the result. Im using an HTE SDK8032 board, there is a monitor routine to display text, it interfaces to hyperterminal. if I can just get that "seconds" value, I could convert as needed and print it.

simple. what happens? nothing.

now Im trying to use C and a 32bit long as the timer int, maybe decrement, jump not zero or ?

but figuring out time from the 11.05 Mc crystal (used for baud rates) is just not making sense right now, any help is appreciated.

Parents
  • "I meant the program doesnt work."

    That could still mean anything from "the program does nothing at all." to "the program doesn't quite do what I expected"

    *** FATAL ERROR L210: I/O ERROR ON INPUT FILE:
    Note that this is a Linker error - not a compiler error.

    Have you used anything anywhere in your source code that would require floating point? NB: that could include printf!

Reply
  • "I meant the program doesnt work."

    That could still mean anything from "the program does nothing at all." to "the program doesn't quite do what I expected"

    *** FATAL ERROR L210: I/O ERROR ON INPUT FILE:
    Note that this is a Linker error - not a compiler error.

    Have you used anything anywhere in your source code that would require floating point? NB: that could include printf!

Children
No data