View previous topic :: View next topic |
Author |
Message |
pantera33
Joined: 13 Nov 2006 Posts: 3
|
Posted: Thu Sep 11, 2014 9:04 pm Post subject: attiny43u.dat - ADC_MUX entry not found in DAT file |
|
|
Hi.
I got a new attiny43u.
How to find out the battery voltage?
getadc(4) not working - ADC_MUX entry not found in DAT file!
getadc() is not working at all.
What is wrong?
(BASCOM-AVR version : 2.0.7.7 ) |
|
Back to top |
|
|
Plons
Joined: 24 May 2005 Posts: 435 Location: Hilversum - The Netherlands
|
Posted: Thu Sep 11, 2014 11:05 pm Post subject: |
|
|
Your first post in this forum, ... so welcome !
It's recommended to post your code when encountering a problem.
And make it a habit to put compiler directives at the top of your program. For example:
Code: | $crystal = 16000000 'do not forget to specify this correctly
$regfile = "ATtiny43U.dat"
$hwstack = 40 ' default use 32 for the hardware stack
$swstack = 10 ' default use 10 for the SW stack
$framesize = 40 ' default use 40 for the frame space
|
_________________ Bascom AVR ver 2.0.8.6
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel" |
|
Back to top |
|
|
pantera33
Joined: 13 Nov 2006 Posts: 3
|
|
Back to top |
|
|
Plons
Joined: 24 May 2005 Posts: 435 Location: Hilversum - The Netherlands
|
Posted: Fri Sep 12, 2014 2:15 pm Post subject: |
|
|
I tried your code. Same error message.
There seems to be an omission in the DAT-file of the ATTiny43U.
Since the ADC of the 43 has 2 status registers, ADCSRA and ADCSRB, I added a line in the DAT-file that says Code: | ADCSR=$06 ; for pantera |
If this fixes your problem, please report this to MCS support; the DAT-file will be corrected in the next release.
Enjoy
Nard
Attaching a .dat-file is not allowed so I changed the extension to .txt. Rename to .dat _________________ Bascom AVR ver 2.0.8.6
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel" |
|
Back to top |
|
|
Plons
Joined: 24 May 2005 Posts: 435 Location: Hilversum - The Netherlands
|
Posted: Fri Sep 12, 2014 2:33 pm Post subject: |
|
|
When testing this slightly expanded program, the next flaw comes up:
Code: | $Regfile="attiny43u.dat"
$Crystal=1000000
$hwstack=24
$swstack=16
$framesize = 32
Dim Adc_value As Word
Config Adc = Single , Prescaler = Auto , Reference = Internal_1.1
Start Adc
Adc_value = Getadc(4)
End |
ADC_MUX entry not found etc.
Another entry is required in the .DAT file. Working on that now ....
..... done
Adding a line for ADC_MUX like this
Code: | ADMUX=$07
ADC_MUX=$07 ; for pantera2
ADCSRA=$06
ADCSR=$06 ; for pantera
ADCH=$05
ADCL=$04
ADCSRB=$03 |
should do the job, ... it doesn't.
We need the expert for this. _________________ Bascom AVR ver 2.0.8.6
Dragon-lair: http://www.aplomb.nl/TechStuff/Dragon/Dragon.html
"leef met vlag en wimpel, maar hou het simpel" |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Sep 12, 2014 9:00 pm Post subject: |
|
|
attached a new file. i did not test the a/d converter of this chip. i probably do not have this chip. _________________ Mark |
|
Back to top |
|
|
pantera33
Joined: 13 Nov 2006 Posts: 3
|
Posted: Fri Sep 12, 2014 10:51 pm Post subject: |
|
|
Dear Mark.
Thank you very mutch for fast answer. It seems that adc is now working! I did only quick test with light sensor and led. Later i'll report about this topic. |
|
Back to top |
|
|
|