[2106] how to separate rising and falling interrupt

Started by renewebdyn August 28, 2009
HI,
I have a little problem.

I must count pulse on an input . The pulse is 50 milli second ,
pulse to 0, nornal voltage is 3.3V

I program T1CCR for produce an interrupt on falling edge AND rising egde.
How I can know if the interrupt has been made by falling or by rising edge.

I can't link the capture pin (P0_17) with a general IO, because the
hardware is terminated and I can't acces to the available pin IO.

Version Francaise:
j'ai programmmon T1CCR pour avoir une interruption pour le front montant et descendant de mon entr capture T1 ( pin P0_17)

j'ai bien les deux interruptions, mais comment derminer si elle vient du front montant ou du front descendant.
Je ne peux plus relier l'entr capture une entr IO disponible
car le pcb est fait , et pas question de mettre des fils sur la carte ...

J'ai essayde modifier dans l'interruption la valeur de T1CCR, pour decter en premier le front descendant, puis le front montant, mais ca merde grave. Et tout plante ....

Merci pour toute piste .
Renbr />

An Engineer's Guide to the LPC2100 Series

On Fri, 28 Aug 2009 08:40:27 -0000, you wrote:

>HI,
>I have a little problem.
>
>I must count pulse on an input . The pulse is 50 milli second ,
>pulse to 0, nornal voltage is 3.3V
>
>I program T1CCR for produce an interrupt on falling edge AND rising egde.
>How I can know if the interrupt has been made by falling or by rising edge.
>
>I can't link the capture pin (P0_17) with a general IO, because the
>hardware is terminated and I can't acces to the available pin IO.

Don't the pins still work as inputs when programmed as interrupt? ( I don't know the answer but try
it....)
If not, then just temporarily change the pin configuration within the interrupt routine.
polarity and change it on each interrupt.

What about using GPIO interrups. Here both rising and falling edge can be setup and you have interrupts flags telling which triggered the interrupt (see IO0IntStatR & IO0IntStatF).

But in general, don't the signal always alternate between rising and faling egde - or is it more than a single signal?

MR,
Mikkel

Ren

I am doing exactly what you said (for non french readers: capture
rising, then capture falling), on multiple timers and capture channels
with very good results on lpc21[34]?.

It seems like software playing up.
You said you are toggling the CCR bits in the ISR itself. Are you
toggling the right capture edge bits in the right way?

Hi:
T1CCR is the Timer Capture Control Register.
Timer Capture mode is used to capture the value of the Timer counter when the external event happens (either rising or falling or both edges) on the CAPx.x pin. Note that the Timer Counter should be driven by the internal PCLK.
Therefore, this function is useful to measure the lenght of a pulse.

If you are interested in counting number of pulses, you have to put the timer in counter mode (via register T1CTCR
, selecting the desired capture pin/edge).

Regards,

Alex
--- In l..., "renewebdyn" wrote:
>
> HI,
> I have a little problem.
>
> I must count pulse on an input . The pulse is 50 milli second ,
> pulse to 0, nornal voltage is 3.3V
>
> I program T1CCR for produce an interrupt on falling edge AND rising egde.
> How I can know if the interrupt has been made by falling or by rising edge.
>
> I can't link the capture pin (P0_17) with a general IO, because the
> hardware is terminated and I can't acces to the available pin IO.
>
> Version Francaise:
> j'ai programmmon T1CCR pour avoir une interruption pour le front montant et descendant de mon entr capture T1 ( pin P0_17)
>
> j'ai bien les deux interruptions, mais comment derminer si elle vient du front montant ou du front descendant.
> Je ne peux plus relier l'entr capture une entr IO disponible
> car le pcb est fait , et pas question de mettre des fils sur la carte ...
>
> J'ai essayde modifier dans l'interruption la valeur de T1CCR, pour decter en premier le front descendant, puis le front montant, mais ca merde grave. Et tout plante ....
>
> Merci pour toute piste .
> Renbr /> >