Go Down

Topic: ATTiny 25/45/85/2313 Pin numbers (Read 9671 times) previous topic - next topic

Coding Badly


In that case, I misunderstood the purpose of the cheat-sheet.  I assumed it was meant to document pin mappings for Arduino compatible cores.

karl_b

You didn't misunderstand: The new version of the cheat sheet was meant to do exactly that: For example, physical pin 11 on the ATTiny2313/4313 is PD6 (when programming in low-level avr-gcc) and is assigned to Arduino pin number 8: This is written as PD6/D8 in the cheat sheet.
http://www.akafugu.jp/blog/

Coding Badly


In that case, PB3 needs to be excluded for the X5 family.  As far as I know, no Arduino compatible cores make use of inverted PWM outputs.

karl_b

You won't be able to use the inverted PWM for Arduino, but the sheet covers both Arduino pin numbers and normal port numbers (that's why it says D3/PB3). That said, there should be a note saying that PB3 is a "special" PWM pin.
http://www.akafugu.jp/blog/

kermit

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

karl_b

Thanks kermit,

attiny84 and attiny87/167 are on our TODO list. :)
http://www.akafugu.jp/blog/

karl_b

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/
http://www.akafugu.jp/blog/

Coding Badly


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).

karl_b

Thanks for the suggestion, we'll try it out and see how it looks
http://www.akafugu.jp/blog/

balam

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


Coding Badly


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

balam

more like Analog input/ Sensor input

balam

#27
Mar 06, 2012, 11:26 pm Last Edit: Mar 06, 2012, 11:40 pm by Coding Badly Reason: 1
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

Code: [Select]
///////////////////

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: [code] [/code] tags added.

Coding Badly

more like Analog input/ Sensor input


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

Coding Badly

I  guess the analog is the PB0/AIN0/D9


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

Code: [Select]
sensVal = analogRead(sensPin); // READS sensor,  

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

Go Up