1

I am using an ATTINY88 for a project that requires to turn on an LED. Right now I am using pin PA1(ADC7/PCINT25). I noted, however, that when the pin is ON, I get about half the voltage that is connected to Vcc. I checked the voltage in other pins and they are close to Vcc. Will anyone know, what could be the reason for this?

I figure this pin has an internal resistor enable, but I am not certain.

  • Do you have a resistor in series with the LED? – Nick Gammon Aug 26 '16 at 3:16
  • I disconnected everything from the pin and I still get half the Voltage in Vcc when that pin is HIGH. In fact, all the pins on that side of the chip give half the voltage when they are on, while other pins give voltage near Vcc. I think those pins on that side of the chip have a resistor enable??? – Camilo Aug 26 '16 at 3:22
  • this behaviour might happen if you have PA1 set as input and pull up resistor enabled. Check the datasheet for Port A sub-section. It defines that it will source current when enabled. – ammar.cma Aug 26 '16 at 3:38
  • is there a way to disable such resistor? I have that pin set as OUTPUT – Camilo Aug 26 '16 at 4:09
3

You should connect the AVCC pin to VCC. From the datasheet (emphasis mine):

AVCC is the supply voltage pin for the A/D converter and a selection of I/O pins. This pin should be externally connected to VCC even if the ADC is not used. [...]

The following pins receive their supply voltage from AVCC: PC7, PC[5:0] and (in 32-lead pack- ages) PA[1:0]. All other I/O pins take their supply voltage from VCC.

  • That sounds like a really bizarre design choice to me... reminds me why I use PIC and not Atmel chips ;) – Majenko Aug 26 '16 at 9:29
  • @Majenko It is little bit bizare, but connecting AVcc to Vcc is stated in every datasheet for every AVR with AVcc pin. And yet it's common rookie mistake. – KIIV Aug 26 '16 at 13:15
  • It probably makes internal wiring in the chip simpler, and possibly reduces noise. – Nick Gammon Aug 26 '16 at 17:02
  • do you know why is this needed (connecting AVcc to Vcc)?. My circuit works just fine without that connection and it includes several AnalogReads....also, I wonder if it will increase battery consumption? I will test this. – Camilo Aug 26 '16 at 18:44
  • @Camilo: Why it is needed? The excerpt of the datasheet I quoted is, I think, quite explicit. Your circuit may work without that because 1) the internal logic is powered through VCC, 2) the AVCC node is getting some parasitic power through some I/O pins or some internal gates. – Edgar Bonet Aug 26 '16 at 20:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.