Pages: [1]   Go Down
Author Topic: how can I program ATMEGA328P using arduino pro mini  (Read 763 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I have arduino pro mini,
can I use it to program standalone ATMEGA328P?
do I have to use external oscillator? (or maybe I can use the mini for it)
the ATMEGA328P come with arduino boot-loader preloaded,
it is listed here:
http://www.ebay.com/itm/300878770733
thanks,
royi.
Logged

Offline Offline
Edison Member
*
Karma: 57
Posts: 2078
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

To upload a sketch, you need a usb-serial-ttl converter.
Sincy both the Mini Pro and the standalone don't have that, you need to buy an usb-serial-ttl converter.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4537
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I have arduino pro mini,
can I use it to program standalone ATMEGA328P?

Arduino-as-ISP should work.

do I have to use external oscillator? (or maybe I can use the mini for it)
the ATMEGA328P come with arduino boot-loader preloaded,
it is listed here:

If it has a bootloader then you'll need an external oscillator until you select a different clock source (with fuse bits). Any signal will do. There's a modified Arduino-as-ISP sketch that outputs a clock signal on a pin but I don't remember the link.

Logged

No, I don't answer questions sent in private messages...

vermont
Offline Offline
Sr. Member
****
Karma: 6
Posts: 261
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arduino-as-ISP should work.

he still needs a usb/serial converter or usbasp to load avrisp sketch. or if pc has an rs232 port an inverter can be made from couple transistors. then fuses can be changed so crystal is not needed.
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4537
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

he still needs a usb/serial converter or usbasp to load avrisp sketch.

I assumed he already had one if he's got a Pro Mini (you can't do much otherwise...)

Logged

No, I don't answer questions sent in private messages...

NSW Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 2293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

OK, so this is in the basket of typical "funny" questions that tend to get muddled along the way ...

It seems Royi has a Pro Mini and an ATMEGA328P with the bootloader, which is essentially the same chip as in the Pro Mini - or the Uno.

To load sketches, he needs the remaining components that make up a Pro Mini or a Uno, which are a power source (5V for 16 MHz operation), a crystal (presumably 16 MHz) and load capacitors (as per the circuits for those boards), a reset circuit and a USB to TTL converter.

The finer points are - the reset circuit - a resistor and 100 nF capacitor can be used as in the Pro Mini or Uno connected to the RTS line on the USB to TTL converter which itself is external to the Pro Mini or incorporated in the Uno.  Without this, a reset switch which is pressed and released at the moment when the download software starts its actual download or when the "data" indicators on the USB to TTL converter (if it has this) start flickering.

I assumed he already had one if he's got a Pro Mini (you can't do much otherwise...)
Dead right.

One presumes that if Royi has been using the Pro Mini, he already has the USB to TTL converter and has this process mastered.  Beyond this, the Pro Mini itself is not particularly helpful.  The "rig" to program the new ATMEGA328P can readily be constructed on a breadboard taking care to include the supply bypass capacitors (100nF plus 10µF on each side).
Logged

vermont
Offline Offline
Sr. Member
****
Karma: 6
Posts: 261
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

usb/serial dongle was not mentioned by op but if he does have one then technically no other components are required. use promini to program m328 for 8mhz and just tap pin 1 with finger or screwdriver to reset. of course crystals/resistors/caps make life easier but not essential.

or as op implied, just use the clock from promini in which case no avrisp or reprogramming required.
« Last Edit: July 30, 2013, 03:08:22 pm by john1993 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for all the answers,
I do have FTDI module.
when do I need to apply reset?
Logged

Valencia, Spain
Offline Offline
Faraday Member
**
Karma: 118
Posts: 4537
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

when do I need to apply reset?

That should be automatic.
Logged

No, I don't answer questions sent in private messages...

vermont
Offline Offline
Sr. Member
****
Karma: 6
Posts: 261
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

when do I need to apply reset?

chip must be reset just before download starts. originally this was done manually with a pushbutton but modern arduino use an rc on the dtr line to do it automatically as mentioned by fungus.
Logged

NSW Australia
Offline Offline
Edison Member
*
Karma: 33
Posts: 2293
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I do have FTDI module.
Figured you must have, in order to work with the Pro Mini.
when do I need to apply reset?
Basically, you need to simply "breadboard" the Pro Mini schematic with the 10k resistor and 100nF (= 0.1µF) capacitor (as well as the crystal and bypass capacitors, also a regulator if you need it) - on a little breadboard.  It is a good idea to have a reset switch as well for testing and development.

The "other" end of the 100nF capacitor on that diagram goes to the "RTS" or "DTR" connection on your FTDI module (there is some concern as to whether "RTS" or "DTR" is the more appropriate, but in practice either will work most of the time) and this causes the reset to be automatic when the download is to happen - as you should have been experiencing already with your Pro Mini.

If this does not work - though it should do so reliably with the FTDI, not to be confused with the "bodgie" USB to TTL boards which have a pin labelled "RST" which is useless unless the corresponding design blunder is corrected - first try swapping the Tx and Rx connections between the FTDI module and the breadboarded chip as there is some potential confusion as to which direction is which.

You can however use the reset switch instead by holding it while the sketch compiles and releasing it the moment you see the "Binary Sketch Size" message at the bottom of the Arduino IDE download window (corresponding to the first flashes of the "activity" LED if you have that on the FTDI).
« Last Edit: July 31, 2013, 06:55:10 am by Paul__B » Logged

Pages: [1]   Go Up
Jump to: