How instant are Instant Interupts?
New project, in the "Is this even possible?" stage.
Hardware is open to sugestion.
I need to send out a pulse of any of the following durations depending upon settings: 1, 3, 5, 10, 30, 50, 100, 1000, 3000, 5000, 10000uS.
I need a delay before the pulse is sent out of any of the following: 0, 20, 50, 100uS.
Trigger input is TTL 5V rising or falling edge, selectable.
I want to have a 2x8 LCD display and a few buttons to set up a menu to change and set all these options. On completion of saving the settings, a button can be preesed to activate and wait for an incoming pulse. That would be the main program.
I need high accuracy on the o/p pulse delay and duration as this is a strobe light application for high speed cameras running 10,000 plus frame rates per second.
Are Instant Interupts up to the task?
1 Attachment(s)
Keeping the thought alive
Here's an update for the last post.
Two 74HC86 XOR gates have been added to be able to invert the input and output polarities.
<img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=3300&stc=1&d=123889536 2" /><!-- Attachment 3300 -->
I see that you specified "Trigger input is TTL 5V rising or falling edge, selectable." in the first post.
I must have missed that part. :o
I could be diverging from what you want to do.
But the problem is intriguing, so I'm continuing onward ... thru the Fog. :)
I think the circuit above gives you all the capabilities you're looking for.
I did a quick pseudo-program to see what it would take for a simple test without interrupts, and it was surprisingly easy.
If you can settle on a PIC to use ... preferably 2-CCP's (1 for the FOSC4).
Could probably come up with something that's close.
I love shooting things ... with camera's.
OK, talk to me about timers
Part of this project is obviously timing.
Say I have a pulse coming in at between 50 and 200uS and I need to match this incoming pulse to an output. Not really a problem.
IF PORTA.0 = 1 THEN PORTA.1 = 1
But what if that incoming pulse is longer than the 200uS and the output must be shut off after a predetermined maximum, lets say 1000uS?
IF PORTA.0 = 1 THEN PORTA.1 = 1 no longer works. TMR0 has to be triggered at the same time as PORTA.1 goes high, then needs to count to a maximum of 1000uS and make PORTA.1 = 0.
PORTA.1 then must be kept low until PORTA.0 has gone low.
When PORTA.0 = 0 TMR0's flag can be reset and wait for PORTA.0 to go high again. If PORTA.0 has gone low before TMR0 has set the flag, it must be reset and ready to count to 1000uS.
Does this make sense?