1
\$\begingroup\$

I am struggling with making a usb programmer for Atmega. I couldn't get my hands on a proper FT232L or something like that, but I did manage to find a serial to usb converter like this. This gets detected like a normal com port and is able to make work modems and printers. Will that do serial programming? There are serial programmers around which I have seen, work with ponyser as the programmer in the makefile. How do I make one?

Edit Through lsusb I have found out that the converter has a pl2303 inside (compatible with ft232r) so how do I do the programming now?

\$\endgroup\$
3
\$\begingroup\$

PC serial port programmers basically use the "handshake" (RTS/CTS DTR/DCD) pins of a serial port as a small parallel port. It often doesn't work with USB "virtual com port" devices because the USB device distorts the timing. The conventional wisdom is that USB adaptors "don't work" with PC serial port bitbang software that is expecting a hardware COM port (8250 UART), but I'm not 100% certain that someone hasn't gotten it working with a PL2303.

If you have an AVR chip preprogrammed with a serial bootloader, you could use your serial adapter (with a rs232->5v level shifter) to load programmer firmware onto the AVR, then use that AVR as a programmer (with appropriate firmware) to program other AVRs.

You can buy ATmegas with the arduino serial bootloader preloaded, or maybe you know someone with a programmer (or an arduino) who can burn a serial bootloader onto an ATmega for you?

\$\endgroup\$
  • 1
    \$\begingroup\$ I have a parallel port programmer but the problem is there are only usb ports on newer computers \$\endgroup\$ – Rick_2047 Mar 10 '11 at 2:32
  • 2
    \$\begingroup\$ @Rick_2407 with your parallel programmer, a borrowed computer and a blank AVR, you could burn the firmware (arduino.cc/playground/Code/MegaISP) for a serial-port programmer onto an AVR. You can then use that AVR and a USB-serial dongle to program other AVRs. \$\endgroup\$ – Christopher Biggs Mar 10 '11 at 6:49
  • \$\begingroup\$ @unixbigot that is my exact setup right now \$\endgroup\$ – NickHalden Jul 8 '11 at 13:29
3
\$\begingroup\$

AVR "serial" programming is in fact done over SPI. It's possible to bit-bang SPI using an FT232, which is why they're often used for this purpose.

There is an old trick to bit-bang SPI over the flow control lines of a real serial port. You might be able to achieve something similar with your USB converter.

http://www.ele.uva.es/~jesus/avrprg/powerless.html

\$\endgroup\$
  • \$\begingroup\$ But this is bit-banging, how will a converter do bitbaning. Is there a way to check if the bitbanging is working? \$\endgroup\$ – Rick_2047 Mar 9 '11 at 16:11
  • \$\begingroup\$ You need some custom software at the PC end to use the RTS/DTS lines as general purpose IOs \$\endgroup\$ – Toby Jaffey Mar 9 '11 at 16:19
  • \$\begingroup\$ I did an lsusb from ubuntu and I can confirm it is a PL2303 from inside. This is pin compatible with FT232R. So the connections inside have to be exactly like a normal connection. Can I achieve bitbanging through that? i.e without editing the circuit inside \$\endgroup\$ – Rick_2047 Mar 9 '11 at 16:23
3
\$\begingroup\$

I would suggest starting with a parallel port programmer. They are very easy to make and are rock solid. Of course you will need a PC with a parallel port.

Or if you can find someone with a working programmer (or a PC with a parallel port) you can build yourself an USBasp. It is easy to build and works with avrdude.

Having a (temporary) programmer you can also make an AVR910 programmer but as you can see on the page there is a little mess in the documentation. It takes normal RS232 (5V levels; use a MAX232) on one end and outputs AVR serial programming protocol on the other. There is even AVRospII - a nice Windows GUI for the thing. Some years ago we made several such programmers out of cell phone RS232 cables.

\$\endgroup\$
  • \$\begingroup\$ I second the idea of using a borrowed programmer (or a borrowed computer that works with the programmer you have) to make a USBasp or other avr-based programmer. Here's the one I built, complete kit was only €20 - shop.tuxgraphics.org/electronic/detail_avrusb500.html. Heck you can get a USBasp for $13 on ebay now. \$\endgroup\$ – Christopher Biggs Mar 10 '11 at 7:06
-1
\$\begingroup\$

I agree with previous speakers. That with YUSB devices the synchronization is distorted. Because of this, they use com ports for high-quality connection and data transfer. For AVR connection there are many options for data transfer. Here (https://www.virtual-serial-port.org/article/avr-and-pc-communication/) in the article there are several options for how to enlist AVR and PC.

\$\endgroup\$
  • 1
    \$\begingroup\$ 8 year old question, OBE by now. \$\endgroup\$ – CrossRoads Feb 1 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.