Hi Every body,
I am a newbie and also do not know C programing. I want to make use of Arduino-uno board for a project.
I wanted to know whether any body could help me to do a simple program where i want to use of the Micro controller's binary counter for counting a pulse train for an input frequency 1 MHz. I have a TTL pulse whose ON time varies from 1 microsecond to 707 microsecond. So ultimately i need a system which counts total number of 500 ns (1 MHz with 50 % duty cycle) period pulses that lay within a variable ON pulse width of the input TTL signal. The Corresponding digital counts could be any number between 1 decimal (00-0000-0001) to 707 decimal(10-1100-0011). The value based up on the pulse width should remain latched on two digital ports since it involves 10 bits (2 bit + 8 bit). Next ON period shall only come no sooner than 2500 microseconds or it may even come after 10 seconds. Ultimately the system should respond only when it sees a pulse of the above said period else the last count should remain latched ON continuously.
Kindly also let me know if generating of 1 MHz pulse train can also be made using the same board because it uses 16 MHz clock. Else, I shall need to make a 1 MHz square wave generator. My feeling is that counter is an independent function and perhaps 1 MHz generation can be undertaken by using its timer / divider function otherwise I may have to put extra divider hardware. But If it is possible to use the same board then will it take some CPU time and hinder the precision of pulse period counting accuracy which is more important to me.
Lots of Thanks in Advance. ( My email id is zoompankaj@gmail.com for any clarification, I would appreciate if some body could help me on this)
Regards,
Pankaj