Go Down

Topic: Upload program on mini pro without usb/rs232 converter (Read 591 times) previous topic - next topic

bpso

Feb 02, 2014, 05:17 pm Last Edit: Feb 02, 2014, 05:43 pm by bpso Reason: 1
Hi, I bought an arduino mini pro atmega328 5v. I haven't an usb/rs232 convert, but I have an arduino 2009. How can I use arduino 2009 to program the mini pro?
Attached there are the front and the rear view of the board.
On the rear view from the right corner to the left corner the pins are:
RAW, GND, GND, VCC, RXD, TXD, DTR, TXD
I tried to connect in this way:
mini pro                arduino 2009
GND                       GND
VCC                         5v
RXD                         RX
TXD                         TX
DTR                         RESET
when I press the reset button on arduino 2009 there seems to be a reset also on the mini pro (from the 2 onboard mini pro leds).
I tried to remove the atemega328 from arduino 2009 too, but I get the error avrdude: stk500_recv(): programmer is not responding. The program that I tried to load is the blink program because onboard there is a led on the pin 13.


cartoonist

Carefully remove the atmega328p from the 2009 board (when you leave it in the socket it will not work).
Connect reset from 2009 with reset on the mini pro, the other connections that you made are ok.
In tools choose mini pro 5V with atmega328/168 as your board.
And it should work.

bpso

