logo elektroda
logo elektroda
X
logo elektroda
REKLAMA
REKLAMA
Adblock/uBlockOrigin/AdGuard mogą powodować znikanie niektórych postów z powodu nowej reguły.

Atmega 328p - ADC - wyniki 1023 lub 0 przy pomiarze napięcia, co sprawdzić?

16 Sie 2013 00:53 2817 8
REKLAMA
  • #1 12632920
    Konto nie istnieje
    Konto nie istnieje  
  • REKLAMA
  • #2 12633091
    Konto nie istnieje
    Poziom 1  
  • REKLAMA
  • #3 12633577
    tmf
    VIP Zasłużony dla elektroda
    A jak podawane jest napięcie Vcc do pomiaru na wejście ADC5? Przez dzielnik? Bo jeśli zasilasz ATMegę z 5V i to 5V podajesz bezpośrednio na ADC, to przy VRef równym 2,56V otrzymasz wynik 1023.
  • REKLAMA
  • #4 12633665
    piotrva
    VIP Zasłużony dla elektroda
    1. Pokaż schemat
    2. Uruchamiaj ADC PO ustawieniu presklaera - NIGDY PRZED.
  • REKLAMA
  • #5 12635029
    Konto nie istnieje
    Konto nie istnieje  
  • #6 12635272
    piotrva
    VIP Zasłużony dla elektroda
    Nie lubię się powtarzać:
    piotrva napisał:
    1. Pokaż schemat

    Jak nie masz to narysuj, zmiana AREF w zależności od zmiany kondensatora między tą nogą a GND sugeruje poważny problem z hardware - może niepodłączone AVCC?
    Ale skąd mamy wiedzieć, skoro tylko wróżka wie jak masz to połączone?
  • #7 12635324
    michalko12
    Specjalista - Mikrokontrolery
    lubelaczek napisał:
    Tylko... czemu Aref = 1.08V ? Mój model ma taką specyfikę, czy coś popsułem ?


    Nie popsułeś tylko nie doczytałeś.

    Cytat:
    23.5.2 ADC Voltage Reference
    The reference voltage for the ADC (VREF) indicates the conversion range for the ADC. Single
    ended channels that exceed VREF will result in codes close to 0x3FF. VREF can be selected as
    either AVCC, internal 1.1V reference, or external AREF pin.
    AVCC is connected to the ADC through a passive switch. The internal 1.1V reference is generated
    from the internal bandgap reference (VBG) through an internal amplifier. In either case, the
    external AREF pin is directly connected to the ADC, and the reference voltage can be made
    more immune to noise by connecting a capacitor between the AREF pin and ground. VREF can
    also be measured at the AREF pin with a high impedance voltmeter. Note that VREF is a high
    impedance source, and only a capacitive load should be connected in a system.
    If the user has a fixed voltage source connected to the AREF pin, the user may not use the other
    reference voltage options in the application, as they will be shorted to the external voltage. If no
    external voltage is applied to the AREF pin, the user may switch between AVCC and 1.1V as reference
    selection. The first ADC conversion result after switching reference voltage source may
    be inaccurate, and the user is advised to discard this result.
  • #8 12635821
    Konto nie istnieje
    Poziom 1  
  • #9 12637296
    Konto nie istnieje
    Konto nie istnieje  
REKLAMA