Page 1 of 1

AVR-USB on ATmega88/168

Posted: Tue Oct 30, 2007 2:39 am
by avrusbnoob
Hi,

I'm kind of going crazy over here. Been fiddling for 24h now and I am getting nowhere.

I'm trying to get AVR-USB (HID) to work on a mega88. I'm doing something wrong here and i just can't find the problem.

I got a AVR-USB HID device working on a tiny45 just fine. With some instability though so i thought maybe I would try a mega88 with a 12 or 16MHz xtal and i also needed some more IO pins.

Unfortunately i cant find ANY working code AVR-USB HID code for the mega88 or mega168. Could someone _please_ post some working code for me?

Even better.. could someone check out my code ( http://pastebin.com/m232ba94e ) and figure out whats wrong with it? I can't for the life of me figure out what it is. Its just a stripped down version of the Automator code, that i found here on the forum, with some minor modifications.

I get a "usb device not recognized" message and my sanity check led is lighting up so the microcontroller and setup on the breadboard seems ok. An identical setup for the tiny45 works fine. Still i cant get the damn mega88 code to work. Going crazy here...

These are my fuse settings:
BOOTSZ=00
Boot reset vect enabled ($0000)
Brown-out 2.7 V
Ext. Full-swing Crystal 1K CK / 14 CK + 65 ms (tried all the fused delay combos)

Btw, Im using AVR Studio.

I hope that someone can shed some light on the situation here.

Thanks
noobie

Posted: Wed Oct 31, 2007 1:58 pm
by christian
Please check the AVR-Doper project. It has an option to compile for the ATMega88.

Posted: Thu Nov 01, 2007 12:15 am
by avrusbnoob
I checked it out the Doper code and it was way to messy and complex. I Gave it a shot with no success. :-(

I'm at a loss here guys.

I would be so much grateful if someone could help me out getting the Automator code working on the mega88.

I have a mega8 now that I'm playing with and the Automator code works fine with the current setup (with a mega8). But we need to use the 88 in our project and I have been trying to change the IO registers names for hours and hours to no avail.

I have been using the appnote "AVR094: Replacing ATmega8 by ATmega88" and still there is something I am missing.

I'm a straw away from just dumping the AVR-USB code that i have been using and talking about so warmly for the last weeks and just use an FTDI (USART-USB) instead like everyone else.

So if there are any ATmega-wizards out there that already have Automator code ready for the 88 or could put it together in a snap, please do so and share it. I would be eternally grateful.

Cheers
Lisa a tiered mega-n00b

Posted: Fri Nov 02, 2007 7:44 am
by Grendel
Could you add your makefile to the sources ?

Posted: Fri Nov 02, 2007 11:26 am
by christian
Another quick note: If you have the Mega88 with the "V" suffix, it's only specified up to 10 MHz and therefore not suitable for AVR-USB.

Posted: Fri Nov 02, 2007 1:09 pm
by avrusbnoob
Christian: I wish that was the problem but its not. I am not using the 'V' version. :-/

Grendel: Please ignore the source i posted a link to in the beginning. The original Automator code would be way better to port to the mega88 (if that was your intent).

Cheers
Lisa[/quote]

Posted: Fri Nov 02, 2007 10:19 pm
by Grendel
Nah, just making sure you changed -mmcu=atmega8 to -mmcu=atmega88 .. ;)