|
|
View previous topic :: View next topic |
Author |
Message |
dax_32 Guest
|
Event detector in nsec range |
Posted: Tue Feb 09, 2010 5:04 am |
|
|
Dear all,
I'm designing a new project where I need a PIC microcontroller connected to two digital lines. When first line gets high I activate a flag that must be active during the following second. If during this time the second line gets also high, I have to activate an alarm. This doesn't look really difficult, and although I'm not an experimented programmer I think I can implement it easily with interruptions.
My problem comes when looking at the minimum time between digital line changes. At the worst case, I could have 95 nsec time difference between activation of the first and the second line, and I don't know if I can implement this solution with any of the development boards provided by CCS. I guess that the fastest board is the PIC24F with 8 MHz clock that provides 125 nsec time for every clock tick, being slow for my application.
Is there any way to improve or implement this?
If not I'll have to move to another solution and I'd like to prefer to stay with CCS HW&SW.
Thanks and regards |
|
|
Ttelmah Guest
|
|
Posted: Tue Feb 09, 2010 5:34 am |
|
|
Seriously, you need to add hardware.
Even a processor running with a clock cycle down in the 10nSec range, could have problems with this. Imaging you are sitting 'waiting' for the input to change. This in itself involves looping (usually at least a couple of instruction times), and testing (another). It then has to advance to another similar loop, and start looking for the other bit. More instructions.
This is "child's play" in logic. Just have a flip-flop, 'set' by the first line, which routes the second line to another flip-flop. If the output of this gets 'set', then the second signal has come as required. Clear it via a timer (or a processor).
You could devlop the timing, and the detection of the second signal, with a PIC, by having the flip-flop as already described, but routing it's output, to the CTC input of a PIC.
In all honesty, it is far easier to do with a couple of logic IC's, or a FPGA, and more likely to work in the timescales you require...
Best Wishes |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Feb 09, 2010 1:42 pm |
|
|
Tell us what chip is supplying these two signals to your PIC.
Are these signals part of some communications protocol ?
If so, describe it or a post a link to the specification for it. |
|
|
|
|
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
|