Programming ATMEGA 328P-AU

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
Lord_Chaos
 
Posts: 13
Joined: Sat Dec 13, 2014 3:30 pm

Programming ATMEGA 328P-AU

Post by Lord_Chaos »

Hello, everyone,

with your help i was able to get my usbtinyisp to worp with an atmega 328p-PU Chip. Because my Project needs to get smaller i'm thinking of using the SMD Version of the chip.

Is it possible to use the Programmer with a 328p-AU using an adapter like this one:
http://www.reichelt.de/PLCC-Sockel/PLCC ... nr=PLCC+32
If yes can i use the same Chrysal and Kapazitators i need fpr the 328 Programming?

User avatar
nsayer
 
Posts: 59
Joined: Thu Aug 08, 2013 10:45 am

Re: Programming ATMEGA 328P-AU

Post by nsayer »

You can use sockets to program them externally, but you would be very, very well advised instead to design your board to provide for ISP - that is, in-situ programming. The idea is that you build the board with blank components and then program them once construction is complete.

For SMD controllers, ISP is really the only feasible way to reprogram them if you ever want to update the firmware. The only alternative is desoldering them, reprogramming them and replacing them - way, way more trouble than it's worth, and you really could only do it once or twice before damaging either the chip or the board.

This even applies to socketed through-hole controllers as well: Constantly removing the chip to reprogram it puts excessive stress on the pins of both the chip and socket - eventually one or the other will break.

Providing for ISP is really not terribly difficult. You need to bring 6 of the pins of the controller to a 2x3 DIP header on the board. For truly space constrained designs, there are proprietary reduced footprint ISP adapters that you can use, though most of them use the standard 2x3 footprint for wider compatibility. You can even leave the header unpopulated and use a pogo pin adapter for programming.

Atmel has an application note that talks more about ISP recommendations. For ISP to work properly, you must insure that you don't connect the ISP pins of the controller to low impedance loads, lest they interfere with the programming process. Atmel recommends placing a 1k resistor between such loads and the controller pin, and placing the ISP socket on the "near" side of the resistor. This applies to the MOSI, MISO and SCK pins. The only other potential gotcha is to insure that the rest of the hardware can reliably survive the programming process. During programming, the non-ISP lines will be high impedance (virtually disconnected). I ran into this with one project where I had a transistor H bridge type design. Such designs require an input that is held to either a high or low level at all times, lest the transistors wind up *both* being on, which would short a power supply. If you have circuitry like that, then you must either pull the output up or down externally or insure that that power supply is not present during programming.

User avatar
Lord_Chaos
 
Posts: 13
Joined: Sat Dec 13, 2014 3:30 pm

Re: Programming ATMEGA 328P-AU

Post by Lord_Chaos »

Hello,

sorry that my answers comes so late by my english is not so good so it took some time.

Thank you for the adwise that is a simple but good idea :D

Locked
Please be positive and constructive with your questions and comments.

Return to “USBtinyISP”