Pages: 1 [2] 3   Go Down
Author Topic: ATTiny 25/45/85/2313 Pin numbers  (Read 9091 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Tokyo, Japan
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Tokyo, Japan
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


0
Offline Offline
Newbie
*
Karma: 0
Posts: 13
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Tokyo, Japan
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks kermit,

attiny84 and attiny87/167 are on our TODO list. smiley
Logged


Tokyo, Japan
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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/
Logged


Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Tokyo, Japan
Offline Offline
Newbie
*
Karma: 0
Posts: 18
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


0
Offline Offline
Full Member
***
Karma: 0
Posts: 132
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

0
Offline Offline
Full Member
***
Karma: 0
Posts: 132
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

more like Analog input/ Sensor input
Logged

0
Offline Offline
Full Member
***
Karma: 0
Posts: 132
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
///////////////////

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.
« Last Edit: March 06, 2012, 05:40:45 pm by Coding Badly » Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

more like Analog input/ Sensor input

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

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 212
Posts: 13085
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I  guess the analog is the PB0/AIN0/D9

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

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

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

Pages: 1 [2] 3   Go Up
Jump to: