EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

hardware triggerable one-shot with 80c167

Started by Uwe Hercksen March 1, 2004
Hello,

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

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
output
- 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
entered again.
- 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" <hercksen@mew.uni-erlangen.de> wrote in message
news:404339BB.8000602@mew.uni-erlangen.de...
> Hello, > > 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 >

Gary Pace schrieb:
> 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 > output > - 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 > entered again. > - 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. >
Hello, thanks a lot Gary for the ideas. I don't need retriggerable pulses. It was very inspiring to mee. Bye
I would probably use PWM channel 2 or 3 in single shot mode.  You still need
to use an interrupt from the trigger pulse to start the PWM, so the worst
case delay from the trigger pulse to the output depends on the interrupt
priority and any time you have the interrupts globally disabled.  Since the
interrupt service is very simple - just set the PWM run bit - you can assign
it to the highest priority.  The PWM:s also have a good resolution.

Sauli

"Uwe Hercksen" <hercksen@mew.uni-erlangen.de> wrote in message
news:404339BB.8000602@mew.uni-erlangen.de...
> Hello, > > 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 >

The 2024 Embedded Online Conference