Use ATtiny85 as USB interface?

I really like the 45/85 AVR, it's pretty powerful in a tiny (sic) DIP 8 package for less than $2. I already built a USBtinyISP with it and it works reasonably well(it stutters sometimes).

After having found several references to a USB-serial implementation, I stumbled upon this page that has an USB to serial application described in detail.

Would it be feasible to do this and obtain USB-serial connectivity to a home-grown controller? For example if I were to use the ATtiny85, connected to USB and to the TX/RX pins of an ATMEGA328P, would it work for monitoring Serial on the ATMEGA?

BTW, this post touches on a similar issue.

Thanks for any comments.

somedude:
Would it be feasible to do this and obtain USB-serial connectivity to a home-grown controller?

im also curious. my attempts with m8 failed and a couple others i know gave up due to confusion and complication. it would be interesting to see if anyone succeeded with this potentially useful utility.

somedude: Would it be feasible to do this and obtain USB-serial connectivity to a home-grown controller?

'85 as USB interface?

Isn't that the definition of the "Digispark Kickstarter"?

Paul__B: '85 as USB interface?

Isn't that the definition of the "Digispark Kickstarter"?

That looks just about right, now does in come in a DIY flavour? ;) I might just try the micronucleus bootloader on mine, I already built the hardware for the USBtinyISP with the same layout.

This is what I used to build mine.

Thank you, Paul.

there is a big difference between avr as serial converter (cdc) and avr with usb programming interface (hid/libusb). both in usefulness and implementability.

john1993: there is a big difference between avr as serial converter (cdc) and avr with usb programming interface (hid/libusb). both in usefulness and implementability.

True, but only on the AVR side. The USB side is the same. So if I connect to the UART instead of SPI, it changes from a programmer into a serial.

unfortunately thats not what really differentiates a serial converter from programming interface. its the usb protocol stack which must comply with windows standard. not a trivial task. then there is that whole driver id signing and host/client issue. afaik no serial converter similar to ftdi/cp2102 has ever been implemented on a basic avr.

unless im mistaken this is what your 2 links in 1st post here refer to and no easy solution. i wish there were as serial converters are a mainstay in most projects these days.

I would have to assume that if both devices ( USB and ISP ) work, then the USB implementation is reasonably compliant.
It works well for the 16U2 used in Arduino, right? I know that’s no hack and it’s a well done, supported and signed implementation, but it still uses an MCU.

I will still try it. Worst case, I’m out a couple of bucks for a true USB adapter.
That’s the beauty of an AVR, it can easily be repurposed.

16u2 with built in application specific usb hardware is a far cry from basic avr. additionally arduino with help from atmel had big clout in the area of driver signing and development. but even they never managed to develop a converter based on generic avr. generally the obstacles deal not so much with avr firmware but windows programming which is beyond my level of competence. if you succeed you will truly be a hero. please keep updating on progress.

The sw implementation of sub on a tiny85 is not really compliant in any meaningful way. It just happens to work, just barely. It is also a " low speed device", while a cdc interface is by definition a full speed device. You might be able to get a sw sub implementation to appear as a com port if you were to write a very customized PC-side driver, but that would be a lot of work.

Thanks guys.

Well know this isn't going to go beyond the simple low speed v-usb implementation (CDC) that the 85 is capable of. Not only am I unable of doing this myself, but I can't even justify the effort. But it's worth a try.

a cdc interface is by definition a full speed device.

Oops. So the article linked in the OP does in fact address this issue, and apparently includes a patch of some kind for the windows CDC implementation (for some versions of windows, anyway.) And they claim it works there and on other OSes. http://www.recursion.jp/prose/avrcdc/cdc-232.html

if I were to use the ATtiny85, connected to USB and to the TX/RX pins of an ATMEGA328P, would it work for monitoring Serial on the ATMEGA?

Assuming the article is accurate, yes, I guess that it could mean that. Note that the tiny85 doesn't have a HW UART either, so that would have to be done in SW as well, and I suspect that it would be impossible to do UART IO and USB IO at the same time, or to avoid needing to do so...