Easy Way of programming an ATtiny2313 in my breadboard?

Go To Last Post
33 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi guys, I have a STK500, whenever I want to programme a chip, I take it out of the circuit its in, plug it into the STK500, programme it, then take it out again and put it in the circuit to test it.

From reading the forums Ive always seen some catch phrases like ISP, or JTAG. I looked them up on wiki, and it seems like STK500 uses ISP, and the JTAG is for debugging.

I searched Atmel Application Notes and Other Documents and read the following two docs but i didnt learn much from them:
Atmel’s Self-Programming Flash Microcontrollers
AVR ISP Schematic

Is there a way/is it possible that I can leave a few dedicated pins of the ATtiny2313 aside for programming, and bring a few lines from my STK500 to my breadboard, and programme it in circuit, ie so I dont have to unplug it (and leave say the LCD and buttons etc in place)?

I feel like such a noob when I try and read up on these things, thanks for any help!

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ISP stands for In System Programming, if i recall correctly. This is what i personally use to program my devices. You can use the ISP6PIN or the ISP10PIN port on your STK500 board to program external circuits, like one containing the ATtiny2313. When you make a PCB you will have to remember to make some kind of design that makes it possible for you to connect your new board with the ISP pins on the STK500. You can see which pins that are needed to connect to which by looking into the datasheet for your processor and looking at the ISP section of the AVR042 (https://www.avrfreaks.net/index.php?module=Freaks%20Tools&func=viewItem&item_id=432).

Hope that helps abit :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There are many threads about using the ISP pins to perform other functions, also.

It is probably easiest, however, to leave the pins as just dedicated programming pins, if you can spare them, to get started.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The STK500 documentation also
contains some info about ISP-programming.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For use with breadboards, it may help to uses one more connctor type than the standard 10 pin and 6 pin (as 3x2). For a breadboard the natural form is 6 pins in a row. For the Tiny 2313 allready 5 of the 6 pins for the ISP Interface are in a row, at the edge of the chip, so only one more bridge is needed to get them all 6 together.

The other option is to put a suitable socket on to of the chip, with cabels direktly soldered to the ISP Pins.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This is what I use when I need to program an AVR that sits on a breadboard.
I defined my own 7p Single-In-Line ISP connector 4 years ago: like Kleinstein describes, but with an extra space to prevent erronous connection.
The resistors are not a necessaty, but I prefer to play things safe on a breadboard. A wrong placed wire will not destroy my programmer with these resistors in place.

Nard

Attachment(s): 

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

fever2tel wrote:
Is there a way/is it possible that I can leave a few dedicated pins of the ATtiny2313 aside for programming, and bring a few lines from my STK500 to my breadboard, and programme it in circuit, ie so I dont have to unplug it (and leave say the LCD and buttons etc in place)?

There are two ways:

1. feed the 4 SPI-Pins to a standard 6- or 10-pin connector. Then connect it to the programming connector of the STK500

2. burn a bootloader into the ATTiny2313.
It cost about 25% of Flash, but then you need no STK500 to reprogram it, you can connect it directly to the COM-port.
Also you need only one wire instead four and you can use the reset pin as IO (all 18 IOs available for your application).

Peter

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

For completeness, here is the Spark Fun Electronics board which is similar to Nard's above: Here .

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is no real need for an extra adapter board to change the connector. Just another cable.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
There is no real need for an extra adapter board to change the connector. Just another cable.

?

The reason for the adapter board is to convert the STK500's 2x3 or 2x5 format to a single in line row, 1x6, for easily plugging into a bread board.

You can then connect or disconnect a "standard" STK cable, 2x3, to the bread board easily.

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This photo shows three ways to connect an STK500 to a breadboard.

On the left is a 10 pin ribbon cable. One end has a 2x5 connector for the STK500. The other end is custom soldered to a single row of header pins.

The middle device is from MicroCarl. It accepts a "normal" 2x5 to 2x5 ribbon cable, and plugs in like a dip chip. It straddles the middle of the breadboard. It includes a tiny LED. (Great device, Carl!)

On the right is the Spark Fun board, assembled. It has both a 2x3 and a 2x5 header sticking up, and a single row on pins sticking down, to plug into the breadboard. Then, whichever type of cable you want to use from the STK500, either 2x3 or 2x5 can be easily connected to the breadboard.

This photo just illustrates three possible methods, others certainly exist.

Needless to say, with all of the above, one then routes the various signals to the appropriate pins on the uC, Including Ground, and possibly Excluding V+.

JC

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I create small adapter boards for the various DIP-style MCUs to add temporary ISPs. The board plugs into the DIP socket, and the MCU plugs into a secondary socket on the adapter board. The adapter board also has a 10 pin standard ISP header. Each adapter board has all the variations for the specific DIP footprint. For example, I have a 40 pin board with M16/32, M162, and M644P ISP connectors, I have a 20 pin adapter and a 14 pin adapter as well. If there is interest, I can see about some pictures.

Jim

Jim Brain

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice, Doc,

When I made those IDC-->Proto-board adapters, I hadn't even thought about using them to
program a Dip style controller while it's in a proto-board. My intent was to connect the STK500 & STK600 I/O to the proto-board.

Nice!!!

You can avoid reality, for a while.  But you can't avoid the consequences of reality! - C.W. Livingston

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I use these for my Mega8 and Tiny13 projects - they simply straddle the DIP chip on the breadboard. A version for a 2313 would be similar.


More often than not, I leave them in-place whilst developing.

Nigel Batten
www.batsocks.co.uk

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Stevanx wrote:
ISP stands for In System Programming, if i recall correctly. This is what i personally use to program my devices. You can use the ISP6PIN or the ISP10PIN port on your STK500 board to program external circuits, like one containing the ATtiny2313. When you make a PCB you will have to remember to make some kind of design that makes it possible for you to connect your new board with the ISP pins on the STK500. You can see which pins that are needed to connect to which by looking into the datasheet for your processor and looking at the ISP section of the AVR042 (https://www.avrfreaks.net/index.php?module=Freaks%20Tools&func=viewItem&item_id=432).

Hope that helps abit :)

Thanks Stevan!!! What a fantastic document. I learnt loads form it. Ground plan under the IC, Inductor and cap at the power pins, 10K pull to RESET, the ISP pins outs and serial protection resistors for the SCK, MISO, and MOSI pins. Although it didnt recommend what value the resistors should be.
1) Should I use 120 Ohm ones?
2) If my breadboard circuit is already powered can I leave out the VTG connection?
Thank you

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kleinstein wrote:
For use with breadboards, it may help to uses one more connctor type than the standard 10 pin and 6 pin (as 3x2). For a breadboard the natural form is 6 pins in a row. For the Tiny 2313 allready 5 of the 6 pins for the ISP Interface are in a row, at the edge of the chip, so only one more bridge is needed to get them all 6 together.

