| | |
Counting TTL Input signals
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Nov 2006
Posts: 7
Reputation:
Solved Threads: 0
Hi,
I need to write a counter code to count the number of spikes in the TTL logic input signal... What should I take as an input... Can i write it normally by putting the count in an infinite loop like
while(1)
// increment count
exit(1)
something like this... or is there a different way of doing this.
J
I need to write a counter code to count the number of spikes in the TTL logic input signal... What should I take as an input... Can i write it normally by putting the count in an infinite loop like
while(1)
// increment count
exit(1)
something like this... or is there a different way of doing this.
J
•
•
•
•
Hi,
I need to write a counter code to count the number of spikes in the TTL logic input signal... What should I take as an input... Can i write it normally by putting the count in an infinite loop like
while(1)
// increment count
exit(1)
something like this... or is there a different way of doing this.
J
*Voted best profile in the world*
•
•
Join Date: Nov 2006
Posts: 7
Reputation:
Solved Threads: 0
•
•
•
•
What has your instructor or teacher advised you to do? Do you have any notes.
Suppose a pulse generator gives out signals as a stream and we need to count the numberr of pulses... then how do we do that.
I would suppose it depends on how the pulse generator is sending the signals -- out its RS232 serial port ? If that is the case you will have to attach an rs232 serial cable to your com1 or com2 port and listen for incoming data on the computer side. Most likely it will be just a change in state of one of the pins instead of incoming data. Its been over 10 years since the last time I have done that so I would have to research some very old code, if I still have it, to see how that is done. One thing for certain, you will need a 16-bit compiler such as Turbo C that will allow direct access to ports. You might also need to do a little assembly language.
Last edited by Ancient Dragon; Nov 6th, 2006 at 3:36 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
•
•
•
•
Suppose a pulse generator gives out signals as a stream and we need to count the numberr of pulses... then how do we do that.
simulating data capture should be easy - just read some data of your choice from the keyboard, and process it bit by bit as the pulses are read (the usual choice for representing digital input such as electromagnetic pulses is 1 and 0, but you could use anything)
A loop would be useful for determining when data capture is finished. You could use selection (eg - if/else) to determine whether the input is "on" or "off".
If there is a real device which you're reading from, then it still may be a good idea to start your program with simulated keyboard input where you are controlling the input - this means you can get that part right before you attempt to combine it with your real data capture code.
Last edited by Bench; Nov 6th, 2006 at 3:44 pm.
¿umop apisdn upside down? •
•
Join Date: Nov 2006
Posts: 7
Reputation:
Solved Threads: 0
I am simulating the input using the Pulse Generator. The actual input will be from some other source. When I fix the pulse generator the computer has to start counting the number of pulses. How do I do this? Firstlyy the system has to detect the start of the pulse and then it has to count until the stream is stopped. The number of pulses has to be given as the output. What is a way to doing this. Can this be done usng a count program or is there any other way?
is the pulse generator going to actually send data to the computer or just change the state of one of its 32 pins to on and off ?
Please read this site
Please read this site
Last edited by Ancient Dragon; Nov 6th, 2006 at 6:42 pm.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
![]() |
Other Threads in the C++ Forum
- Previous Thread: longest hailstone sequence
- Next Thread: Debugging Tips:
| Thread Tools | Search this Thread |
api array arrays beginner binary bitmap c++ c/c++ calculator char char* class classes coding compile compiler console conversion convert count data database delete desktop developer directshow dll dynamiccharacterarray email encryption error file forms fstream function functions game generator getline google graph homeworkhelper iamthwee ifstream input int integer java lib linkedlist linux list loop looping loops map math matrix memory multiple news node number numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct template templates test text tree unix url vector video visualstudio win32 windows winsock word wordfrequency wxwidgets






