If you can sample over 1 second, this is pretty simple. Just set the signal up on an interrupt (rising or falling edge). Count the interrupts over 1 second. There will be a +/- 1 count jitter - which is significant at low frequencies (you might read 0 or 2 hz for a 1 hz signal). At 60mhz speed, you can run 300 instructions between interrupts at 200Khz - about 60 lines of c code. You can get fancier - for high frequencies you can estimate after counting for .1 second - leaving some CPU for other tasks. I have to reduce this to code in the next few weeks. Dan _____ From: lpc2000@yahoogroups.com [mailto:lpc2000@yahoogroups.com] On Behalf Of lehighuboy Sent: Thursday, June 09, 2005 10:18 PM To: lpc2000@yahoogroups.com Subject: [lpc2000] Re: Frequency counter I need to read the frequency of a 50% duty cycle waveform from 0 to 200kHz (+/- 1Hz) using the LPC2129. Any suggestions? Thanks, Garrett --- In lpc2000@yahoogroups.com, "lehighuboy" <garrett.j.young@g...> wrote: > Does anyone have sample code that counts pulses for a fixed time > duration (frequency counter)? > > Thanks, Garrett _____ Yahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/lpc2000/ * To unsubscribe from this group, send an email to: lpc2000-unsubscribe@yahoogroups.com <mailto:lpc2000-unsubscribe@yahoogroups.com?subject=Unsubscribe> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . [Non-text portions of this message have been removed]
Message
RE: [lpc2000] Re: Frequency counter
2005-06-10 by Dan Beadle
Attachments
- No local attachments were found for this message.