ATTiny 25/45/85/2313 Pin numbers

Hey Karl_B
thanks for this cheat sheet, looks great. Wonder if you could also include attiny84 ?

Thanks kermit,

attiny84 and attiny87/167 are on our TODO list. :slight_smile:

Good news, we have now added ATTinyX4 as well to the cheat sheet, you can find the updated version here: http://www.akafugu.jp/posts/resources/reference-sheet/

Nice. Thank you.

I have a suggestion: use ", " (comma space) instead of "/" (slash) to separate the labels. It's a little difficult to locate a pin from its function (like MISO).

Thanks for the suggestion, we'll try it out and see how it looks

Great post.
do you guys know what is the analog input pin numbers on the 2313
been reading the datasheet and can not find it.

thanks

For the analog comparator or the analog-to-digital converter?

more like Analog input/ Sensor input

I guess the analog is the PB0/AIN0/D9

I have been trying to get the analog input to work with a sensor
how is set this pin to be a alaog input

see sketch

///////////////////

int sensPin=PB0; //  analog  input  for  2313
int sensVal=0; //  value





int ledPin = 1; // The pin number of the LED  
int ledPin7 = 7;


//////SETUP////////

void setup() {
 pinMode( ledPin, OUTPUT ); // Sets the led pin to an output mode
 pinMode( ledPin7, OUTPUT );
// pinMode( sensPin, INPUT );
 
// Serial.begin(57600); //set Serial Data flow / debug/ read
 
}



///LOOP///////////

void loop() {
  
  digitalWrite(ledPin7, HIGH);
  
  
 sensVal = analogRead(sensPin); // READS sensor,  
 
 

 
 if( sensVal > 350 )            // object is close to sensor??
 {
   
   

     
       digitalWrite( ledPin, HIGH ); //Turn  LED pin on
     }
     
     
     
     if( sensVal < 450 ) 
 {
   
   

     
       digitalWrite( ledPin, LOW); //
     }
     
     
     
   }

Moderator edit:
</mark> <mark>[code]</mark> <mark>

</mark> <mark>[/code]</mark> <mark>
tags added.

balam:
more like Analog input/ Sensor input

An analog-to-digital converter. The 2313 does not have one.

balam:
I guess the analog is the PB0/AIN0/D9

That is one of the two inputs to the analog comparator.

 sensVal = analogRead(sensPin); // READS sensor,

If you are using this core...
http://code.google.com/p/arduino-tiny/
...zero is always returned.

Thank you.

yes I am using this cores

http://code.google.com/p/arduino-tiny/

you mean that analog input does not work?

on the core pin s file
seems like there is analog port as PIN_A0 (3)
been trying to read a sensor and turn an led but doe snot work
any help is really apreciated , how can I read a sensor from this 2313 chip.

thanks

you mean that analog input does not work?

The processor does not have an analog-to-digital converter (ADC). So, yes, analog input does not work.

how can I read a sensor from this 2313 chip.

Two things come to mind...

  1. Add an external ADC.

  2. Atmel has a whitepaper describing how to mimic an ADC using the analog comparator. It requires some external components (I think two). If you're interested, I'll try to find a link.

THANK you.

I been editing the core pins
but now that you are saying that analog input is not supported

yea I will be interested in find out how to add a sensor

buuuummmppp

Why are you bumping this topic?

smeezekitty, do you assign thepins by the PB# or just # in the code.

Arduino_User49502:
smeezekitty, do you assign thepins by the PB# or just # in the code.

You use the numbers to refer to the pins in your code

Please don't bump three-year-old threads.