Yes, Edson, that's what I meant. As the interrupt only occurs for a specific edge of the pulse (low-to-high or high-to-low), what the "capture" register measures is the time of a complete period, the low and the high parts of the signal together. As David mentioned, and as far as I know, you normally have one part of the period as a constant (the low or the high part, depends on the inversions on the signal path) and the other takes more or less time according to the bit being transmitted, but you can consider as just a variable period instead of trying to measure parts of the signal. Also, the start and stop bits have a different length as the ones and zeroes, just to let you know about the beginning and the end of the transmit sequence. Edson Brusque wrote: >Hello Francisco, > >>I use a PIC17C756 for several tasks, and one of them is IR remote >>control decoding, using a "capture" register: the signal from a 3 pin IR >>decoder is applied to a "capture" pin; a timer is set to count clock >>pulses; when a specific edge reaches this pin, the contents of the >>counter is transferred to a special "capture" register and an interrupt >>is generated; on this ISR I just check the contents of this register and >>subtract it from the last one: this is proportional to the period of the >>signal (normally you have at least one start bit just for initializing >>registers, and then you have one defined period for "1" and another for >>"0" in a pulse sequence of one or more bytes, and normally a stop bit, >>just to check if the bit count is OK). >> > > I think if would be simpler to use capture to measure the space (time >duration) between two LOW pulses. If it's about 3mS (2.4mS LOW + 0.6 HIGH) >it's an "start", 1.8mS (1.2 + 0.6) and you have a '1', 1.2mS (0.6 + 0.6) and >you have a '0'. > > Mmmm, isn't this just what you mean? > > Best regards, > > Brusque > >----------------------------------- >Edson Brusque >Research and Development >C.I.Tronics Lighting Designers Ltda >Blumenau - SC - Brazil >www.citronics.com.br >----------------------------------- > >-- >http://www.piclist.com hint: To leave the PICList >mailto:piclist-unsubscribe-request@mitvma.mit.edu > > > > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu