ATtiny 2313 details/questions...

1) How many digital outputs can the attiny chip provide? a) How many digital? b)How many analogue?

A pinout with the pins lablled would be greatly appreciated :)

2) How to set it up for the first time, everything like the board the arduino duemilanove to program itetc...

3) Depending on 1, is it possible that I attach 5 buzzers, 5 pushbutton switches, and 5 LEDs and 1 potentiometer? If not what can I attach and how many of them can I attach?

Thanks a lot! Awaiting your reply...

Did you try reading the datasheet? If not, why not? If you did, what part was unclear?

Also, if you have all those peripherals, why not just a regular atmega328?

Because I need it to be small for my project and using the ATMEGA takes up a little too much space...I did read the datasheet but couldn't find the answer as I think I did not understand the pins bit...please help...

I would recommend that you take some time to read the 2313 datasheet and figure out what some of that information means. This would be a good time to educate yourelf, and stop expecting others to do all the work for you.

Read the datasheet and try to figure it out and then come ask questions because then you will actually be able to ask a question that will help you aquire knowledge, rather than just grabbing a quick fix that you will soon forget.

Is this the right datasheet?

http://www.atmel.com/Images/doc2543.pdf

If it is, then I am reading it now and I will post questions that I do not understand later on… :slight_smile:
Thx

Ok...now I only sort of have 1 question...

"Port A is a 3-bit bi-directional I/O port with internal pull-up resistors (selected for each bit)." I don't understand what this means,...does it just mean that it is a normal I/O pin like the arduino? Like a analogue IO pin?

"Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit)." I don;t understand what this means either...does it also just mean that this is a notmal I/O pin like the arduino? Like a digital IO pin?

"Port D is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit)." I don't understand what this means either...does it also just mean that this is a normal I/O pin like the arduino? Like a digital IO pin?

And in total there are 18 I/O pins right?

And which pins do I connect for programming the ATTINY as I do not see that anywhere on the datasheet ...

Thanks :D

Regarding pin numbers on the attiny's:

http://arduino.cc/forum/index.php/topic,82951.0.html

If you want to use Arduino as a programmer you connect:

•ATtiny Pin 2 to Arduino Pin 13 (or SCK of another programmer) •ATtiny Pin 1 to Arduino Pin 12 (or MISO of another programmer) •ATtiny Pin 0 to Arduino Pin 11 (or MOSI of another programmer) •ATtiny Reset Pin to Arduino Pin 10 (or RESET of another programmer)

and download the tiny-core:

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

There is a tutorial in the playground on how to program the tiny's with Arduino as ISP

A I/O port is digital. Analog pins are called ADC. Here's a hint: how many ADCs are specified on that part?

Also, there's a section on programming using the SPI interface.

// ATMEL ATTINY2313
//
//                   +-\/-+
//      (D 17) PA2  1|    |29  VCC
// RX   (D  0) PD0  2|    |19  PB7 (D  16)
// TX   (D  1) PD1  3|    |18  PB6 (D  15)
//      (D  2) PA1  4|    |17  PB5 (D  14)
//      (D  3) PA0  5|    |16  PB4 (D  13)*
// INT0 (D  4) PD2  6|    |15  PB3 (D  12)*
// INT1 (D  5) PD3  7|    |14  PB2 (D  11)*
//      (D  6) PD4  8|    |13  PB1 (D  10)
//     *(D  7) PD5  9|    |12  PB0 (D  9)
//             GND 10|    |11  PD6 (D  8)
//                   +----+
//
// * indicates PWM port

// these arrays map port names (e.g. port B) to the
// appropriate addresses for various functions (e.g. reading
// and writing)

so I see no ADC in here...does that mean that this has no analogue pins? If it does then which pins are analogue and which pins are digital because I still don't get which ones are which...

does that mean that this has no analogue pins?

Correct. The ATtinyX313 family does not have an analog-to-digital converter.

I connected the wires as you said and tried uploading the code with ATTINY 2313 8MHz and it doesn't upload...it says done uploading and gives an avr dude unresponsive error and the code has not been uploaded as I tried the blink example and it did'nt work :(

Could someone give me detailed instructions on how to upload? Or links to places where someone has had the same problem and they have written up solution there or tutorials...thanks :)

vishalapr the connections was for the Attiny 85, sorry.

The connections to the At2313 are:

Arduino Attiny2313 13 19 PB7/SCK 12 18 PB6/MISO 11 17 PB5/MOSI 10 1 PA2/Reset 5v 20 VCC GND 10 GND

I have made alittle tut here:

http://www.ernstc.dk/arduino/2313.htm

I did everything said but I keep getting this error :(

avrdude: stk500_program_enable(): protocol error, expect=0x14, resp=0x50 avrdude: initialization failed, rc=-1 Double check connections and try again, or use -F to override this check.

avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51

Plz help :(

What are you using as a programmer? Software and hardware?

Are you using Arduino 1.0 ?

yes I am using arduino 1.0 and I am using an arduino duemilanove 328 for programming as ISP...

Ok, se this thread

http://arduino.cc/forum/index.php/topic,84095.15.html

post #27

I sent a message to coding badly so hopefully I will get a reply with instructions and it will work :) Will post back after retrying...

And I have one more quesiton...the ATTINY 2313 only has digital I/O pins and no analogue...I would like to use a potentiometer with my project...its a sliding potentiometer....is there any way I could modify (Maybe by adding some more components or summin) a digital pin to an analogue one? Or can I somehow use a PWM pin with the sliding potentiometer? Thanks

"Use a PWM pin with a potentiometer" doesn't even make sense. PWM is a digital output mechanism. You want an analog input mechanism.

Can you add a component to the tiny 2313 to use an analog input? Sure! Add an ADC and run it through a serial or parallel interface. SPI is available on the 2313, and there are many ADCs that work well with SPI. However, at that point, both cost, complexity, and size, is a lot more than just selecting an atmega part that already has the ADC built-in.

That being said, based on your questions, it seems to me that what you actually need is a good class in engineering basics. How do you problem solve? How do you read documentation? How do you self-help? How do you recognize that you NEED self-help? These are fundamental engineering literacy questions that I believe you would be very well served by focusing on.

hmm…what is an ADC?