I am on ubuntu 13.04.
I tried to connect also the 2009's reset to the mini's reset and to remove the atmega328 from the 2009.
I connected arduino 2009 to pc via usb and set arduino serial port to "/dev/ttyUSB0".
When I press upload the green led(should be on 13 pin) blinks a bit but the bar stay at about 90% for 5 seconds.
Then the ide show me "avrdude: stk500_recv(): programmer is not responding" message error.
I tried to change che arduino model in the ide but with similar results, and I tried also without removing the arduino 2009 microcontroller.
On the arduino pro mini there is a red led always on (I think power led) and a green led( I think on 13 pin) wich blinks with a period of about 30 seconds(15 on and 15 off, I think it's a preloaded program)
How to check if there is the bootloader?

cartoonist

The mega328p definitly must be removed from your 2009 board, otherwise there are 2 microcontrollers connected to the serial bus trying to communicate with your PC.
The serial port used for the mini-pro will be the same port as for your 2009 board if the board stays connected on the same USB-port.
Mini-Pro do normally have the bootloader inside.
The red led is the power led and always burns when power is supplied.
The blink program is preloaded on a new mini-pro and the blink rate of the green LED should be about 1 blink/second. If the blink rate of your new mini-pro led is as slow as you wrote, it could be a problem with the ceramic resonator on the mini-pro.


Maybe the communication-problem can be solved in the preferences.txt (often located in the hidden .arduino folder in home).
these are normal settings:
===============================
serial.databits=8
serial.debug_rate=9600
serial.line_ending=0
serial.parity=N
serial.port=/dev/ttyACM0
serial.stopbits=1
=================================
except for the serial.port=/dev/ttyACM0 which could be different on your machine.

Or maybe you changed the RX and TX wires , try to reverse them temporary.

CrossRoads

On Duemilanoive - connect Reset to Gnd, takes it out of the picture.
Connect Rx to Rx on promini, Tx to Tx, Gnd to Gnd, +5 to VCC.
Select "Promini with 5V" as board type if you haven't rebootloaded it into an Uno already.
Start IDE download - when it shows "Compiled xxx of 32xxx bytes", press Reset on the ProMini.
Might take a couple of tries to get the timing right.  Sometimes need to press & hold Reset, release when see the Compiled message, especially if a prior sketch was doing lots of serial.
Also easier if you select File:Preferences and turn on Verbose outputs.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

bpso

#5
Feb 07, 2014, 01:33 pm Last Edit: Feb 07, 2014, 01:58 pm by bpso Reason: 1
I tried but it doesn't work. With another identical mini pro same problem:

Configuration 1:
mini pro       2009
GND               GND
GND               GND
VCC                5V
RXD                RXD
TXD                TXD
DTR                RESET

Configuration 2:
mini pro       2009
GND               GND
GND               GND
VCC                5V
RXD                RXD
TXD                TXD
DTR                free
                      RESET <-> GND (and manual reset)

I tried also to invert tx with rx for both configuration.
Led blinking really slow on the other mini pro too.
VCC 5V is it correct? Or could be 3.3V? The seller say me that is a mini pro 5v atmeg328.
Could it be possible that there isn't the bootloader?
Here http://letsmakerobots.com/node/40026 he seems to have the same model and he said:
All the Pro Mini's I have bought on Ebay came without a bootloader. So I first bootloaded them with my USBasp.

cat .arduino/preferences.txt | grep serial
serial.stopbits=1
serial.databits=8
serial.parity=N
serial.port=/dev/ttyUSB0
last.serial.location=65,24,1285,1270
serial.debug_rate=9600



Log:

avr-g++ -c -g -Os -Wall -fno-exceptions -ffunction-sections -fdata-sections -mmcu=atmega328p -DF_CPU=16000000L -MMD -DUSB_VID=null -DUSB_PID=null -DARDUINO=103 -I/usr/share/arduino/hardware/arduino/cores/arduino -I/usr/share/arduino/hardware/arduino/variants/eightanaloginputs /tmp/build7736908212997066083.tmp/Blink.cpp -o /tmp/build7736908212997066083.tmp/Blink.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/wiring_digital.c.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/wiring.c.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/wiring_shift.c.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/wiring_analog.c.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/WInterrupts.c.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/wiring_pulse.c.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/Stream.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/USBCore.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/HID.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/WMath.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/IPAddress.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/Tone.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/HardwareSerial.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/CDC.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/WString.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/main.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/new.cpp.o
  Using previously compiled: /tmp/build7736908212997066083.tmp/Print.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/wiring_digital.c.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/wiring.c.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/wiring_shift.c.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/wiring_analog.c.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/WInterrupts.c.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/wiring_pulse.c.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/Stream.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/USBCore.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/HID.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/WMath.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/IPAddress.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/Tone.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/HardwareSerial.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/CDC.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/WString.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/main.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/new.cpp.o
avr-ar rcs /tmp/build7736908212997066083.tmp/core.a /tmp/build7736908212997066083.tmp/Print.cpp.o
avr-gcc -Os -Wl,--gc-sections -mmcu=atmega328p -o /tmp/build7736908212997066083.tmp/Blink.cpp.elf /tmp/build7736908212997066083.tmp/Blink.cpp.o /tmp/build7736908212997066083.tmp/core.a -L/tmp/build7736908212997066083.tmp -lm
avr-objcopy -O ihex -j .eeprom --set-section-flags=.eeprom=alloc,load --no-change-warnings --change-section-lma .eeprom=0 /tmp/build7736908212997066083.tmp/Blink.cpp.elf /tmp/build7736908212997066083.tmp/Blink.cpp.eep
avr-objcopy -O ihex -R .eeprom /tmp/build7736908212997066083.tmp/Blink.cpp.elf /tmp/build7736908212997066083.tmp/Blink.cpp.hex
Dimensione del file binario dello sketch: 1.072 bytes (su un massimo di 30.720 bytes)
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -carduino -P/dev/ttyUSB0 -b57600 -D -Uflash:w:/tmp/build7736908212997066083.tmp/Blink.cpp.hex:i

avrdude: Version 5.11.1, compiled on Oct 30 2011 at 10:41:10
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/usr/share/arduino/hardware/tools/avrdude.conf"
         User configuration file is "/home/user/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : arduino
         Overriding Baud Rate          : 57600
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

bpso

#6
Feb 07, 2014, 04:55 pm Last Edit: Feb 07, 2014, 05:43 pm by bpso Reason: 1
I'm trying to load the bootloader with the 2009 on the mini pro through isp.
Is it correct? green led blink with the same frequency, after tryied to load the bootloader the green led on boot arduino, become less brighter, but same frequency. If I reset or move a little the mini the led become again brighter.
I tried selecting arduino ISP and loading arduino ISP on the 2009, but I get this error:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P/dev/ttyUSB0 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m

avrdude: Version 5.11.1, compiled on Oct 30 2011 at 10:41:10
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/usr/share/arduino/hardware/tools/avrdude.conf"
         User configuration file is "/home/user/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

when programming the model in arduino IDE should be set on the 2009 or on the mini pro? I tryied both.

UPDATE:
Moving the mini a bit I get:

/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P/dev/ttyUSB0 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m

avrdude: Version 5.11.1, compiled on Oct 30 2011 at 10:41:10
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "/usr/share/arduino/hardware/tools/avrdude.conf"
         User configuration file is "/home/user/.avrduderc"
         User configuration file does not exist or is not a regular file, skipping

         Using Port                    : /dev/ttyUSB0
         Using Programmer              : stk500v1
         Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
         AVR Part                      : ATMEGA328P
         Chip Erase delay              : 9000 us
         PAGEL                         : PD7
         BS2                           : PC2
         RESET disposition             : dedicated
         RETRY pulse                   : SCK
         serial program mode           : yes
         parallel program mode         : yes
         Timeout                       : 200
         StabDelay                     : 100
         CmdexeDelay                   : 25
         SyncLoops                     : 32
         ByteDelay                     : 0
         PollIndex                     : 3
         PollValue                     : 0x53
         Memory Detail                 :

                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           eeprom        65    20     4    0 no       1024    4      0  3600  3600 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           flash         65     6   128    0 yes     32768  128    256  4500  4500 0xff 0xff
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           hfuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           efuse          0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           lock           0     0     0    0 no          1    0      0  4500  4500 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00
                                  Block Poll               Page                       Polled
           Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack
           ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
           signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

         Programmer Type : STK500
         Description     : Atmel STK500 Version 1.x firmware
avrdude: Send: A [41] . [80]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [02]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [81]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [01]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [12]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [98]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
         Hardware Version: 2
         Firmware Version: 1.18
         Topcard         : Unknown
avrdude: Send: A [41] . [84]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [85]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [86]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [87]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [89]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [00]
avrdude: Recv: . [10]
         Vtarget         : 0.0 V
         Varef           : 0.0 V
         Oscillator      : Off
         SCK period      : 0.1 us

avrdude: Send: A [41] . [81]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [01]
avrdude: Recv: . [10]
avrdude: Send: A [41] . [82]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [12]
avrdude: Recv: . [10]
avrdude: Send: B [42] . [86] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [00] . [80] . [04] . [00] . [00] . [00] . [80] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: Send: E [45] . [05] . [04] . [d7] . [c2] . [00]   [20]
avrdude: Recv: . [14]
avrdude: Recv: . [10]
avrdude: Send: P [50]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

bpso

I tried to make a cable to connect isp on 2009 to icsp on mini pro. (vcc,miso,mosi,sck,gnd,res).
Again:
/usr/share/arduino/hardware/tools/avrdude -C/usr/share/arduino/hardware/tools/avrdude.conf -v -v -v -v -patmega328p -cstk500v1 -P/dev/ttyUSB0 -b19200 -e -Ulock:w:0x3F:m -Uefuse:w:0x05:m -Uhfuse:w:0xDA:m -Ulfuse:w:0xFF:m

avrdude: Version 5.11.1, compiled on Oct 30 2011 at 10:41:10
        Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
        Copyright (c) 2007-2009 Joerg Wunsch

        System wide configuration file is "/usr/share/arduino/hardware/tools/avrdude.conf"
        User configuration file is "/home/user/.avrduderc"
        User configuration file does not exist or is not a regular file, skipping

        Using Port                    : /dev/ttyUSB0
        Using Programmer              : stk500v1
        Overriding Baud Rate          : 19200
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: Send: 0 [30]   [20]
avrdude: ser_recv(): programmer is not responding
avrdude: stk500_recv(): programmer is not responding

avrdude done.  Thank you.

I noticed that if connected with icsp, and with blink on 2009 both blink, but when they should be on they aren't completly, and when they should be off, they are a bit on.
What can I do? What programmer should i set in the IDE for 2009?

cider101

were you finaly able to upload ? I have the same minis as your pictures showes above and can't upload any sketches to them (with a cp21xx usb2serial)

Go Up