BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 12:30 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Not sure how to do....
PostPosted: Sun Jan 22, 2012 6:50 pm 
Offline
Citizen

Joined: Mon Aug 15, 2011 6:06 am
Posts: 17
I have a single line coming to the chip. I need to beable to not only count the number of pulses, but the frequency of them.
I see ways to get the freq and ways to get the count, but not at the same time.
The counter could hit the int pin and run a routine to count the pulse.
I couls also start a counter and count between the pulses for the freq.
But. One will interfer with the other.
Any way I can accomplish both at the same time?


Top
 Profile  
 
 Post subject: Re: Not sure how to do....
PostPosted: Mon Jan 23, 2012 7:36 am 
Offline
Citizen

Joined: Mon Aug 15, 2011 6:06 am
Posts: 17
I am trying to work out how to build a digital spedometer with Odometer.


Top
 Profile  
 
 Post subject: Re: Not sure how to do....
PostPosted: Tue Jan 31, 2012 8:45 pm 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
Hello, juliemac. :)
Basically, pulse count is done over a set time period. Do this over a one second interval and now you have both the count and frequency. If you get 117 pulses in your one second period, you have a frequency of 117 Herz (cycles per second). If you need a more frequent update than once per second, then do the sampling in a tenth second interval and multiply the count by 10 to arrive at a slightly less accurate frequency.
Of course you'll have to use interrupts to get a time interval larger than a few milliseconds. BASIC interrupts for Nanos aren't supported in Studio, just Pro parts. You'll have to search the forums for how to do this in assembly for Atom parts, which also applies to Nanos (Or buy a Pro One-M). The examples are there.
Take care.

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Not sure how to do....
PostPosted: Wed Feb 01, 2012 1:22 pm 
Offline
Master

Joined: Tue Jun 22, 2010 1:15 pm
Posts: 203
DUPLICATE POST IN ANOTHER THREAD?

_________________
Visit:
http://groups.yahoo.com/group/SherlineCNC/
http://tech.groups.yahoo.com/group/HexapodRobotIK/


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO