AVR-USB on ATmega88/168

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
avrusbnoob
Posts: 3
Joined: Tue Oct 30, 2007 1:19 am

AVR-USB on ATmega88/168

Post by avrusbnoob » Tue Oct 30, 2007 2:39 am

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

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Wed Oct 31, 2007 1:58 pm

Please check the AVR-Doper project. It has an option to compile for the ATMega88.

avrusbnoob
Posts: 3
Joined: Tue Oct 30, 2007 1:19 am

Post by avrusbnoob » Thu Nov 01, 2007 12:15 am

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

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Post by Grendel » Fri Nov 02, 2007 7:44 am

Could you add your makefile to the sources ?

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Post by christian » Fri Nov 02, 2007 11:26 am

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.

avrusbnoob
Posts: 3
Joined: Tue Oct 30, 2007 1:19 am

Post by avrusbnoob » Fri Nov 02, 2007 1:09 pm

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]

Grendel
Rank 4
Rank 4
Posts: 167
Joined: Sat Dec 16, 2006 9:53 pm
Location: Oregon, USA
Contact:

Post by Grendel » Fri Nov 02, 2007 10:19 pm

Nah, just making sure you changed -mmcu=atmega8 to -mmcu=atmega88 .. ;)

Post Reply