Hi All, I think that PIC16F877 may be easily used to build a digital oscilloscope with "random repetitive sampling" (well, with ca. 200 kps it can be usefull only for hobbyists...). However I've some doubts. I can generate the waveform driving the external S/H, using the PWM module. The position of TRIG pulse may be found with CCP module. However AFAIK there is no way to have CCP & PWM working with the same timer. Am I wrong? If not - I should use two timers running synchronously, but I can not start them synchronously. Probably it is possible to compensate the delay, writing different values to both counters. (I'll try to ilustrate it with the pseudocode below). timer1 = 0 timer2 = comp_val GIE=0 enable_timer1 enable_timer2 Does anybody can share his experience with such problems? Is it supposed to work? Another solution could be driving both timers from external gated clock. Additionally I'd like to position the TRIG pulse with higher precision using the time/voltage converter, or time expander circuit. However for this purpose I'd need to output the waveform driving both timers. At the moment I don't see such possibility... so maybe the external gated clock is the right solution, but it destroys the simplicity of the design... I'd appreciate any suggestions. I think that such Open Source/Open Hardware design would be usefull for all of us ;-). -- TIA & Greetings Wojciech M. Zabolotny http://www.ise.pw.edu.pl/~wzab <--> wzab@ise.pw.edu.pl http://www.debian.org Use Linux - save your data and time -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics