Programming Atmel SMD

Hi there everybody,

I want to work with SMD uControllers, so I want to learn about ‘on chip programming’.

I’ve googled about it, however I have a few questions:

  1. What secondary circuit (programming circuit) do I need to add to my primary circuit (the target circuit for the runtime)? I supose it is different for each programmer… In that case, could you tell me about the circuit for Atmega 328P, for example? (it’s cheap and it sounds for me :wink: ).

  2. Can programming process cause damage on primary circuit? In that case, what I need to do for ‘isolating’ both circuits?

  3. If I’m not wrong, what I need is an external programmer (as a Arduino on ISP mode or an external PCB designed for that purpose) for connecting with the pins that are ready for the programming. Is there any example of this last kind of circuit for Atmega 328P?

  4. When uC code is built and compiled, what I need for standalone working? I’ve read that one capacitor and a crystal oscillator… And maybe some resistors. Something else?

Thank you on advance.

EDIT: Sorry for the bad topic selection

I take advantage of this edit for adding a new question (bonus track!):

  1. I know that is possible to use a USB/TTL (UART) converter for programming some Atmega uControllers… Is this possible for all kind of uCs? I suppose this solution is only valid when the uC has the bootloader, and for burning it is needed to use a special circuit. Maybe I’m wrong…

You have asked questions in the section of the Forum reserved for tutorials.

I have suggested to the Moderator to move your Thread somewhere more appropriate.

…R

Granted its no obvious, but you will find information on this with a Google search on;

'programming a bare bones arduino'

I've never programmed an AVR/Arduino without the bootloader but at work we have a couple of [u]JTAG[/u] programmers for in-circuit programming of a handful of different chips and a couple of stand-alone programmers for various older socketed flash and PLD chips.

Virtually everything "in production" is in-circuit programmed. The bootloader is a feature for hobbyists. The booloader is one of the coolest things about the Arduino... The board itself is the programmer and the development board so you don't have to buy (of configure) anything else to get started.

  1. What secondary circuit (programming circuit) do I need to add to my primary circuit (the target circuit for the runtime)?

You shouldn't need to add anything. (ICSP1 on the [u]Uno schematic[/u] does show a resistor & diode on the reset pin.)

Of course, you need the USB port if you want to use the bootloader.

I supose it is different for each programmer... In that case, could you tell me about the circuit for Atmega 328P, for example? (it's cheap and it sounds for me :wink: ).

Maybe, but usually you don't need much. The programmer hardware is usually standardized so it can work with many different chips. (Sometimes you'll find different connectors/adapters.)

  1. Can programming process cause damage on primary circuit? In that case, what I need to do for 'isolating' both circuits?

I've never seen anything damaged by programming. But, I've only used commercial programmers. Things could go wrong with a homemade one. Or, depending on your circuit design you could potentially make it fry itself, or fry something else, by running the "wrong" software. (Maybe with an input pin accidently programmed as an output, etc.?)

  1. If I'm not wrong, what I need is an external programmer (as a Arduino on ISP mode or an external PCB designed for that purpose) for connecting with the pins that are ready for the programming. Is there any example of this last kind of circuit for Atmega 328P?

Yes, you can build or buy a programmer. You can make a programmer with an Arduino, but of course you need an Arduino with the bootloader to get started.

  1. When uC code is built and compiled, what I need for standalone working? I've read that one capacitor and a crystal oscillator... And maybe some resistors. Something else?

You' have to study the [u]datasheet[/u]. I'm pretty sure there's a built-in oscillator so you don't really need an crystal, but if you're using USB or RS-232 you need an accurate clock. I'd suggest you build your prototype as a "complete circuit" (maybe copy the Arduino schematic) and then start removing parts.

  1. I know that is possible to use a USB/TTL (UART) converter for programming some Atmega uControllers... Is this possible for all kind of uCs? I suppose this solution is only valid when the uC has the bootloader, and for burning it is needed to use a special circuit. Maybe I'm wrong...

You should only need a "special circuit" if you are using the bootloader. Without a bootloader, the the special circuitry is built-into the programmer.

bivalvo:

  1. What secondary circuit (programming circuit) do I need to add to my primary circuit (the target circuit for the runtime)? I supose it is different for each programmer... In that case, could you tell me about the circuit for Atmega 328P, for example? (it's cheap and it sounds for me :wink: ).

Have a look at this Arduino on a breadboard tutorial. It deals with a DIP version of an Atmega 328 but the exact same advice should apply to the SMD versions.

...R

Robin2:
Have a look at this Arduino on a breadboard tutorial. It deals with a DIP version of an Atmega 328 but the exact same advice should apply to the SMD versions.

...R

I knew this page, but however, after read it, I'm still having the next question: can I display some pins on my 'primary' PCB in order to programming my Atmega 328P? Even if those pins are used on the main code? Or could it damage something?

bivalvo:
I knew this page, but however, after read it, I'm still having the next question: can I display some pins on my 'primary' PCB in order to programming my Atmega 328P? Even if those pins are used on the main code? Or could it damage something?

On every Arduino some of the I/O pins are used for uploading programs and also for use when the program is running. That is true whether you use the bootloader and upload code using the Serial interface or if you use the SPI pins for ICSP programming.

I thought that would have been clear from the breadboard tutorial.

...R