Can I

Do you have a question? Post it now! No Registration Necessary

Translate This Thread From English to

Threaded View


Hi ,

I designed a pulse generator which operate exactly the same way old
computer mouse mechanism works. (IR emmiter-sensor )
the requirment is to count number of pulse from A to D converter.
Is this possible with PWM and low pass filter arrangment ?

Thanks in advance.


Re: Can I


Quoted text here. Click to load it

that seems a little unclear...

I think you'd need more an integrator than a LPF.


Bye.
   Jasen

Re: Can I


ok. All i want is to interface this pulse generator output into a
ADC0809 to get the digital output in order to read from parallel port.

there are many options around but this is the way to be implemented.

hope u will be able to help me this time.

jasen wrote:
Quoted text here. Click to load it


Re: Can I


Quoted text here. Click to load it

Then it is a very silly and convoluted way to implement it. This method
will be very inaccurate, almost certainly not accurate enough to count
the actual number of pulses, where I assume you don't want even a +/-1
count error?
What frequency are you talking about anyway?

You already have a "digital" output, so you are much better off simply
feeding the pulses straight into the parallel port as a digital signal.
Should be able to count pulses up to at least a few hundred KHz this
way, with zero error.

Forget the ADC, you are barking up the wrong tree.

Dave :)


Re: Can I


Alright :-x

Thanks for the ideas.
I will search a way to feed the pulse into LPT leaving the ADC aside.




David L. Jones wrote:
Quoted text here. Click to load it


Re: Can I


Quoted text here. Click to load it

Simple, if your signal is already TTL level then connect to the LPT
port with a bit of wire ;-)
One line of code will read if it's high or low.
A few more lines of code will count your pulses.
Couldn't possibly be any easier.

Dave :)


Re: Can I


could you please explain that a bit.
Normally, LPT can read parallel data not serial.
Am i right ? so how can i use LPT for reading number pf pulses ?

pls enlighten me .


David L. Jones wrote:
Quoted text here. Click to load it


Re: Can I


Quoted text here. Click to load it

Think of an 8bit parallel bus as being made up of 8 seperate 1bit
serial lines. There is essentially no difference.
So your parallel port is capable of reading 8 (more actually, as there
are a few other input pins too) serial data inputs.

Just feed your TTL signal into (for example) the D0 pin and tie the
rest to ground.
Then your code is simply:

Start Loop
   Read data from port
   While data=0
      Read data from port
   Repeat
   While data=1
      Read data from port
   Repeat
   Count=Count+1
End Loop

Plus you'll need a timer or some other way to break out of the loop of
course.

To read the data port in say QuickBASIC you'd use the code (from my
rusty memory):
data=INP(&H378)

Dave :)


Re: Can I


could you please explain that a bit.
Normally, LPT can read parallel data not serial.
Am i right ? so how can i use LPT for reading number of pulses ?

pls enlighten me .


David L. Jones wrote:
Quoted text here. Click to load it


Site Timeline