Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
pt:avr:external_interrupts [2015/11/30 17:34] articapt:avr:external_interrupts [2020/07/20 09:00] (current) – external edit 127.0.0.1
Line 1: Line 1:
 ====== Interrupções Externas ====== ====== Interrupções Externas ======
  
-External interrups are one of the most simple peripheral functionsTypically AVRs have to special pinswhich are used to cause interrupts in the program when their logical value changes or they are at a certain stateSince this function is usually used to monitor external logical signalsthese pins are called external interrupt pins.+As interrupções externas são das funções periféricas mais simples. AVRs típicos têm pinos especiaisque são utilizados para causar interrupções no programa quando o valor lógico destes muda ou quando se encontram num determinado estadoUma vez que esta função é normalmente usada para monitorar sinais lógicos externosestes pinos são designados como pinos de interrupção externos.
  
-To use an external interruptthe pin has to be configured as a standard IO input (it can also be used as an outputbut in this case the interrupt can only be created by the controller itself). It is necessary to allow receiving interrupts and specify the condition that causes the interrupt to fire in the external interrupt configuration registerThere are four possible conditions:+Para utilizar uma interrupção externao pino tem de ser configurado como uma entrada standard de IO (que também pode ser utilizada como uma saídamas, neste caso, a interrupção só pode ser criada pelo próprio controlador). É necessário permitir a recepção de interrupções e especificar a condição que causa a interrupção para disparar o registo de configuração de interrupção externaHá quatro condições possíveis:
  
-  * Logical zero (voltage of 0V) +  * De zero lógico (tensão de 0V). 
-  * Change in the logical value +  * Alteração do valor lógico. 
-  * Descending front logical change from one to zero. +  * Frente Decrescente mudança lógica de um para zero. 
-  * Rising front logical change from zero to one.+  * Frente Crescente mudança lógica de zero para um.
  
 +Quando o modo for definido para o zero lógico, a interrupção irá disparar continuamente enquanto o pino tem um valor de zero. Durante este período, a execução do programa principal é interrompida.
  
-When the mode is set to logical zerothe interrupt will fire continuously as long as the pin has value of zeroDuring this period the execution of the main program is stopped.+Agrupados por princípioexistem dois tipos de interrupção: as sincronizadas com o relógio do controlador e as assíncronas. As interrupções sincronizadas funcionam gravando os valores das entradas, o que significa que as mudanças nos valores lógicos são encontradas ao comparar os valores lidos durante dois ciclos de relógio diferentes. Se as mudanças lógicas no sinal acontecerem mais rapidamente do que ciclo de trabalho do controlador, as interrupções ou disparam incorretamente ou são ignoradas por completo. As interrupções assíncronas não dependem do relógio do controlador e permitem também detecção de mudanças mais rápidas no sinal externo - o nível lógico deve ser constante durante pelo menos 50 nsO ATmega128 tem 4 interrupções externas assíncronas e 4 síncronas.
  
-Grouped by principle, there are two types of interrupts: synchronized to the controller's clock and asynchronous. Synchronized interrupts work by remembering the values of the inputs, which means that the changes in logical values are found by comparing values read during two different clock cycles. If the logical changes in the signal happen faster than the controller's duty-cycle, the interrupts either fire incorrectly or are skipped altogether. Asynchronous interrupts do not depend on the controller's clock and enable detecting faster changes in the external signal as well - the logical level must still be constant for at least 50 ns. ATmega128 has 4 synchronized and 4 asynchronous external interrupts.+<pagebreak>
  
-~~PB~~ +<box 100% round #EEEEEE|Exemplo>
- +
-<box 100% round #EEEEEE|Example>+
  
 Task: Make ATmega128 pin number 9 (pin 7 on bus E) fire an interrupt if its value is changed. This pin corresponds to the INT7 external interrupt, which is synchronous. Task: Make ATmega128 pin number 9 (pin 7 on bus E) fire an interrupt if its value is changed. This pin corresponds to the INT7 external interrupt, which is synchronous.
Line 56: Line 55:
 </box> </box>
  
-In addition to interrupts fired by single pinsif the AVR has enough pins it is possible to use entire groups of pins to fire logical value change interruptsThese interrupts are simply called pin change interruptsThey fire when the value of at least one pin in the group is changed.+Além de interrupções disparadas por pinos individuaisse o AVR tem pinos suficientes, é possível usar grupos inteiros de pinos para disparar interrupções de mudança de valor lógicoEstas interrupções são simplesmente as chamadas interrupções de mudança de pinosEstas disparam quando o valor de pelo menos um pino no grupo é alterado.
pt/avr/external_interrupts.1448904877.txt.gz · Last modified: 2020/07/20 09:00 (external edit)
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0