AVR ISP Programming (Tie GNDs together?) - Page 1
Forum section: electronics / general

author: Stonent
author_rank: Super Contributor
timestamp: July 09, 2013, 05:10:14 pm
content: I'm back to my small project of building a universal AVR programmer board on protoboard.Now I'm not a total n00b to this. I have programmed most of these chips on a breadboard using an ISP programmer, but for my board, I want to make sure it is done right. What I may have been doing on the breadboard might have worked but not been the right way to do it.Just a few questions (Pertaining just to programming, not general usage) :1. Some AVRs have more than 1 GND. Should those be tied together, or can just one be used?2. Some AVRs have both VCC and AVCC. Should those be tied together, or can just VCC be used?3. Finally, is there any functional difference between XTAL1 and XTAL2? Or as long as both pins are connected to my oscillator, it doesn't matter which one goes which way? (I will be using a 16Mhz 3 pin Ceramic resonator with the two outer pins being the clock output and the center is ground)And if it matters, I will be programming 40, 28, 20, 14, and 8 pin DIP chips, and as far as I can tell, in the Mega and Tiny series, chips with the same number of pins are wired the same as far as programming goes. (RST,GND,VCC,SCK,MOSI,MISO)

author: Unknown
author_rank: Unknown
timestamp: July 09, 2013, 05:30:08 pm
content: 1/2. All ground and power pins should be connected, otherwise odd things might happen (like pins on one of the ports not working under some conditions). AVCC is usually also used if you use the pins on that port for GPIO.3. You can treat the XTAL pins interchangeably unless you're using an external clock (which is different from an external crystal/resonator).There are some differences for the pinout even within a package. For example the ATmega162 and ATmega164p have different power pins. Same for the ATtiny2313 vs ATtiny26.

author: Kremmen
author_rank: Super Contributor
timestamp: July 09, 2013, 05:34:07 pm
content: 1. All grounds used and tied together. They are the grounds for diferent I/O bank supplies but Atmel usually doesn't specify which pwr/gnd pair supplies the core.So better do them all. And bypass caps too.2. If you don't use the ADC then you don't actually need the AVCC.3. Yes there is if you use an external oscillator (a true oscillator). Then you are supposed to connect it to a specific pin (i can't recall which but the data sheet will say). I take it you actually mean crystal/resonator. Then it won't matter because parallel resonators are connected symmetrically, cap to ground from bot XTAL1 and 2, and the actual xtal or resonator across the pins. A 3 pin resonator has internal caps to the ground pin.

author: Bored@Work
author_rank: Super Contributor
timestamp: July 09, 2013, 05:47:51 pm
content: Recommended reading:http://www.atmel.com/images/atmel-2521-avr-hardware-design-considerations_application-note_avr042.pdfBTW, it is ISP not ICSP. ICSP was mistakenly used by the clueless Arduino posers who couldn't even manage to get two headers aligned.

author: Unknown
author_rank: Unknown
timestamp: July 09, 2013, 05:52:15 pm
content: Quote from: Kremmen on July 09, 2013, 05:34:07 pmThis is wrong, at least for some AVRs. Check the datasheet. For example for the ATmega328p:Quote from: Page 4 if ATmega328p datasheet

author: Kremmen
author_rank: Super Contributor
timestamp: July 09, 2013, 06:04:10 pm
content: Thanks for the correction. I never actually checked and have left it unconnected in some designs with no ill effects.Lucky i guess.P.S. Yep, that one design used only a few pins (it was the 328P). Normally always with LC filter in AVcc.

author: Stonent
author_rank: Super Contributor
timestamp: July 09, 2013, 06:47:36 pm
content: I will be using this:I was specifically targeting the 2313 but now I see there's the 26... Now to figure out how to deal with it without having to add another socket.At first I was frustrated but then realized that the addition of the ADC in the 26 added to the need to make pinout changes.

author: Unknown
author_rank: Unknown
timestamp: July 10, 2013, 10:02:55 am
content: Look at the STK500. I think it has at least two copies of each socket, plus different programming headers, to cater for all the pin-out variations. And it still needs adapters for some DIP AVRs.

author: Jeroen3
author_rank: Super Contributor
timestamp: July 14, 2013, 06:29:50 pm
content: These considerations are worth the effort to look up before each design with a new chip.And not only look at the Datasheet (user manual usually doesn't supply these hardware considerations).But also take a look at Errata sheets (document with known product errors), application notes (example projects) and quality development boards. Like Keil, please note that there are a lot of crap devboards coming from China design.This can save you a pcb reproduction batch.

author: Vasi
author_rank: Regular Contributor
timestamp: July 26, 2013, 02:23:05 pm
content: Quote from: Bored@Work on July 09, 2013, 05:47:51 pmICSP mistake reveals the PIC programming background of at least one Arduino co-founder (Massimo, who worked in the past with PIC and JAL language) and it means In Circuit System Programming - but i guess you know what means.