BasicMicroUK - Forums

www.basicmicro.co.uk
It is currently Tue Oct 23, 2018 10:26 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: Speedo and Odo
PostPosted: Tue Jan 24, 2012 12:14 am 
Offline
Citizen

Joined: Mon Aug 15, 2011 2:06 pm
Posts: 18
I have a single line coming to the 28 pin chip. I need to be able 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 could 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: Speedo and Odo
PostPosted: Tue Jan 24, 2012 8:27 pm 
Offline
Master

Joined: Tue Jun 22, 2010 9:15 pm
Posts: 228
Why can't you use an interrupt pin, read a timer between pulses? You can also count the pulses in a software counter.

You do know that depending on the frequency, you either want to measure the period of the pulses, or the number of pulses per time?

Alan KM6VV

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


Top
 Profile  
 
 Post subject: Re: Speedo and Odo
PostPosted: Wed Jan 25, 2012 12:32 am 
Offline
Citizen

Joined: Mon Aug 15, 2011 2:06 pm
Posts: 18
I thought of that today. An interupt to branch and increment the counter. 844 pulses to the mile (I am guessing here). every 84th pulse to update the milage count.

Count the time between the pulses gives the speed. Also during this time that the count is going, transmit the values via serial port.
The first packets of data will contain zeros, but after that it should carry the correct data.


Top
 Profile  
 
 Post subject: Re: Speedo and Odo
PostPosted: Wed Jan 25, 2012 12:43 am 
Offline
Master

Joined: Tue Jun 22, 2010 9:15 pm
Posts: 228
I think he's got it!

Alan KM6VV

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


Top
 Profile  
 
 Post subject: Re: Speedo and Odo
PostPosted: Wed Jan 25, 2012 2:27 am 
Offline
Citizen

Joined: Mon Aug 15, 2011 2:06 pm
Posts: 18
Geekette here :)
I also cook and sew!


Top
 Profile  
 
 Post subject: Re: Speedo and Odo
PostPosted: Wed Jan 25, 2012 7:24 pm 
Offline
Master

Joined: Tue Jun 22, 2010 9:15 pm
Posts: 228
Ladies Welcome!

feel free to ask a lot of questions, there are folks here willing to help!

Alan KM6VV

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


Top
 Profile  
 
 Post subject: Re: Speedo and Odo
PostPosted: Sun Mar 04, 2012 9:24 pm 
Offline
Citizen

Joined: Mon Aug 15, 2011 2:06 pm
Posts: 18
I have the hall effect sensor triggering the interupt and been trying to learn how to make a timer that measures the time between inteupts, but find little info apart from some ASM code (which I can read, but cant write)

Does any one have a code chunk to start, read count then restart?


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 0 guests


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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO