Re: hardware triggerable one-shot with 80c167
From: Gary Pace (____at____.com)
Date: Tue, 02 Mar 2004 05:17:22 GMT
Many ways I guess.
This is a bit rusty to me now, but if I remember correctly, you might want
to consider these ideas :
Idea 1 :
- Set one of the CAPCOM timers to clock from an external source.
- Connect a compare register to this clock, with a compare value of 1
- Set the timer to zero, waiting to count to 1 when the trigger event occurs
- The trigger event will immediately increment the count to 1 and set the
- In the ISR triggered by the compare event, set a new compare event to the
required time and set the timer to free run.
- When the new value is hit, the pulse will ne terminated and the ISR
- In the ISR, reset the registers to be waiting for a new trigger
It'd take a bit more thought if you needed the pulse to be re-triggerable.
It should be real easy to meet your timings with the above scheme - but be
careful about fitting the interrupts into your priority scheme.
Idea 2 :
Another way would be to set the trigger to compare mode, and PEC a timer
run value to a CAPCOM timer control register. You could then set a double
compare event to generate your output edges on a pin, use the interrupt on
the second compare event to run an ISR that disables and resets the timer.
This is maybe a better way.
There are certainly better ways to do this.
"Uwe Hercksen" <email@example.com> wrote in message
> the very old timer intel 8253 and 8254 could be used in mode 1 as a
> hardware triggerable one-shot with programmable pulse length.
> Now I am using the infineon 80c167 and need a one-shot with programmable
> pulse length and hardware triggering too.
> There are a lot of counters T1 to T8 and there is the Capture/Compare
> unit too, but I found nothing about one-shots in the user's manual.
> Some timers could be gated with external signals, but only with gate
> levels and not with gate edges (rising or falling)
> Any idea how to do this?
> I need a programmable pulse length of about 10 to 100 microseconds and
> the delay between hardware trigger and the leading edge of the pulse
> should be less than about 2 microseconds.
> Thanks a lot and bye