Hi Team,
I'm trying to read a voltage on the ADC port of Attiny84, I've already tried all possible settings, but to no avail, I get only the "0" on LCD!
It works in the simulation......I think I get the ADC simply not switched !?
With an Attiny85 has it ever worked, at a certain voltage, I turned on a port, only to read on an LCD has too few ports.
I'm grateful for every tip!
Greetings
Ralf
Can not read the ADC at Attiny84
Moderator: Benj
-
- Posts: 28
- Joined: Tue Dec 10, 2013 9:32 am
- Has thanked: 9 times
- Been thanked: 3 times
- Contact:
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: Can not read the ADC at Attiny84
Hello Ralf,
Just looking into this for you and the ADC code looks ok.
One thing I spotted is that there is a digital input disable register mentioned in the datasheet. It doesn't say it is required to be set for ADC conversion but it's work a go.
Let us know if this helps and if so I will add the code to the ADC component.
Just looking into this for you and the ADC code looks ok.
One thing I spotted is that there is a digital input disable register mentioned in the datasheet. It doesn't say it is required to be set for ADC conversion but it's work a go.
Code: Select all
DIDR0 = 0x3F; //Disable Digital Inputs
Code: Select all
DIDR0 = 0x00; //Enable Digital Inputs
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 28
- Joined: Tue Dec 10, 2013 9:32 am
- Has thanked: 9 times
- Been thanked: 3 times
- Contact:
Re: Can not read the ADC at Attiny84
Hello Benj,
thanks for your support
As I have inserted it in the attached test program, it does not work either! I only get a short "3" displayed when I declare GetByte in the component, I do that with GetInt I get the short "15" displayed!
I try to evaluate the voltage on an ADXL335 module, the measured voltage of an axis in the basic position is at 1.8V ......
I'm looking forward to more ideas and I'm curious what stupid mistakes I currently make
Thanks again
thanks for your support
As I have inserted it in the attached test program, it does not work either! I only get a short "3" displayed when I declare GetByte in the component, I do that with GetInt I get the short "15" displayed!
I try to evaluate the voltage on an ADXL335 module, the measured voltage of an axis in the basic position is at 1.8V ......
I'm looking forward to more ideas and I'm curious what stupid mistakes I currently make
Thanks again
- Attachments
-
- ADC and LCD Test Attiny84.fcfx
- (19.69 KiB) Downloaded 265 times