Possible to use ATmega8u2 as general purpose microcontroller?

Here's my situation: I attempted to make a custom card in order to serve as a USB host and perform various other I/O functions. I found out after I had the cards produced that I did not choose the correct microcontroller for being a USB host, but I would still like to salvage these boards, if possible, for some other (non-USB) functionality, e.g. using the 8u2's ports as inputs / outputs.

My initial thought was to maybe treat 8u2 as an ATmega8. I found a bootloader for the ATmega8, burned that into flash, and then tried to download code via the normal FTDI / TX/RX route, setting the COM port to a baud rate of 19200 (which should match the bootloader). That did not work.

From what I've read, I now realize that the ATmega8u2 is very different from what I'm used to (e.g. ATmega328) in terms of bootloaders, how you download code, etc.

My question is this: Is there any way to salvage this hardware and get my boards functioning?

Thank you, Bryan

Well, clearly the ATmega8u2 - is not an ATmega8; there is a clear lesson here - check your datasheets for the actual model.

Secondly, you refer to a USB host. Well, none of the ATmegas used in Arduinox have USB host functionality, there is a shield which does that using a MAX3421E, so unless your board contains one of those, you could not expect such functionality.

That said, what you have built is presumably more like a Leonardo, albeit with a somewhat less capable chip, so that is where you should be looking for code. Programming for this is via the USB interface, so you need to get that wired accordingly.

Paul__B:
Well, clearly the ATmega8u2 - is not an ATmega8; there is a clear lesson here - check your datasheets for the actual model.

Agreed, and I’m not saying this attempt was a good one.

Secondly, you refer to a USB host. Well, none of the ATmegas used in Arduinox have USB host functionality, there is a shield which does that using a MAX3421E, so unless your board contains one of those, you could not expect such functionality.

I made a bad assumption that an Atmel chip with a built-in USB port could function as a host, and now I understand that not to be the case. Not something I’m proud of. The 2nd rev of my board uses a MAX3421E to implement the USB host functionality.

That said, what you have built is presumably more like a Leonardo, albeit with a somewhat less capable chip, so that is where you should be looking for code. Programming for this is via the USB interface, so you need to get that wired accordingly.

That’s very helpful, thank you. I will compare the Leonardo to what I’ve built and see if I can make something work.

Cheers,
Bryan