The other option is to put a suitable socket on to of the chip, with cabels direktly soldered to the ISP Pins.


Good Idea, I will make a header plug like that, thank you!

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:
For completeness, here is the Spark Fun Electronics board which is similar to Nard's above: Here .

JC

That is so neat I love it, must buy!!! Thanks for the link

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Wow DocJC, you certainly are set up nicely,. Thank you for explaining all the possible ways to connect up the ISP. I understand it much better now.

Sheesh, you guys come up with all sorts of clever tricks, nice one condemned.

Thanks so much for all the info guys, all the posts helped and were appreciated, an overwhelming response of epic proportions!

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

fever2tel wrote:

Thanks Stevan!!! What a fantastic document. I learnt loads form it. Ground plan under the IC, Inductor and cap at the power pins, 10K pull to RESET, the ISP pins outs and serial protection resistors for the SCK, MISO, and MOSI pins. Although it didnt recommend what value the resistors should be.
1) Should I use 120 Ohm ones?
2) If my breadboard circuit is already powered can I leave out the VTG connection?
Thank you

1) About the resistors, i dont know, i dont use them, but it might be a good idea. Use Ohm's law to find out how big they should be.

2) It is VERY important to remove the VTARGET jumper if your board is supplied with it's own power, else you might fry your STK board - though I've mistakenly forgotten the jumper a few times, it still works, but try to remember! :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Like I said: there is no absolute need to use resistors, but it's a safety measure: 120 to 470 Ohm is fine. I use 470 Ohm --> max 10mA , so safe. I also put it in the /Reset-line.

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

With all the examples you guys provided i made my own "version" of the ISP6/ISP10 to 1row programmer for breadboard use, which im going to try out later today.
But if ppl want to make their own PCB or maybe have some design suggestions i've attached the eagle schematic and board file... :)

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I made a new version which is to be plugged directly next to an ATmega16 :) Because this is a processor we use alot in my school at the time, and the idea with this board is to plug either a ISP10 or 6 to it, and then the jumper can be setted according to how the power need is... Like we have the programmer supply the power or the programmer needs power from the board we put in the jumper, else we leave the jumper disconnected :)

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks for sharing your work :!:

