AVR-USB and atmega88
Posted: Tue Oct 02, 2007 6:52 am
hey guys, just need a bit of a hand getting the powerswitch project working on an atmega88 chip. i only needed to modify a small amount of the code in order to get it to compile since the registers are a little different from the 90s2313 --
the settings in usbconfig.h seemed to be ok, nothing needed to be modified. however, two lines also needed to be commented out in order to compile, as it couldn't find their definition (usbdrv.c):
the assembly source file i'm using is usbdrvasm.S.
anyway for some reason, having done all that, it just says 'device malfunctioned, or cannot be recognised' when connected to a windows pc.
am i missing something?
thanks for your help.
Code: Select all
static void eepromWrite(unsigned char addr, unsigned char val)
{
while(EECR & (1 << EEPE));
EEARL = addr;
EEDR = val;
cli();
EECR |= 1 << EEMPE;
EECR |= 1 << EEPE; /* must follow within a couple of cycles -- therefore cli() */
sei();
}
static uchar eepromRead(uchar addr)
{
while(EECR & (1 << EEPE));
EEARL = addr;
EECR |= 1 << EERE;
return EEDR;
}
the settings in usbconfig.h seemed to be ok, nothing needed to be modified. however, two lines also needed to be commented out in order to compile, as it couldn't find their definition (usbdrv.c):
Code: Select all
GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_HID, usbDescriptorConfiguration + 18)
GET_DESCRIPTOR(USB_CFG_DESCR_PROPS_HID_REPORT, usbDescriptorHidReport)
the assembly source file i'm using is usbdrvasm.S.
anyway for some reason, having done all that, it just says 'device malfunctioned, or cannot be recognised' when connected to a windows pc.
am i missing something?
thanks for your help.