Is it possible to program an Attiny85 with a USB-to-TTL converter?

I currently use my Arduino to program Attiny85. As I have one of these USB-to-TTL adapters I am wondering if it is possible to program Attiny85 with it, to free up my Arduino. I know it is possible to program Atmega's with such a thing.

If it is in fact possible to use the converter as a simple programmer for Attiny's, how should I connect the converter to the Attiny?

You can only use this if you have a boot loader in the processor chip. You would connect it to the power, ground, TX, RX and reset lines of the processor. You might have to do that last one through a 0.1uF capacitor if there isn't one in the adapter.

Grumpy_Mike: You might have to do that last one through a 0.1uF capacitor if there isn't one in the adapter.

It's worse than that, Jim! Not only is there not the 0.1µF capacitor in the adapter (which there never is nor should be by definition in USB to TTL adapters), that one is a 5-pin device which does not even purport to have a DTR or RTS terminal.

Still, manual rest - with a button to ground and 10k pullup to supply, works quite fine. And of course, you have to figure out which are the UART pins on the Attiny85.

Attiny85 doesn't have built-in UART. I don't know if Software Serial supports TTL code uploading but I think not (depends on the bootloader as stated down).

This device has a USI port (Universal Serial Interface) which supports UART (check link). And you must find if someone has made any bootloader for this tiny uC.

Edit: A guy converted USI in UART half duplex for Attiny http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=512830

I don't know if Software Serial supports TTL but I think not.

Yes it does, what do you think TTL is? It is just logic levels.

I did say:-

You can only use this if you have a boot loader in the processor chip.

There are circuits in the 85 to allow you to do better than software serial but that has to be built into the boot loader.

Yea it supports TTL my bad. I meant I dont know if Software Serial supports code uploading.

As I said it is all down to the bootloader.

Grumpy_Mike:
As I said it is all down to the bootloader.

It follows that if you can implement Software Serial in sketches, the same routines (which are not usually a part of the bootloader) can be included in it for the purpose. You would not have to worry about providing buffering as the bootloading process is necessarily self-contained and regimented. You should even be able to implement it all using polling and without interrupts (using raw Assembler).

Have a look at the adafruit Trinket.

some time ago i wrote a 64 byte bootloader for tiny13 that also works unmodified on tiny24, tiny25, etc. (works on the mega versions too but theres little point to that). unfortunately my most convenient programming software only runs on real mode os so probably not of great interest to windows users. if anyone can produce a utility that simply wiggles dtr then sends a file out serial or modify avrdude to do this i will gladly post the avr code.

john1993: some time ago i wrote a 64 byte bootloader for tiny13 that also works unmodified on tiny24, tiny25, etc. (works on the mega versions too but theres little point to that). unfortunately my most convenient programming software only runs on real mode os so probably not of great interest to windows users. if anyone can produce a utility that simply wiggles dtr then sends a file out serial or modify avrdude to do this i will gladly post the avr code.

What messages and protocol is used for the serial communications? Depending on the protocol, it could be as simple as a shell script that uses stty to toggle DTR or RTS then pushes the data out a serial port. It could even provide a nice easy to use GUI with something like python, and/or tcl/tk.

Sorry windows users, your environment is just too wimpy for that kind of stuff.

--- bill

Thanks for all your feedback, I see it is more complicated that I thought. My ideas was simply this: 4 pins on Arduino are used to program the Attiny. If the USB-to-TTL converter could mimic the same digitial signals, it might be possible to bypass the Arduino and upload straight from the IDE. But there is obviously more to this, so I will just stick to programming it with my Arduino.

some time ago i wrote a 64 byte bootloader for tiny13 that also works unmodified on tiny24, tiny25, etc. (works on the mega versions too but theres little point to that). unfortunately my most convenient programming software only runs on real mode os so probably not of great interest to windows users.

I'm actually a Linux guy. Could you tell me a bit more, it sounds interesting!

Why not get a proper ISP programmer like this.

Riva: Why not get a proper ISP programmer like this.

Thanks for the link! I didn't know they were so cheap. Will order it right away :-)

marlar:
I’m actually a Linux guy. Could you tell me a bit more, it sounds interesting!

bperrybap:
What messages and protocol is used for the serial communications?

no protocol at all. simply send a file out serial. 5ms or so pause every 32 bytes might be nice but even that can be skipped if baud is low enough. the big advantage to adding something like this to avrdude is can work with hex, elf, binary, s19, or whatever, depending on what the target wants. the program dont care whats actually in the file.

i agree about wimpy windows. other description might be more accurate but this is a public forum, lol. unfortunately its defacto os so we are stuck. i could probably do this myself but considering the nightmare toolchain and the current utility works for me personally so not worth it for hobby use. mostly this is for the other guys out there who need a tiny serial bootloader. it was a cinch under msdos as can be seen here:

/*    binld1xx.c    reset then send serial bytes w/pause every 16words*/

#include <stdio.h>
FILE *RD,*WR;
unsigned int Port=0x3f8;
   
main() 
 { unsigned int g,i,j,k,Count=0,Len;
   unsigned char c,d,s[81],t[81],A[81];
   unsigned long h;
   printf("v1.02  BINLD (c) 1998 JPS Engineering\n");
   RD=fopen("t.hex","rb"); if (!RD) { puts("No file!\n"); exit(1); }
   outportb(Port+4,0); dlyms(100); outportb(Port+4,3); dlyms(100); /*reset*/
   while (1) 
    { t[2]=0; i=0; while (1) /*fil2buf*/
       { if (!fgets(s,81,RD)) break; 
         if (s[8]=='1') break;
         if (s[8]=='0')
          { s[7]=0; sscanf(s+3,"%x",&h); s[3]=0; /*hex2bin*/
            sscanf(s+1,"%xl",&Len); j=9; k=0; while (k<Len)
             { t[0]=s[j++]; t[1]=s[j++]; sscanf(t,"%02x",&g); A[i++]=g; k++; }
          }
       }
      Count=i; if (!Count) break; /*buf2ser w/pause every 16wrds*/
      i=0; while (i<Count) { if (!(i&0x1f)) dlyms(10); serout(A[i]); i++; }
    }
   puts(""); fcloseall(); return(0);
 }

dlyms(ms)
unsigned int ms;
 { unsigned long l;
   l=ms; l=l*475L; while (l--) inportb(Port);
   return(0);
 }

serout(chr)
unsigned char chr;
 { while (!(inportb(Port+5)&0x40)); outportb(Port,chr);
   return(0);
 }