bugAVR Downloader/UploaDEr - Bugs: bug #26703, [Feature Request] Support device...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #26703: [Feature Request] Support device reset for 'arduino' programmer type

Submitter:  None
Submitted:  Thu 28 May 2009 04:42:26 AM UTC
Votes: 1
 
Category:  None Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Privacy:  Public
Assigned to:  mludvig Originator Name:  Mark Schultz
Originator Email:  -email is unavailable- Open/Closed:  Closed
Release:  None Programmer hardware: 
Device type: 

Tue 27 Jul 2010 06:13:13 PM UTC, comment #5: 

Timed out, assumed to be OK.

Joerg Wunsch <joerg_wunsch>
Group administrator
Sat 10 Oct 2009 01:47:16 AM UTC, comment #4: 

DTR/RTS reset support is in SVN now (r845). Please test it on Windows.

Michal Ludvig <mludvig>
Sat 08 Aug 2009 11:42:00 AM UTC, comment #3: 

A patch which implements the DTR and RTS reset sequences can be found in the patches section: https://savannah.nongnu.org/patch/?6866

Michael Dreher <nospam2000>
Wed 15 Jul 2009 10:22:46 PM UTC, comment #2: 

correction of my previous comment:
The signal of the FTDI is inverted (in the default configuration) , so it is in fact DTR# instead of DTR.

So the reset sequence becomes:
1. clear DTR (DTR#=+5V on the FDTI chip) for more than 2ms (suggestion: 50ms) to discharge C13 (100nF) via R1 (10kOhm).
This step should normally not be necessary when DTR is cleared when the COM device is closed, but especially for Bluetooth devices like the Bluegiga WT-11 of the Arduino-BT together with the Windows XP SP3 Bluetooth stack, DTR keeps its state when the device is closed 

2. set DTR (DTR#=0V on the FDTI chip) for more than 2ms to bring nRESET of the ATmega to a 0V level

3. clear DTR on exit (DTR#=5V on the FDTI chip) for more than 2ms. This is also especially for the WT-11.

Michael Dreher <nospam2000>
Wed 15 Jul 2009 09:00:18 PM UTC, comment #1: 

 > The RTS output is connected to AVR reset
 > via a 100 ohm resistor.

This resistor (R2) is not populated on the Arduino-Duemilanove boards (checked on a ATmega168 and a ATmega328 Duemilanove board).

The only way to reset a Arduino-Duemilanove board is the following sequence:
1. set DTR (+5V on the FDTI chip) for more than 2ms to discharge C13 (100nF) via R1 (10kOhm)
2. clear DTR (0V on the FDTI chip) for more than 2ms to bring nRESET of the ATmega to a 0V level

Michael Dreher <nospam2000>
Thu 28 May 2009 04:42:26 AM UTC, original submission:  

Background:

Most 'arduino' AVR development boards, such as the Arduino Duemilanove, use a FTDI USB-Serial converter with TxD and RxD outputs connected to the AVR USART RxD and TxD pins.  The FTDI FT232RL device appears as a standard serial port on the host, assuming appropriate drivers/OS support is installed.  The AVR device on these boards contains a bootloader that emulates a subset of the STK500v1 programmer protocol.  It is clear that the latest version of avrdude (v5.6) provides some native support for the Arduino bootloader, as evidenced by examination of both .conf file and the source code itself.

The Arduino bootloader is designed such that if it does not detect activity from the host shortly after reset, it will proceed to (attempt to) start the code in the application space.  This 'feature' can make it difficult (albeit by no means impossible) to program the device using avrdude, as one must manually assert reset (e.g. push the reset button), start avrdude, then release reset while avrdude is still attempting to handshake with the 'programmer'.

The newer Arduino boards, such as the Duemilanove, connect the FTDI FT232RL device RTS and DTR lines to the AVR device reset input.  The RTS output is connected to AVR reset via a 100 ohm resistor.  The DTR line is "AC coupled" to reset via a 0.1 uF capacitor.

Feature/Enhancement Request:

(minimal): When the 'arduino' programmer type is selected, have the programming init routine pulse the RTS line on the selected serial port HIGH-LOW-HIGH for a short period of time; 50 mS is suggested but it could be longer or shorter, it simply needs to be long enough to ensure that USB propogation delays are respected and the reset pulse is recognized by the target device.  It is also suggested that at the same time the DTR signal be unasserted (brought high).  I would think that this could be done near the start of the arduino_initpgm() routine, although I cannot say if this would be the 'appropriate' place to put it.

(better): Allow the reset= directive in the avrdude.conf file specify the serial port output signal to receive the high-low-high pulse treatment described above.  USe the 'programming indicator LED' setting(s) as well; this setting would specify a signal line that should be brought to one state (typically unasserted/HIGH) just before the reset pin is pulsed, and brought to the opposite state (typically asserted/low) after ALL device operations are completed (e.g. just before avrdude quits).  This second "programming indicator" signal specification should be optional, if not specified it would not be used or applied.

For either approach, avrdude should delay a bit following the reset pulse before attempting to communicate with the device; again, 50 mS is suggested, and it might not be a bad idea to make both the reset pulse delay and post-reset delay settable via avrdude.conf.  The 0.1 uF capacitor that is in circuit between the RTS output of the FTDI device and the AVR -reset input could introduce a short delay in assertion and/or negation of reset (via RTS), depending on what the state of the DTR output is when the reset pulse is applied.

The schematic for the Arduino Duemilanove board is available at:

http://arduino.cc/en/uploads/Main/arduino-duemilanove-schematic.pdf

An examination of this schematic will likely make the comments above more clear.

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attached Files
file #18208:  Arduino Duemilanove Schematic.pdf added by None (47KiB - application/pdf - Arduino Duemilanove schematic attached)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by joerg_wunsch (Posted a comment)
  • -email is unavailable- added by mludvig (Posted a comment)
  • -email is unavailable- added by nospam2000 (Posted a comment)
  • -email is unavailable- added by nospam2000 (Voted in favor of this item)
  • -email is unavailable- added by nospam2000
  • -email is unavailable- added by None (Submitted the item)
  •  

    There is 1 vote so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 8 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2010-07-27 joerg_wunsch StatusReady For Test Fixed
        Open/ClosedAnalyzed Closed
    2009-10-10 mludvig Assigned toNone mludvig
        Open/ClosedOpen Analyzed
        StatusNone Ready For Test
    2009-07-15 nospam2000 Carbon-Copy- Added nospam2000
    2009-07-15 nospam2000 Carbon-Copy- Added -email is unavailable-
    2009-05-28 None Attached File- Added Arduino Duemilanove Schematic.pdf, #18208

    Back to the top

    Powered by Savane 3.13-4448.
    Corresponding source code