USB-serial adapter as Arduino programmer?

Support for Pololu products that are not covered by one of the above categories.

USB-serial adapter as Arduino programmer?

Postby Jim Remington on Sun Jan 24, 2010 6:54 pm

I would like to use the Pololu USB-serial adapter (version 1.0) as a serial programmer for Arduino boards, which have a capacitor connected between the microprocessor reset line and DTR of the serial port (TTL levels). The programmers I've seen use the FTDI USB adapter.

Does the Pololu USB-serial adapter (which uses the CP2102 chip) and Windows driver support a low pulse on the DTR line? Or might *RST perform this function? Has anyone used this adapter to program an Arduino board?

Thanks, Jim
Jim Remington
 
Posts: 110
Joined: Mon Aug 21, 2006 11:32 pm
Location: Eugene,OR

Re: USB-serial adapter as Arduino programmer?

Postby nexisnet on Mon Jan 25, 2010 6:47 am

Hi Jim,

You should definitely be able to use the Pololu (or any CP2102-based) USB to Serial adapter as an Arduino programmer, right from the Arduino sketching environment (I've done this once before when I was messing around with adapting the Arduino bootloader to run on an Orangutan). The DTR pin on the adapter is normally high, and the Arduino environment will assert DTR, bringing the DTR pin low, to reset the board before programming.

One thing to keep in mind is that high for a CP2102 is 3.3V, so if you're using a 5V Arduino you should probably throw in a current-limiting resistor.

-Adam
User avatar
nexisnet
 
Posts: 1215
Joined: Mon Mar 21, 2005 9:29 pm
Location: Boston, Massachusetts

Re: USB-serial adapter as Arduino programmer?

Postby Jim Remington on Fri Jan 29, 2010 8:28 pm

Adam:

Indeed, the Pololu USB-serial adapter works perfectly as an Arduino board programmer. I wired the adapter as recommended for the FTDI chip and wrote a batch file that executes the Arduino version of avrdude. I've read that only certain later versions of Arduino avrdude support toggling the DTR line as *RESET.

I reassigned the Pololu serial port driver to be COM1 (My Computer > properties > hardware > Device Manager > Pololu USB-serial> properties > port settings > advanced), and executed flash.bat from the command line to program.

flash.bat contains the single line:

C:\arduino\hardware\tools\avr\bin\avrdude -p atmega328p -P COM1 -c stk500v1 -b 57600 -CC:\arduino\hardware\tools\avr\etc\avrdude.conf -U flash:w:main.hex

It is probably possible to build this command into WinAVR, but I haven't researched it. The WinAVR version of avrdude may not work, as it supposedly does not know about toggling DTR.

Cheers, Jim

BTW I'm working with the SparkFun Openlog data logger, which is fun to play with. Presently it only logs TTL-RS232 data. If it had more I/O lines, at $24.95 it would be extremely interesting.
Jim Remington
 
Posts: 110
Joined: Mon Aug 21, 2006 11:32 pm
Location: Eugene,OR


Return to Other Pololu Products

Who is online

Users browsing this forum: No registered users and 2 guests