attiny2313 analog input solution

so, I've thought that AIN0 means analog input,

so I've bought that chip programmed it for my needs with arduino and soldered it to the board. It seems that AIN0 isn't analog input and I'm looking for solution. Can anyone suggest me solution what should I do?

When I mess up a pcb, which happens sometimes on the first attempt, I get out the solder wick to desolder what ever shouldn't be there, I slice traces as necessary with a fine sharp knife to break connections that are wrong, and I solder jumper wires on the board to connect whatever I didn't get right to begin with. That results in a board I don't want to show anybody, but at least it saves the board.

In contrast to other controllers, the tiny doesn't include an A/D converter, but only an analog comparator. The comparator output indicates whether the voltage on AIN1 is lower or higher than the voltage on AIN0 (or bandgap reference).

Thus AIN0/1 are analog inputs, but you can't read the voltage level at these pins.

So, is there anything I can do? I have 3 digital pins left

What do you want to do?

There exist external ADC modules, other processors...

I would recommend using a different chip, one that has an adc. The 2313 is really painful to use, 2k just isn't enough to do much with in arduino.

I think an attiny 1634 would be a nice upgrade, and it has an adc, and about same number of pins. See link in sig for the arduino core - I also happen to sell breakout boards assembled and bare (how convenient eh?)

Ok, thank you! I think that I will purchase attiny 1634

Veru usefull, thanks

Well if you have a spare PWM pin and some space in flash memory, you could try and make an RC filter based DAC and connect it to an analog comparator input. Then all you have to do is to is to increment the duty cycle of the pwm and check the comparator output each time, until the DAC voltage becomes higher than the analog input. It really takes long to take a measurement which may or may not be a problem depending on the use case of course.