16F84 and time between two flash

Sep 20, 2004 1 Replies

Hi,



I want read precise time elapsed between two flash of a red led and show this time on a 8/16 char matrix display. The value has to be very accurate. Time range goes from 0.2 sec to 15 sec.



I would like do this by a 16F84 in basic language (picbasic pro compiler)



Im a VB programmer and Im a newbie in a microcontroller programming



Any suggestion for code and circuit for phototransistor ???


Thanks


This shouldn't be too hard with a PIC 16F84. I have the Matrix Multimedia development system with the C2C compiler. In this system is a tutorial program that takes the student through progressively more difficult examples with a 16F84. Anyway there is an example of a stopwatch program that displays the running clock count in seconds and tenths of seconds on a four digit 7 segment LED display. It uses an interrupt from a timer that is scaled to generate an interrupt every 0.1 seconds. The time is counted up at each interrupt and then displayed in four digits. I have verified that it is a rather good and accurate stopwatch. The code is written in the C language but you should be able to convert it to basic. Contact MM at

formatting link
and ask for a copy of the "EX 4.7 Stopwatch with stop/start" by Rob Miles. MM is located in the UK.

Marlowe Cassetti Penrose, CO USA

accurate.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required