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:adc [2015/12/01 11:29] articapt:avr:adc [2020/07/20 09:00] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Conversor Analógico-Digital ======+====== Conversor Analógico-para-Digital ======
  
-Analog-to-digital converter (ADC) transforms an analog voltage value to a digital valueThe allowed voltage range on an ADC input of an AVR microcontroller is to 5.5 V. The size of the digital value is 10 bitsbut its precision is ±2 unitsThe error may be even largerif the microcontroller's supply voltage is not protected from interference. AVR has a separate voltage supply and comparison voltage pin for ADC. The separate supply voltage helps to cut down the interference and it may not differ more than 0.3 V from the main supply voltageComparison voltage defines the maximum digital valueFor exampleif the comparison voltage is 3 V then an input with the same voltage will read as 2<sup>10</sup> - 1 (1023).+Um conversor Analógico-para-Digital (ADC) transforma um valor analógico de voltagem num valor digital. Os limites para a tensão permitida numa entrada ADC do microcontrolador AVR são 0-5,5 V. O número de bits do valor digital é de 10, e a sua precisão é de ± 2 unidadesO erro pode ser ainda maiorse a tensão de alimentação do microcontrolador não estiver protegida de qualquer interferênciaAVR tem um pinos de tensão de alimentação e de tensão de comparação separados para o ADC. A tensão de alimentação separada ajuda a reduzir a interferência e pode não diferir mais de 0,3 V da tensão principal de alimentaçãoA comparação das tensões define o valor digital máximoPor exemplose a tensão de comparação é de 3 V, então uma entrada com a mesma tensão vai ser lida como 2<sup>10</sup> - 1 (1023).
  
-AVR ADC works on the principal of successive approximationIn shortthe measured voltage is compared to specific voltage levels and the results are reported as bit arrayThis method is relatively slowas each bit in the final result is calculated separately. AVR spends 13 clock cycles for each measuringexcept the first (on start-up), which takes 25 cyclesThese cycles are not the controller's duty cycles thoughbut instead special cycles allocated to the ADC unit by the frequency dividerThe ADC frequency should be 50-200 kHz to achieve maximum precision, on higher frequencies the precision fadesIn some cases it is more important to get large number of readings instead of maximum precisionin which case using a larger frequency is totally justifiedAccording to AVR documentationone measuring takes 13-260 µs.+Um AVR ADC funciona segundo o princípio de aproximação sucessivaEm suma, a tensão medida é comparada com os níveis específicos de voltagem e os resultados são reportados como uma matriz de bitsEste método é relativamente lentopois cada bit no resultado final é calculado separadamenteAVR gasta 13 ciclos de relógio para cada mediçãocom excepção do primeiro (no start-up), no qual consome 25 ciclosEsses ciclos não são os ciclos de funcionamento do controladorporém, mas ciclos especiais atribuídos à unidade ADC pelo divisor de frequênciaA freqüência do ADC deve ser 50-200 kHz para permitir a máxima precisãoEm freqüências mais altas precisão decai. Em alguns casosé muito mais importante obter um grande número de leituras em vez de uma maior precisão, sendo neste caso o uso de uma frequência maior totalmente justificadoDe acordo com a documentação do AVR, uma medição leva 13-260 µs.
  
-The measured value can be read as an 8- or 10-bit valueSince AVR itself is an 8-bit deviceit has two 8-bit registers for storing the ADC valuesIt is possible to specify in the settings whether the first two or the last two bits go to a separate registerIf the two younger bits, which characterize the result lessare separatedthe result can be read as an 8-bit value - a combination like that is called a left-aligned resultThe other combinationwhere both registers are read and the value is in 10-bit formatis called a right-aligned result.+O valor medido pode ser lido como um valor de ou 10-bitsComo o próprio AVR é um dispositivo de bitstem dois registos de bits para armazenar os valores do ADC. É possível especificar nas configurações se os dois primeiros ou os últimos dois bits vão para um registo separadoSe os dois bits menos significativosque caracterizam o resultadosão separadoso resultado pode ser lido como um valor de bits uma combinação como essa é designada de resultado alinhado à esquerdaA outra combinaçãoem que ambos os registos são lidos e o valor está formatado em 10-bitsé designada de resultado alinhado à direita.
  
-A typical AVR has analog voltage input channels, ATtiny series have only a fewsome ATmega devices have 16, but there is always only one converterTo make it possible to use different inputs, the device has built-in multiplexerThe input of the multiplexer is definable using a special registerThe ADC unit has a few more propertiesusing the processor's sleep mode for converting to reduce the interference and the option to use an internal fixed comparison voltage (usually 2.65 V, in some models 1 V).+Um AVR típico tem canais de entrada de tensão analógica. A série ATtiny tem apenas algunse alguns dispositivos ATmega têm 16, mas há sempre um único conversorPara tornar possível utilização de diferentes entradas, o dispositivo tem um multiplexador embutidoA entrada do multiplexador é definida através de um registo especialA unidade ADC tem mais algumas propriedadesusando o modo de suspensão do processador para converter para reduzir a interferência e a opção de usar uma tensão de comparação fixa interna (normalmente 2,65 V, em alguns modelos 1 V).
  
-~~PB~~+<pagebreak>
  
-<box 100% round #EEEEEE|Example>+<box 100% round #EEEEEE|Exemplo>
  
 Task: measure the voltage in ADC channel 3 of an ATmega128. The voltage is in range of 0-5 V and the result should be at 8-bit precision. Task: measure the voltage in ADC channel 3 of an ATmega128. The voltage is in range of 0-5 V and the result should be at 8-bit precision.
pt/avr/adc.1448969392.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