Nard

A GIF is worth a thousend words   They are called Rosa, Sylvia, Tessa and Tina, You can find them https://www.linuxmint.com/

Dragon broken ? http://aplomb.nl/TechStuff/Dragon/Dragon.html for how-to-fix tips

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No problem, I like to help, as I like to be helped :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks Stevanx, I was planning on drawing one of those up, but you saved me the trouble, thou art a star!

Just a noob in this crazy world trying to get some electrons to obey me.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You're welcome :D

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

As a very "quick & dirty" , i have sometimes just taken the opersite end of the 10 pin ISP cable from the STK-500 programming connector , and plugged the breadboard wires directly in 10 pin plug (they fit). Then i just plugged the other end of the breadboard wires into the correct breadboard holes for the AVR ISP pins.

But a pcb adapter is better.

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi, I am a new AVRFREAKS member and a visually impaired one. In your post - regretfully - I've met the same bullshit ason many tutorial pages and forum posts:

A GIF is worth a thousend words.
Please, please!!!! Do not be lazy and give us, for visually impaired tinkerers at least a pin to pin textual description of a given circuit drawing or photo! A gif for us is only an useless junk! Screen reading programs simply omit them as non-existent things on a webpage, they can not read pictures, only normal typed text!

And - also regretfully - in my surroundings all sighted people are absolute illiterates concerning electronics, so they can not help us in explaining what is on the drawing or photo. They can not tell apart even a diode from a transistor...

This comment is not made especially against you, but against a tendency on the Net, against an "Everithing must be visual" bullshit approach. I WILL MAKE similar comments to all, othervise useful-looking tutorials if they omit completely textual description for the images and photos. The Internet IS NOT ONLY for sighted users! Thanks.

 

Bos bos dicetur, terris ubicumque videtur.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Weblionking, your rant might have had some relevance if it were a recent post, but alas, you’re late to the party. Nine years too late. Lucky Christmas is coming soon so you’ll have a party.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Webtigerking wrote:

In your post - regretfully - I've met the same bullshit ason many tutorial pages and forum posts:

 

You may not realise but this topic is 9 years old. The chances of the original poster still reading are slim.

 

Webtigerking wrote:

I WILL MAKE similar comments to all, othervise useful-looking tutorials if they omit completely textual description for the images and photos.

 

You will annoy a lot of people which is probably not the best way to get help.

 

 

Have you seen my reply to your other post? I'm genuinely interested in what works for you.

#1 This forum helps those that help themselves

#2 All grounds are not created equal

#3 How have you proved that your chip is running at xxMHz?

#4 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand." - Heater's ex-boss

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you seen my reply to your other post?

Obviously not.........

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, again, webtigerking -

 

I understand, at least partially, your anger. Unfortunately, the simple fact is that a very large fraction of the world's population is sight-oriented. And for most of those, sight is, by far, one of the most efficient communication channels we have. For most of us, that old saying of "a picture is worth a thousand words" is not just a saying, it is literally true. Of course, in some cases, pictures CAN be replaced by words, but it is both time and space  consuming. Instruction manuals are a part of doing business in most of the  technical world. And, for businesses, "time is money"; I would hardly expect them to spend that extra effort to "textualize" the myriad images in documents such as the ones you referenced - there is simply no payoff for them. 

 

So, what is one in your situation to do? Ranting will not help and will, in the long run, hurt your own interests. But, I am quite sure, there are at least a few people here who are more than willing to help you. Like Brian Fairchild did in the other thread, text versions to help you CAN be produced. I would certainly be willing to help.

 

Further, since you seem to be pretty proficient at both reading and creating text, any of us are more than willing to help via this forum.

 

I know that this does not help you, but I have had several blind and vision-impaired acquaintances over the years. Until pretty recently, text readers were a fantasy. These folks had to rely on braille and on sighted human readers. You are already so far ahead of where most of those earlier people would have been (actually, I think,  none would have even bothered to try).

 

So, I wish you the fortitude to not give up, to not succumb to anger over your challenges, and to have the presence of mind to simply ask. As I said, there are people here who are willing to help. That includes me.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Last Edited: Fri. Dec 14, 2018 - 08:49 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If you need assistance with a particular image or pdf and can post a link to it, I'm sure someone here will help describe it for you.

 

Fly Over Jim

 

 

Click Link: Get Free Stock: Retire early! PM for strategy

share.robinhood.com/jamesc3274
get $5 free gold/silver https://www.onegold.com/join/713...