BootLoadHID and Mega16 problem

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
alexn
Posts: 6
Joined: Thu Jun 05, 2008 1:50 pm

BootLoadHID and Mega16 problem

Post by alexn » Fri Aug 28, 2009 8:56 am

Hi, All.

I've tried to use BootLoadHID with ATMEGA16 device and mini-USB (B-type) connector. This does not work.
I changed the makefile, setting

DEVICE = atmega16
BOOTLOADER_ADDRESS = 3800

D+ is wired to PD2, D- to PD1
The programming mode jumper is on PD0

The code is changed to:

Code: Select all

static inline void  bootLoaderInit(void)
{
char i;
    PORTD = 1;      /* activate pull-up */
    for(i=0;i<10;i++);  /* delay to allow pin voltage to stabilize */
}

#define bootLoaderCondition()   ((PIND & 1) == 0)


Code: Select all

#define USB_CFG_IOPORTNAME    D
#define USB_CFG_DMINUS_BIT      1
#define USB_CFG_DPLUS_BIT        2


The device appears as "unknown USB device" that means that USB is not functional.
What else could be wrong ?

The crystal is 12 MHz, all other values are default.

VYTAS

Re: BootLoadHID and Mega16 problem

Post by VYTAS » Thu Feb 18, 2010 12:27 am

HI I'am going to do the same fing. Do you reset atmega after boot PIN set to ground?

Arkanoid

Re: BootLoadHID and Mega16 problem

Post by Arkanoid » Fri Mar 05, 2010 12:34 pm

alexn wrote:The device appears as "unknown USB device" that means that USB is not functional.
What else could be wrong ?


Hi!

BootLoadHID works fine with ATmega16, but only for:

Code: Select all

#define USB_CFG_IOPORTNAME    D
#define USB_CFG_DMINUS_BIT      0
#define USB_CFG_DPLUS_BIT        2


I don't know why. Any suggestion?

Vytas

Re: BootLoadHID and Mega16 problem

Post by Vytas » Sat Mar 13, 2010 9:58 am

I use folowing settings:

Code: Select all

#define USB_CFG_IOPORTNAME      D
/* This is the port where the USB bus is connected.

#define USB_CFG_DMINUS_BIT      3
/* This is the bit number in USB_CFG_IOPORT where the USB D- line is connected.

#define USB_CFG_DPLUS_BIT       4
/* This is the bit number in USB_CFG_IOPORT where the USB D+ line is connected.


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

#define bootLoaderCondition()   ((PIND & (1 << 5)) == 0)   /* True if jumper is set */




I conected wire betwen -D (PORT3) and RXT on my atmega16 and it started to work. In pdf of atmega16 found that

"Entering the Boot Loader takes place by a jump or call from the application program.This may be initiated by a trigger such as a command received via USART, or SPI interface."

alexn
Posts: 6
Joined: Thu Jun 05, 2008 1:50 pm

Re: BootLoadHID and Mega16 problem

Post by alexn » Sat Mar 13, 2010 10:03 am

VYTAS wrote:HI I'am going to do the same fing. Do you reset atmega after boot PIN set to ground?


Hello.

I do not use RESET at all. My problem was simple - bad electrical contact. It was hard to find, however.
Now everything works fine, and I'll soon make a WEB page of another proto board. Now with SD card slot
and Mega16 chip.

Post Reply