Have a closer look at the pluses as they come from the receiver. I think that you will find that they come sequentially based on channel number, rather than randomly overlapping or simultaneously. Knowing that will make the job a lot easier. Regards, Gordon Williams ----- Original Message ----- From: "Martin" To: "Microcontroller discussion list - Public." Sent: Wednesday, January 16, 2008 2:37 PM Subject: [PIC] measuring pulse widths : Imagine that you want to measure 4 "RC" PWM signals, standard being : about 1mS to 2mS at 50 Hz (IIRC) : You want 8 bit accuracy so that leaves you with 1mS/256 = 4uS resolution. : There are a few schemes I can think of to achieve this, but I don't : think any are particularly good: : : 1. Polling - have a running timer and poll input pins. Resolution will : suffer so you will probably have to average several measurements to : (hopefully) get a good result. You won't really be able to do anything : else with your PIC. : 2. Interrupt on change - your interrupt code runs and checks the pins : when one changes. Chaos results when pins change within uS of each other : and the interrupt code is still executing. : 3. Capture - probably the correct way to do this (pin interrupt stops : timer). The problem is that I can't imagine there being a chip with 4 : such CCP inputs : : How would you do it without a lot of external logic? : : De-mux into a capture pin maybe? : I'd lose f/n resolution: 50/4 = 12.5 samples per second, maybe that's : good enough. Then I'd want to add edge triggering to ensure that I don't : capture half-pulses, meaning more external logic. : - : Martin : -- : http://www.piclist.com PIC/SX FAQ & list archive : View/change your membership options at : http://mailman.mit.edu/mailman/listinfo/piclist : -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist