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

[off topic] timstamping edges of multliple square waves

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



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

[off topic] timstamping edges of multliple square waves
PostPosted: Wed Apr 22, 2015 3:14 pm     Reply with quote

Hey guys,

I am searching for a clever solution to timestamp edges of 16 square waves.

Do you know a good circuit or trick?

Thank you.
Gabriel



Joined: 03 Aug 2009
Posts: 1067
Location: Panama

View user's profile Send private message

PostPosted: Wed Apr 22, 2015 4:06 pm     Reply with quote

what is the frequency?

since you are saying time stamp im assuming its a sloooow frequency.

what kind of stamp... year, month, day, hour minutes, seconds, or only time from the first rising edge?

more details.
_________________
CCS PCM 5.078 & CCS PCH 5.093
temtronic



Joined: 01 Jul 2010
Posts: 9202
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Apr 22, 2015 4:20 pm     Reply with quote

one simple method is to have the 'square wave' rising edge trigger an interrupt. The ISR read an RTC for time stamp data places it into a buffer.

As long as the pulse are more than 1ms apart, it'll work fine.

To get better resolution you could just read one of the PICs timers and get microsecond results. Same idea works.

Jay
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PostPosted: Wed Apr 22, 2015 5:57 pm     Reply with quote

I need 1uS resolution for frequencies up to 20khz. It is not simple to do without additional hardware.
Ttelmah



Joined: 11 Mar 2010
Posts: 19447

View user's profile Send private message

PostPosted: Thu Apr 23, 2015 5:22 am     Reply with quote

Several of the larger PIC's can record times for this many edges. Look at chips like the the PIC24EP512MU814. There are about a dozen chips with this many capture modules.
future



Joined: 14 May 2004
Posts: 330

View user's profile Send private message

PostPosted: Thu Apr 23, 2015 10:08 am     Reply with quote

Found the PIC24EP512GU814. It says 16 OC + 16 IC. MC always have always shared IC/OC modules.. Did I really see 32 modules?
Ttelmah



Joined: 11 Mar 2010
Posts: 19447

View user's profile Send private message

PostPosted: Thu Apr 23, 2015 10:22 am     Reply with quote

On the PIC24's, the modules are always separate. 'Input capture', and separately 'output compare'. Different sections in the data sheets.
For this chip there are 16 16bit input capture modules, which is what you were after. The output compare modules are for generating PWM's etc..
Get hold of section 34 of the family reference manual.
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