View previous topic :: View next topic |
Author |
Message |
future
Joined: 14 May 2004 Posts: 330
|
[off topic] timstamping edges of multliple square waves |
Posted: Wed Apr 22, 2015 3:14 pm |
|
|
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
|
|
Posted: Wed Apr 22, 2015 4:06 pm |
|
|
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: 9245 Location: Greensville,Ontario
|
|
Posted: Wed Apr 22, 2015 4:20 pm |
|
|
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
|
|
Posted: Wed Apr 22, 2015 5:57 pm |
|
|
I need 1uS resolution for frequencies up to 20khz. It is not simple to do without additional hardware. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19545
|
|
Posted: Thu Apr 23, 2015 5:22 am |
|
|
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
|
|
Posted: Thu Apr 23, 2015 10:08 am |
|
|
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: 19545
|
|
Posted: Thu Apr 23, 2015 10:22 am |
|
|
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. |
|
|
|