2006-04-23 05:26 PM
Input Capture and edge triggered interrupts
2005-06-20 12:26 AM
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 EtaPhi2005-06-23 02:21 AM
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 ;-)),2005-06-23 08:07 PM
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. EtaPhi2005-06-24 12:16 AM
In your application it shall work. Did you try already ?
2005-06-24 05:08 AM
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. EtaPhi2006-04-19 04:39 AM
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. EtaPhi2006-04-22 10:37 AM
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. By2006-04-22 10:38 AM
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. By2006-04-23 05:26 PM
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