basic understanding of FTDI/USB-TTL/Fuses

Let me preface my request by begging forgiveness for any stupidity. There may be more than usual for me, the new years hangover is bad....

I've been tinkering for a while with Nano's and now want to move towards more of a low power/minimal footprint world. As a stepping stone I'll be tinkering with pro-mini's before finally taking the plunge into barebones. So Im going to be programming a mix of 5v and 3v3 solutions and possibly wanting to set fuse bits etc.

Im a little confused as to the capabilities/limitations of the various programming methods; FTDI cable, USB-TTL cable, using another arduino as a programmer. Is there a matrix or guide anywhere that explains things? I've checked the usual spots (gammon etc), but still have a somewhat muddled understanding.

Nano has a FTDI serial to USB on the circuit board, just like the older Duemilanove. On the UNO the functionality of the FTDI proprietary chip was replaced with a Atmel Atmega16U2 (version R3). The 16U2 is running Arduino code to manage the serial (on the Atmega328P-PU side) to USB (on the USB connector side.)

If one takes a UNO and removes the 16U2 and supplies a USB-serial module or a USB-serial cable USB-serial then what you really have is a Pro Mini. The uC is on a breakout board with some filtering capacitors and optionally a small voltage regulator BUT all of the serial-USB stuff is off the board.

The Leonardo takes the concept of USB-serial as on the UNO and utilizes a 32U4 and an Arduino bootloader that runs a version of LUFA - software that allows some Atmel silicon to provide the USB-serial interface without using additional onboard/offboard hardware.

Most Arduino (and clone) board in the Atmega328P-PU and upward categories have board locations for the 6-pin ISP connector. Using external hardware and the In-System Programming functionality, the uC can be programmed from the host computer without the uC requiring a bootloader ISP... ISP as you can see from the link is not just for Arduino but is utilized in a wide ranger of microcontroller products.

By not using a bootloader (and programming the uC over ISP) you regain the flash area of the uC and provide what may be a more stable programming experience. Additionally, if you are building product where the end-user is not required (allowed) to change the firmware, why have a serial bootloader?

Ray

Thanks, thats helpful. To check my understanding, is the following right?

To program the ATmega itself you can either use an external bootloader to free up flash space and make a cheaper/more secure final solution, or use an onboard bootloader (where present).

Options for external programmer:

  • another arduino+code
  • an FTDI cable/programmer?
  • AVR-ISP
  • STK5000 etc

Options for onboard bootloader (build dependant);

  • FTDI proprietary
  • 16U2 interface chip.

Is that right?

The bit i dont get is all the references to TTL levels, since if you can program an arduino from scratch using another arduino, surely thats more like CMOS levels?

To program the ATmega itself you can either use an external bootloader to free up flash space and make a cheaper/more secure final solution, or use an onboard bootloader (where present).

External bootloader ---> External flash programming device (bootloader is software!)

The architecture of the AVR processors such as the Atmega328 allows for bootloader firmware to write to user flash provided the fuses are properly set to indicate the bootloader is present and the appropriate size.

External devices used to program an AVR over ISP are in the class of AVRISP if they utilize the ISP pins on the uC.

The bit i dont get is all the references to TTL levels, since if you can program an arduino from scratch using another arduino, surely thats more like CMOS levels?

TTL levels (vs RS232 Protocol levels) are generally suggested as 0V to 5V (knowing that the logic level 0 is usually below 0.8V and any logic level above 2V is a 1). Read this Logic Levels

The entire CMOS issue comes in when you utilize the AVR outside of the 5Volts Vcc range... say, 3.3V... Now, you need to do some logic level shifting of those TTL signals before applying to the input of the 3.3V uC. (Newer processors designed solely for 3.3V often have pins that are 5V tolerant so that the additional cost of logic-level conversion is avoided.)

Ray
My Projects

Thanks, must be more careful about wording :slight_smile:

so for programming a pro-mini, you'd need something like an FTDI breakout (with appropriate voltage selection), a cable and the arduino IDE.

and for a basic atmega breadboard your options are:

  • another arduino + SPI to program the bootloader, then re-use the FTDI breakout to program it from the IDE.
  • external programmer (eg USBtinyISP) + arduino ide or avrdude

and thank you btw, for taking the time to reply......

ps. in my head CMOS was 5v and TTL was something higher. you can guess from that how long ago i tinkered properly with electronics :wink:

ps. in my head CMOS was 5v and TTL was something higher.

Generally, TTL should be thought of in this light. and thus is almost always assumed to be 5 Volts; historically, if for no other reason.

CMOS can work higher than the 5V, articles such as this once were common.

and thank you btw, for taking the time to reply

You will generally find the Arduino microcontroller forum to be "nice" but sometimes a bit "terse" when the Op is not specific enough... "enough" being in the eyes of the forum member responding. Just try and do a little research beforehand and include that in your question and the experience will be positive.

Ray
My Stuff

.

This has been the topic of a recent discussion/ argument.

The term "TTL" is frequently used - as here - to indicate 5V logic levels with a threshold of approximately 2.5V.

The problem is - the actual TTL logic levels and in particular, the threshold, are not that at all, as the article Ray cites, explains. In actual fact, real "TTL" levels closely match 3.3V CMOS levels.

Nevertheless, when people offhandedly refer to "TTL", they generally actually mean 5V CMOS levels.