View previous topic :: View next topic |
Author |
Message |
aldinlapinig
Joined: 16 Dec 2005 Posts: 22
|
Determining Pulse Width with 18f84 |
Posted: Thu Mar 16, 2006 8:07 pm |
|
|
Hi everyone,
I want to determine the Pulse Width of a signal from a modulator to the PIC. Can anybody give me an idea on how I could do it with 18f84? Thank u so much...
kind regards,
-=alDin=- |
|
|
PICoHolic
Joined: 04 Jan 2005 Posts: 224
|
|
Posted: Fri Mar 17, 2006 6:37 am |
|
|
Do u mean 16F84 ?
Anyway, here's my suggestion:
Connect your signal to the external interrupt of the PIC (RB0).
1st configure the interrupt from Low to high
Once you get an interrupt, clear a timer and start counting and reconfigure your interrupt for high to low.
When you get a second interrupt, your pulse width will be held in your timer. Then reconfigure your interrupt to low to high... and so on...
Good Luck |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
|
aldinlapinig
Joined: 16 Dec 2005 Posts: 22
|
crc_xmodem... |
Posted: Sat Mar 18, 2006 8:29 pm |
|
|
thanx for the immediate response man.. It'll help a lot. I wud like to ask u again. do u have any idea on how to generate the CRC-XMODEM checksum? I'm trying to interface an RFID reader module (TI product) with 18f877a. They'r using CRC-XMODEM algorithm (poly = 0x8408) for their data CRC. I tried to use CRC.C (of CCSC) but the pattern available for generating 16-bit CRC is only 0x1021 (CRC-CCITT). Any idea on how I cud modify the driver to fit my needs or write another driver? Any help will be highly appreciated. Thanx everyone!
-=alDin=- |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
|
|