Page 1 of 1

BootloadHID & ATmega324pa

Posted: Fri Nov 11, 2011 2:11 pm
by hub.martin
Hi, I'm unable to get this combination working, any suggestions please?
I was able to run the HIDkeys example on the same hardware
bootloadHID.2010-07-29

Fuses BOOTSZ[0.1] = 00 set to 4kB bootloader by default, BOOTRST vector = 1 so the code should start in boot vector

Code: Select all

avrdude -c usbasp -p m324pa -U lfuse:w:0xe6:m -U hfuse:w:0xd8:m


In the makefile

Code: Select all

DEVICE = atmega324p
BOOTLOADER_ADDRESS = 7000


In bootloader config I set that the loader starts up everytime
D+ pin is also connected to the INT0 pin DP2

Code: Select all

#define USB_CFG_IOPORTNAME      B
#define USB_CFG_DMINUS_BIT      0
#define USB_CFG_DPLUS_BIT       1


static inline void  bootLoaderInit(void)
{
    //PORTD = 1 << 3; /* activate pull-up for key */
    _delay_us(10);  /* wait for levels to stabilize */
}

#define bootLoaderCondition()   (1)


in the Usbconfig.h I have set some defines to make sure the INT0 vector is set right

Code: Select all

 #define USB_INTR_CFG            EICRA 
 #define USB_INTR_CFG_SET        ((1 << ISC00) | (1 << ISC01))
/* #define USB_INTR_CFG_CLR        0 */
 #define USB_INTR_ENABLE         EIMSK
/* #define USB_INTR_ENABLE_BIT     INT0 */
 #define USB_INTR_PENDING        EIFR
/* #define USB_INTR_PENDING_BIT    INTF0 */

#define USB_INTR_VECTOR         INT0_vect



There's the same unanswered thread here http://forums.obdev.at/viewtopic.php?f=8&t=5708
I've also followed this thread where they says that I should compile code for non-P variants of chips, but there's no non-P variant for ATmega324
http://forums.obdev.at/viewtopic.php?f=8&t=4022

Any idea and suggestion very appreciated.
Thanks

Re: BootloadHID & ATmega324pa

Posted: Fri Nov 11, 2011 6:00 pm
by hub.martin
I forgot - all I get is device not recognised in WinXP.

Re: BootloadHID & ATmega324pa

Posted: Sun Nov 13, 2011 1:09 am
by hub.martin
Solved, I used different manufactured board and now it works perfectly. Maybe I blew something out on previous board because I was not also able to get UART work.