I assume you are using an ADXL202 or something similar, as we use in our performance meters. I would recommend going with the CCP inputs. Connect one axis to one input, the other to the other input. Reset the timer value so you can get two measurements without overflowing (makes the sums easier) Set the first CCP input to trigger on a rising edge, store the value Set the first CCP to trigger on a falling edge, store the timer value Repeat for the second CCP input. Period is the length between the middles of the two CCP input pulses, and the width of each one divided by the period gives you the duration. You will need to calibrate each device for it's 0g position and 1g range to get a useful reading. The pulsewidths are such that you should have no problem in doing this as the pulses are never really short. DON'T measure the period as the time between the starts or ends of each pulse as that is not correct, it must be done to the middle. Hope that helps. Regards, Martin -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Agent0013 Sent: 24 October 2002 17:27 To: PICLIST@MITVMA.MIT.EDU Subject: [PIC]: Help with reading two PWM signals. I am somewhat new at using microcontrollers, but very experienced at programming and electronics. I am working on a senior design project for school and I either need to read in two pwm signals or two analog signals. This is coming from a two axis accelerometer from Analog Devices. I think I would prefer to read the pwm since it is already in a digital form and skip the A/D conversion. Would A/D be better than pwm? If reading pwm, how do I read the two separate signals and get their duty cycle of each? Do I use an interrupt? How do I interrupt on two separate signals? I read some on the list about the interrupt on change and that sounds like too much trouble. Or just poll the pins constantly until I read a change and then see how much time passed? As long as I am writing, any suggestions on which chip to use would be great also. Any help and suggestions on this would be greatly appreciated. Thanks, Justin Barth -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads