Do you have a question? Post it now! No Registration Necessary
Subject
- Posted on
Can I
- 08-11-2006

Re: Can I

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

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 :)
Site Timeline
- » PICs
- — Next thread in » Electronics Down Under
-
- » Looking For I/O Card Solution
- — Previous thread in » Electronics Down Under
-
- » Aussies Love EVs ?
- — Newest thread in » Electronics Down Under
-
- » Alexa spegne ma non accende
- — The site's Newest Thread. Posted in » Electronics Hobby (Italian)
-