Koda: |
AREF:
AREF is the analog reference pin for the A/D Converter. Operation: The ADC converts an analog input voltage to a 10-bit digital value through successive approximation. The minimum value represents GND and the maximum value represents the voltage on the AREF pin minus 1 LSB. Optionally, AVCC or an internal 2.56V reference voltage may be connected to the AREF pin by writing to the REFSn bits in the ADMUX Register. The internal voltage reference may thus be decoupled by an external capacitor at the AREF pin to improve noise immunity. |
Koda: |
'Config Adc = Single , Prescaler = Auto, Reference = Internal 'The reference param may be : 'OFF : AREF, internal reference turned off 'AVCC : AVCC, with external capacitor at AREF pin 'INTERNAL : Internal 2.56 voltage reference with external capacitor ar AREF pin |
program_er je napisal/a: |
Aja, pa na feri so mi pravli, da je v enem primeru rezultat ADC-ja izražen v mili voltih. Je to res? |
Koda: |
– 8-channel, 10-bit ADC 8 Single-ended Channels 7 Differential Channels in TQFP Package Only 2 Differential Channels with Programmable Gain at 1x, 10x, or 200x |
Koda: |
– 8-channel, 10-bit ADC 8 Single-ended Channels |
Koda: |
ADC Running mode. May be SINGLE or FREE. PRESCALER A numeric constant for the clock divider. Use AUTO to let the compiler generate the best value depending on the XTAL REFERENCE The options depend on the used micro. Some chips like the M163 have additional reference options. In the definition files you will find : ADC_REFMODEL = x This specifies which reference options are available. The possible values are listed in the table below. ----------------------------------------------------------------------------------------------- 'The newer has options for the reference voltage 'For those chips you can use the additional param : 'Config Adc = Single , Prescaler = Auto, Reference = Internal 'The reference param may be : 'OFF : AREF, internal reference turned off 'AVCC : AVCC, with external capacitor at AREF pin 'INTERNAL : Internal 2.56 voltage reference with external capacitor ar AREF pin |
Koda: |
'configure single mode and auto prescaler setting
'The single mode must be used with the GETADC() function 'The prescaler divides the internal clock by 2,4,8,16,32,64 or 128 'Because the ADC needs a clock from 50-200 KHz 'The AUTO feature, will select the highest clockrate possible Config Adc = Single , Prescaler = Auto 'Now give power to the chip Start Adc 'With STOP ADC, you can remove the power from the chip 'Stop Adc Dim W As Word , Channel As Byte Channel = 0 'now read A/D value from channel 0 Do W = Getadc(channel) Print "Channel " ; Channel ; " value " ; W Loop |
Koda: |
Dim W2 as word
w2 = w * 50 w2 = w2 / 1024 print W2 |
Koda: |
dim volti as word
dim desetinke as word volti = W2 / 10 desetinke = W2 mod 10 print "Napetost je ";volti;".";desetinke;"V " |
vilko je napisal/a: |
A, ti nas tako, hipotetično .. |