View previous topic :: View next topic |
Author |
Message |
lasse2t
Joined: 14 Jan 2005 Posts: 95 Location: Sweden
|
Posted: Sun Nov 03, 2013 5:24 pm Post subject: Attiny13v and bandgap measurment. |
|
|
I have just bought some Attiny13v that i should use to measuring the actually VCC that it is connected to.
After some search on the internet i have discovered that it is not possible whith Attiny13v to use the bandgap reference for that function?
I assume the only solution is to connect a external reference to it?
Regards /Lasse
(BASCOM-AVR version : 2.0.7.5 , Latest : 2.0.7.6 ) |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Mon Nov 04, 2013 12:23 am Post subject: |
|
|
Why not ? I assume the 13v has a bandgap reference like most of the other variants. So you are comparing a 'fixed' reference voltage against a 'variable' Vcc supply voltage. You may need a resistive divider on the Vcc to bring it down into the input range of the ADC, but that is trivial. _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
Ross_ValuSoft
Joined: 20 Nov 2005 Posts: 275 Location: Melbourne, Australia
|
Posted: Mon Nov 04, 2013 7:54 am Post subject: |
|
|
Hi Lasse,
Try this...
Use VCC as VREF and measure the Bandgap 1.1V voltage.
ADCW = 1024 * (1.1 / VCC)
rearranging
VCC = 1126.4 / ADCW
Cheers,
Ross _________________ Ross McKenzie
Melbourne Australia |
|
Back to top |
|
|
lasse2t
Joined: 14 Jan 2005 Posts: 95 Location: Sweden
|
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Mon Nov 04, 2013 10:24 pm Post subject: |
|
|
no it has no mux setting to measure bandgap or temperature but as adrianJ suggests, you can use a voltage divider. it will only work when the reference is the internal bandgap reference. _________________ Mark |
|
Back to top |
|
|
lasse2t
Joined: 14 Jan 2005 Posts: 95 Location: Sweden
|
Posted: Tue Nov 05, 2013 11:16 am Post subject: |
|
|
Ok. So if i use a resistiv divider on 1 adc input and use "config adc reference= internal" then it will work? |
|
Back to top |
|
|
AdrianJ
Joined: 16 Jan 2006 Posts: 2483 Location: Queensland
|
Posted: Tue Nov 05, 2013 11:12 pm Post subject: |
|
|
Yes _________________ Adrian Jansen
Computer language is a framework for creativity |
|
Back to top |
|
|
lasse2t
Joined: 14 Jan 2005 Posts: 95 Location: Sweden
|
Posted: Wed Nov 06, 2013 12:04 am Post subject: |
|
|
Adrianj: Ok, i willl try it in the weekend.
/lasse2t |
|
Back to top |
|
|
Ross_ValuSoft
Joined: 20 Nov 2005 Posts: 275 Location: Melbourne, Australia
|
Posted: Fri Nov 08, 2013 12:31 pm Post subject: |
|
|
Apologies Lasse. I didn't check the ATTiny13 datasheet.
Cheers,
Ross _________________ Ross McKenzie
Melbourne Australia |
|
Back to top |
|
|
|