Maker Pro
Maker Pro

reading frequency into PC

D

Duck

Jan 1, 1970
0
Wow. I didn't think I was going to get so much help. Thanks people. Some of this
has gone over my head, though, I'm learning a lot of it by researching what you say.

I suppose I should have spelt it out better. The more info you have, the easier
it is to provide an answer. Chris Foley had it the closest. It's an automotive
application.

The Speed Sensor sends a 4000 pulse per mile sine wave. I've found a schematic
to convert this into a square wave. I want to display the speed in a graphical
display, and also be able to use formulas to convert to KM's and for a trip
computer/mileage display. I will be interfacing all the sensors, but the rest
seem much easier. I figure if I can interface the speedo, the rest shouldn't be
a problem. The tach will output 3 pulses per rpm. So, theoretically, the very
most I'd ever see would be about 400 hertz. The rest of the sensors are either
resistance or voltage.

Will I be able to read two different sets of pulses reliably? Perhaps I should
resort to using a PIC or other IC. Unfortunately this is being done on a tight
budget and a chip programmer would be another expense. Oh well. C'est la vie.


Anyway, thanks again for all the help so far.

Kris
 
F

Frithiof Andreas Jensen

Jan 1, 1970
0
What O/S? I doubt it's possible to do this reliably under Wind*ws.

Not So Fast - What about the Sound Card?

Surely this will sample up to a bit beyond 20 KHz, it is there, the input is
protected and there are drivers for it so you do not have to write them!

WinXP is not bad at all, actually it is the best OS out of Microsoft.
 
F

Frithiof Andreas Jensen

Jan 1, 1970
0
In modern operating systems such as used by MS widows and by Linux
it is not recommended to do a real time read, as the software will
interrupt any loop (taskswitch every few milliseconds) also there are
interrupts.

Only if you do not know how to do it!

User-side Polling is a loosing design - you have to be on the Kernel side
and be interrupt driven. This is fairly easy on Linux, the source and the
build envronment being available and all that.

Linux has a real-time version - the commercial support is by Montavista -
which also have delivered the Kernel patches so you can roll your own. Some
of the patches are in the latest kernels - so if you can live with latacies
in the order of a millisecond or so, you do not have to do anything special.
The only way around it is to use say a PIC microprocessor, it has
a counter specially for this,

There are *many ways round this* - the common PeeCee has several interfaces
which are interrupt driven and sitting on the Kernel side: The sound card is
obvious, the Game Port is another good choice, The Mouse Port - those mice
generate *a lot* of pulses moving across the surface which are counted to a
position - maybe there is a MIDI port? IRDA?

A *lot* of brute force can be brought to bear in a PC!
 
S

Spajky

Jan 1, 1970
0
I've got something that outputs pulses per rotation. It uses a sine wave. I
planned on using (half of) an LM393 to convert it into a square wave, the trying
to read that into a parallel port so I can run a real-time display.

Now, the question is, how do I read the frequency (it ranges from 0 to about 150
pulses per second) into the PC so it's useable?....

My extent of parallel port programming is turning on and off an LED in Basic.

