Author Topic: AVR ISP Programming (Tie GNDs together?)  (Read 4531 times)

0 Members and 1 Guest are viewing this topic.

Offline StonentTopic starter

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
AVR ISP Programming (Tie GNDs together?)
« on: July 09, 2013, 05:10:14 pm »
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)
« Last Edit: July 09, 2013, 06:49:59 pm by Stonent »
The larger the government, the smaller the citizen.
 

alm

  • Guest
Re: AVR ICSP (Tie GNDs together?)
« Reply #1 on: July 09, 2013, 05:30:08 pm »
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.
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: AVR ICSP (Tie GNDs together?)
« Reply #2 on: July 09, 2013, 05:34:07 pm »
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.
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: AVR ICSP (Tie GNDs together?)
« Reply #3 on: July 09, 2013, 05:47:51 pm »
Recommended reading: http://www.atmel.com/images/atmel-2521-avr-hardware-design-considerations_application-note_avr042.pdf

BTW, it is ISP not ICSP. ICSP was mistakenly used by the clueless Arduino posers who couldn't even manage to get two headers aligned.
« Last Edit: July 09, 2013, 05:50:12 pm by Bored@Work »
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

alm

  • Guest
Re: AVR ICSP (Tie GNDs together?)
« Reply #4 on: July 09, 2013, 05:52:15 pm »
2. If you don't use the ADC then you don't actually need the AVCC.

This is wrong, at least for some AVRs. Check the datasheet. For example for the ATmega328p:

Quote from: Page 4 if ATmega328p datasheet
AVCC is the supply voltage pin for the A/D Converter, PC3:0, and ADC7:6. It should be externally connected to VCC, even if the ADC is not used.
 

Offline Kremmen

  • Super Contributor
  • ***
  • Posts: 1289
  • Country: fi
Re: AVR ICSP (Tie GNDs together?)
« Reply #5 on: July 09, 2013, 06:04:10 pm »
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.
« Last Edit: July 09, 2013, 07:27:14 pm by Kremmen »
Nothing sings like a kilovolt.
Dr W. Bishop
 

Offline StonentTopic starter

  • Super Contributor
  • ***
  • Posts: 3824
  • Country: us
Re: AVR ICSP (Tie GNDs together?)
« Reply #6 on: July 09, 2013, 06:47:36 pm »
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.
The larger the government, the smaller the citizen.
 

alm

  • Guest
Re: AVR ISP Programming (Tie GNDs together?)
« Reply #7 on: July 10, 2013, 10:02:55 am »
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 ;).
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4099
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: AVR ISP Programming (Tie GNDs together?)
« Reply #8 on: July 14, 2013, 06:29:50 pm »
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.
 

Offline Vasi

  • Regular Contributor
  • *
  • Posts: 60
  • Country: ro
    • Visual Pin Configurator for Nucleo L152RE - produces SPL code.
Re: AVR ICSP (Tie GNDs together?)
« Reply #9 on: July 26, 2013, 02:23:05 pm »
Recommended reading: http://www.atmel.com/images/atmel-2521-avr-hardware-design-considerations_application-note_avr042.pdf

BTW, it is ISP not ICSP. ICSP was mistakenly used by the clueless Arduino posers who couldn't even manage to get two headers aligned.

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


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf