cancel
Showing results for 
Search instead for 
Did you mean: 

Input Capture and edge triggered interrupts

fggnrc
Associate II
Posted on April 24, 2006 at 02:26

Input Capture and edge triggered interrupts

9 REPLIES 9
fggnrc
Associate II
Posted on June 20, 2005 at 09:26

Dear ST7 gurus,

I have a question for you.

Is it possible to have edge triggered interrupts on the same pin whose alternate function is input capture?

As regards ST7FLITE2x family, I mean: can PA1 be configured as pull-up input with interrupt and handle *both* the external interrupt service routine (thru EI0 vector) and input capture?

The ST7FLITE2x documentation (page 46 of rev. 3.0 datasheet) says NO as it would cause power consumption and spurious interrupts, but is it true?

In my intended use (start bit detection of a SW UART and BREAK character duration calculation) it seems OK to have both interrupts. Their priorities (first EI0, then ATIC) is also the right choice for my application...

Thank you in advance

EtaPhi

alok2
Associate II
Posted on June 23, 2005 at 11:21

It seems to me that what you want to implement shall be possible.

The power consumption note in datasheet shall be linked to analog inputs shared with AF. FOr 2 inputs both digital, it shall be no problems.

i m not a guru ;-)),

fggnrc
Associate II
Posted on June 24, 2005 at 05:07

Thank you alok for the reply.

I agree with you: the alternate function (ATIC) and digital input may be used at the same time.

I think that the spurious interrupt warning is linked to what happens when the configuration of the input changes.

In my application, PA1 will be wired to the RS485 driver and receiver, so it will be configured for the most time as input, while the micro will have to reply, PA1 will be configured as output.

During this switch the spurious ATIC interrupts can arise, but this is not a problem for me, since then ATIC interrupts will be disabled.

EtaPhi

alok2
Associate II
Posted on June 24, 2005 at 09:16

In your application it shall work. Did you try already ?

fggnrc
Associate II
Posted on June 24, 2005 at 14:08

Not yet, Alok.

I am still in the coding and software simulation phase, since I have to code both the RS485 master and slave.

Bye.

EtaPhi

fggnrc
Associate II
Posted on April 19, 2006 at 13:39

Now I have the first prototype and results.

The idea (e.g. use both the alternate funcion and the digital input on the same pin) works.

However, there is a little difference between the ST7FLITE29 and ST7FLITE39 external interrupt handling.

The configuration of both micro is the same: EI0 is triggered on falling edges (EICR bits IS01=1 IS00=0) and linked to PA1 (EISR bits EI01=0 EI00=1).

As regards the ST7FLITE29, BRES PAOR,#1 disables the EI0 interrupt source which is linked to PA1.

The same does not work on the ST7FLITE39. Even if I reset PAOR bit #1 in the EI0 interrupt handler code, the silicon keeps on triggering interrupts when a falling edge is detected on PA1.

To disable the EI0 interrupt source I have to change EISR bits EI01=0 EI00=0 which breaks the link to PA1. BTW this not works for ST7FLITE29 since it links EI0 to PA0.

EtaPhi

info45
Associate II
Posted on April 22, 2006 at 19:37

Hy Eta Phi,

my proposess are:

1- use lite39 that have hw sci

2- use input capture with change of edge every interrupt: this have the limit for maximum baud rate but work well.

By

info45
Associate II
Posted on April 22, 2006 at 19:38

Hy Eta Phi,

my proposess are:

1- use lite39 that have hw sci

2- use input capture with change of edge every interrupt: this have the limit for maximum baud rate but work well.

By

fggnrc
Associate II
Posted on April 24, 2006 at 02:26

Thank you, franzb, for your advices.

The ST7FLITE39 I choose about a year ago has however to bridge a RS485 network to a PC by means of a RS232 link.

I need therefore two SCI...

The software SCI I wrote for the ST7FLITE29 is therefore very useful because it does not only handle the communication, but also the timeouts of my protocol and the break signal I use to adjust on-the-fly the RC oscillator of the devices that are attached to the RS485 network.

I posted this updated information to stress that ST7FLITE2x and ST7FLITE3x are similar devices BUT ARE NOT INTERCHANGEABLE as the oscilloscope showed me.

That'a all...

EtaPhi