if you will need that revealing Rpm only on your machine, why not to
use fan MoBo header to do that (normally it can read Rpm as low as
600rpm (10/sec) after some minor circuitry (on my site I used under
electo/fan tacho w/o 3rd wire) added. But if really needed lower
readings, that would be a problem using that ... just an idea ...
 
B

Bill Sloman

Jan 1, 1970
0
Kris Duck said:
Hi there. I'm new here, so I'm not sure if this is the right group.

I've got something that outputs pulses per rotation. It uses a sine wave. I
planned on using (half of) an LM393 to convert it into a square wave, the
trying to read that into a parallel port so I can run a real-time display.

Now, the question is, how do I read the frequency (it ranges from 0 to
about 150 pulses per second) into the PC so it's useable? I don't know
assembler, but from what I can tell, it's a low enough sampling rate that I
should be okay with something less robust like Basic or VBasic or something.

My extent of parallel port programming is turning on and off an LED in Basic.

You are probably going to be better off measuring the length of the
interval between pulses. The shortest period is 6.6msec. If you want
1% resolution at that rate of rotation, you need a 15kHz clock. A
32768Hz watch crystal would be easy to get hold of, and a 16-bit
counter would overflow when the interval between pulses reach about 2
seconds.

You've got to latch and buffer the output of the counter, so that you
can read the period of the most recent inter-pulse interval via your
parallel port while your counter is accumulating counts to measure the
length of the current interval. You may need to read the 16-bits in
two 8-bit bytes, in which case you might need to add a second set of
latches to allow you to make sure that the two bytes represent the two
halves of the same 16-bit word, rather than one byte from an earlier
interval and the other byte from a later interval.

You can do this easily in a single chip procesor like a PIC, or in a
suitably programmed programmable logic device (albeit something bigger
than a 22V10 - I've just listed 32/48 bistables, ignoring any
house-keeping bistables).

If you also want to count the total number of pulses, you can do that
with a separate counter clocked by the pulses themselves (don't forget
to make sure that the pulse edges have been debounced). That should
fit into the same PIC or programmable logic device - since the
programmable logic device can have completely independent counters, it
probably offers slightly less chance of running into subtle
difficulties.
 
T

Tim Auton

Jan 1, 1970
0
Duck said:
Will I be able to read two different sets of pulses reliably? Perhaps I should
resort to using a PIC or other IC. Unfortunately this is being done on a tight
budget and a chip programmer would be another expense. Oh well. C'est la vie.

PIC and AVR programmers can be made with the stuff you probably have
lying around, or integrated into your final board design. The socket
and plug are the most expensive parts.

http://www.google.co.uk/search?q=AVR+programmer
http://www.google.co.uk/search?q=PIC+programmer


Tim
 
S

Spehro Pefhany

Jan 1, 1970
0
Not So Fast - What about the Sound Card?

Doesn't work with the parallel port, but sure, it's a device that
could be used.
Surely this will sample up to a bit beyond 20 KHz, it is there, the input is
protected and there are drivers for it so you do not have to write them!

You do have to deal with buffering (to hard drive?) and analyzing
thousands of samples a second rather than sending a character and
waiting for an ASCII response from an external microcontroller
indicating the RPM or frequency, then processing that for display. And
the drivers for the serial port under VB are easy to use. Or it could
be done with Labview very easily.
WinXP is not bad at all, actually it is the best OS out of Microsoft.

I have no problem using Windows, but shipping it as part of a product
is way too exciting for my tastes.

Best regards,
Spehro Pefhany
 
J

Jan Panteltje

Jan 1, 1970
0
Only if you do not know how to do it!

User-side Polling is a loosing design - you have to be on the Kernel side
and be interrupt driven. This is fairly easy on Linux, the source and the
build envronment being available and all that.

Linux has a real-time version - the commercial support is by Montavista -
which also have delivered the Kernel patches so you can roll your own. Some
of the patches are in the latest kernels - so if you can live with latacies
in the order of a millisecond or so, you do not have to do anything special.


There are *many ways round this* - the common PeeCee has several interfaces
which are interrupt driven and sitting on the Kernel side: The sound card is
obvious, the Game Port is another good choice, The Mouse Port - those mice
generate *a lot* of pulses moving across the surface which are counted to a
position - maybe there is a MIDI port? IRDA?

A *lot* of brute force can be brought to bear in a PC!

OK, but with a simple PIC you can make it a stand alone instrument,
as a LCD or LED 7 segment display, a battery and become a real greeny.
rs232 to the PC, and you do not have to modify the trojan virus Xp.

http://info.iet.unipi.it/~luigi/fmeter.asm

http://www.siliconchip.com.au/cms/A_30706/article.html

etc.
JP
 
J

Jan Panteltje

Jan 1, 1970
0
J

Jan Panteltje

Jan 1, 1970
0
On a sunny day (Thu, 03 Jun 2004 11:29:12 +0200) it happened Spajky
use fan MoBo header to do that (normally it can read Rpm as low as
600rpm (10/sec) after some minor circuitry (on my site I used under
electo/fan tacho w/o 3rd wire) added. But if really needed lower
readings, that would be a problem using that ... just an idea ...
Clever!
JP
 
F

Frithiof Andreas Jensen

Jan 1, 1970
0
You do have to deal with buffering (to hard drive?) and analyzing
thousands of samples a second

And....? It's not like that P4 in there is doing anything is it?

FFT the input and get it over with!
 
K

Ken Smith

Jan 1, 1970
0
Spehro Pefhany said:
I have no problem using Windows, but shipping it as part of a product
is way too exciting for my tastes.

I work or a company that sells products based on PCs. Almost all of our
customer service calls on those products are to do with the Microsoft
part.

Life has gotten much harder since the GUI took over. It is much easier to
tell someone what to type then explain to them what an icon is and what
double click means and then discribe the icon.
 
J

Jan Panteltje

Jan 1, 1970
0
On a sunny day (Thu, 3 Jun 2004 14:31:41 +0000 (UTC)) it happened
Life has gotten much harder since the GUI took over. It is much easier to
tell someone what to type then explain to them what an icon is and what
double click means and then discribe the icon.
WHISPER L I N U X COMMAND LINE F R E E
 
S

Spehro Pefhany

Jan 1, 1970
0
And....? It's not like that P4 in there is doing anything is it?

FFT the input and get it over with!

That's just obscene.

Best regards,
Spehro Pefhany
 
K

Ken Smith

Jan 1, 1970
0
WHISPER L I N U X COMMAND LINE F R E E

Unfortunately there is too much invested in going down the wrong path.
I've even suggest we go to Apples because under the GUI lives a good OS.
 
J

JeffM

Jan 1, 1970
0
WinXP is not bad at all, actually it is the best OS out of Microsoft.
Frithiof Andreas Jensen

That's like talking about *the best family car produced by Trabant*.
 
Y

YD

Jan 1, 1970
0
Not So Fast - What about the Sound Card?

Surely this will sample up to a bit beyond 20 KHz, it is there, the input is
protected and there are drivers for it so you do not have to write them!

WinXP is not bad at all, actually it is the best OS out of Microsoft.

http://www.dazyweblabs.com. There's a freeware frequency counter in
the download section.

- YD.
 
R

Rich Grise

Jan 1, 1970
0
Spehro Pefhany said:
That's just obscene.

Best regards,
Spehro Pefhany

LOL!

I'd like to see how _any_ of these schemes will give a readout
between, say, 0 and 1 Hz. ;-)

Cheers!
Rich
 
F

Frithiof Andreas Jensen

Jan 1, 1970
0
I'd like to see how _any_ of these schemes will give a readout
between, say, 0 and 1 Hz. ;-)

The Mouse Port would - and it is *easy* to grab mouse events user-side even
on Windows. One will need to use a filter so that one can discard mouse
events from the measurement from real mouse events - but this is just code,
eh ;-)

The way I see it, the Real Problem is that the OP wants do perform a
measurement task that requires interupt-driven "kernel-side" processing from
"user-land" - which the OP is not willing to do;

Hence the OP needs to go looking for a ready-made device in his PC that have
those characteristics.

It is also fun to rattle that cage on the Windows haters and the "Minimum
Ressouces" types by suggesting a pure brute-force scheme using windows,
possibly even VB to offend the programmers too ;-))
 
Top