cancel
Showing results for 
Search instead for 
Did you mean: 

The digital input with interuppt gets a chatter signal

edv1
Associate II
Posted on November 19, 2007 at 08:09

The digital input with interuppt gets a chatter signal

5 REPLIES 5
edv1
Associate II
Posted on October 18, 2007 at 16:01

Hello,

I have a digital input with a interrupt. If the signal chatter the programm stopped. The signal is every 800 ns high. Are there to much interrupts to manage by the operating system? What can I do against the chattering?

fggnrc
Associate II
Posted on October 19, 2007 at 06:35

edv,

I think that you have posted to the wrong forum.

This forum if for 8 bit microcontrollers whose maximum clock frequency is 8 MHz, i.e. a clock period of 125 ns.

800ns / 125 ns is 6.4 clock cycles.

The interrupt processing takes 10 clock cycles to save registers plus the clocks cycles that are needed to complete the current instruction.

If your digital input flickers so much, it is better to filter it because the digital interrupt handling routine will be called forever and it will overwrite the stack.

EtaPhi

edv1
Associate II
Posted on October 19, 2007 at 07:09

Hello EtaPhi,

thank you for the answer. I don't think that I have posted in the wrong forum. I have a ST7. There are GAL's in the circuit which gives the clock puls for the digital input. It was not intended to put the signal at this input. It intersperse from another wire.

The time is too short for completing the interrupt. That explain EtaPhi. I have made tests with a counter of the interrupts, but this counter failed.

Bye,

edv

fggnrc
Associate II
Posted on October 19, 2007 at 09:57

My apologies, edv, for thinking you posted in the wrong forum as many STR7xx users did recently.

The interrupt counter can work with some advice.

When the interrupt handler routine runs, on some devices (e.g. ST7FLITEs) the other interrupt handlers are blocked (I Flag set) until the handler end. On some other devices (e.g. ST72xx) only the lower priority handlers are blocked, but the situation is the same: the interrupt handler runs, when it ends, the next handler is executed.

Even if the other interrupts are masked, the counter can't be read because the CPU is continuously servicing interrupts and has no time to respond to your requests.

Only if your ST7 has the nested interrupt feature, you can read the counter by an interrupt handler that has a higher priority than the one that services the external interrupts. On ST7LITEs, these interrupt sources have the higher priority (except reset and SWI), so timer handlers can't be used to sample the counter.

I hope I was clear...

Bye

EtaPhi

edv1
Associate II
Posted on November 19, 2007 at 08:09

Hi,

excuse me. I don't have activated the interrupt in the project. If an interrupt occurs, the programm was stopped with error.

With the right parametrization the programm works.