CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Determining Pulse Width with 18f84

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
aldinlapinig



Joined: 16 Dec 2005
Posts: 22

View user's profile Send private message

Determining Pulse Width with 18f84
PostPosted: Thu Mar 16, 2006 8:07 pm     Reply with quote

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=- Smile
PICoHolic



Joined: 04 Jan 2005
Posts: 224

View user's profile Send private message

PostPosted: Fri Mar 17, 2006 6:37 am     Reply with quote

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

View user's profile Send private message

PostPosted: Fri Mar 17, 2006 11:30 am     Reply with quote

Quote:

I want to determine the Pulse Width of a signal from a modulator to the PIC.


The best info regarding this issue you can find it in:
http://ww1.microchip.com/downloads/en/devicedoc/41214a.pdf


Humberto
aldinlapinig



Joined: 16 Dec 2005
Posts: 22

View user's profile Send private message

crc_xmodem...
PostPosted: Sat Mar 18, 2006 8:29 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Mar 19, 2006 9:42 am     Reply with quote

This is a complete XMODEM CRC Protocol calculation posted by
J. Winpenny and for C2C compiler:

http://web.ukonline.co.uk/j.winpenny/pic/txrxmod.txt

Humberto
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group