With a serial port or parallel port in pc programming avr microcontroller is very easy and cheap. Problem is, no modern computer come with serial or parallel port. So, usb to serial converter should be the solution but unfortunately not.
There must be a difference between the actual serial port and converted serial port. What is it?
Another related question would be, how USBasp communicate almost directly with pc? I thought most or all of the microcontroller of ATmega series microcontrollers are without usb support.
I have checked this link-
AVR programmer with serial to USB converter
I know there are several question like this but being new to embedded programming I need an easy explanation to get the concept. Thanks.
Edit:
I want to use a circuit as below with the converted serial (possibly, RS232) interface.This circuit is designed for actual serial port.With a converted serial port, I might be able to reduce some complexity of the circuit.
The detail can be found at Simple Serial Programmer for AVR
Best Answer
The serial programmer you are using is using serial port to connect to computer, but not the standard RS232 protocol! Take a closer look at the schematic:
DTR and RTS are the only pins of the serial port that can be bitbanged. But there is the need for a reset signal. The designer of that adapter uses a trick. He sends a 0x00 character with no stop bits over standard RS232 TX, thus creating a short reset pulse (which for some MCUs need to be inverted).
The actual data on a standard serial RS232 communication is actually sent only via Rx/Tx lines. All the others are accessory lines used by devices to signal different states of operation or to signal data availability or transfer termination.
This is the problem with USB-serial adapters. Most of them can only use Rx/Tx lines and of course, only serial RS232 (asynchronous) protocol, which is by no means compatible with AVR programming protocol (SPI, synchronous). So the only way to communicate via serial port by SPI is to use alternate lines and emulate the protocol in software.
You can see on this forum that in some cases it works with USB-serial adapters, but in most situations it doesn't.
What do you say about: ATmega 8U2, 16U2, 16U4, 32U2, AT90USB1286, AT90USB1287, AT90USB162, AT90USB646, AT90USB647, AT90USB82. Full list from here.
But USBasp is not using one of those MCUs! Looking at its schematic we can see that it uses a pull-up resistor on the D- line, which means it signals the PC that it is a low speed device (1.5 Mb/s). And it software emulates USB bus over a general use I/O port (can be seen in AVR firmware source code - file
usbconfig.h
):