ATmega32A with bootloader

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello, i'm trying to use BootloadHID with my ATmega32A. Schematic is similar, like here: 

 

There are no D1/D2; R1/R2 - 47R. ATmega runs on 3V3 with 16MHz ext. crystal. D- is connected to PD7, D+ to PD2.

The only thing I changed in makefile is:

 

DEVICE = atmega32
BOOTLOADER_ADDRESS = 7800
F_CPU = 16000000

There is jumper on PD3 aswell.

Fuses: External crystal, boot reset vector enabled, boot flash 2048 words, SPI/JTAG enabled;

low 0xCF; high 0x98.

 

I'm just getting "descriptor request failed" on Win10, and on linux:

 

[  251.863012] usb 2-2: new low-speed USB device number 5 using xhci_hcd
[  252.031028] usb 2-2: device descriptor read/64, error -71
[  252.303009] usb 2-2: device descriptor read/64, error -71
[  252.519023] usb 2-2: new low-speed USB device number 6 using xhci_hcd
[  252.687048] usb 2-2: device descriptor read/64, error -71
[  252.959077] usb 2-2: device descriptor read/64, error -71
[  253.175043] usb 2-2: new low-speed USB device number 7 using xhci_hcd
[  253.175530] usb 2-2: Device not responding to setup address.
[  253.379489] usb 2-2: Device not responding to setup address.
[  253.583039] usb 2-2: device not accepting address 7, error -71
[  253.695047] usb 2-2: new low-speed USB device number 8 using xhci_hcd
[  253.695530] usb 2-2: Device not responding to setup address.
[  253.899525] usb 2-2: Device not responding to setup address.
[  254.102996] usb 2-2: device not accepting address 8, error -71
[  254.103036] usb usb2-port2: unable to enumerate USB device

To figure out where is the problem, I flashed HIDSerial application and it worked just fine, device showed up in HID interfaces and HIDSerial win app worked aswell. So definately, it's not wiring problem. Either it's fuses or wrong configuration in makefile?

 

Also, interesting fact: I got two of these ATmega32A's, it was cheap ~1$ in ebay, but when I tried to flash through optiboot, I was getting verification errors on both of them. However, ISP works just fine.

Last Edited: Wed. Jan 11, 2017 - 02:38 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What happens if you add back in the missing parts?   Why do you think they are not needed?

 

Jim

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

To understand what those Zeners are doing there I think it's fairly important you read this:

 

http://vusb.wikidot.com/hardware

 

BTW wouldn't life be a while lot simpler if you replaced the meag32 with something like a mega32U2 or mega32U4 ? (then you don't need to "fake" USB).

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ki0bk wrote:

What happens if you add back in the missing parts?   Why do you think they are not needed?

 

Jim

 

 

In that schematic, ATmega is powered from 5V source, but i'm powering it from 3V3 so there is no need for any voltage-drop diodes/zeners. And as I mentioned, HIDserial works just fine(I didn't changed any wiring).

 

clawson wrote:

To understand what those Zeners are doing there I think it's fairly important you read this:

 

http://vusb.wikidot.com/hardware

 

BTW wouldn't life be a while lot simpler if you replaced the meag32 with something like a mega32U2 or mega32U4 ? (then you don't need to "fake" USB).

 

It would be, but I need use these ATmega's too.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Why? What peripheral is it that a meag32A has that a mega32U2/mega32U4 does not have? The downside of V-USB and other software emulations of USB is that they consume a large part of the CPU bandwidth and may compromise whatever else it is the CPU is actually supposed to be doing when it's not listening for USB activity. An AT90USB class of AVR has a USB peripheral that works alongside the CPU and removes this workload.

 

I'd just pick the right tool for the job. Not much point trying to take a tractor along to a drag race!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

clawson wrote:
Not much point trying to take a tractor along to a drag race!

Apparently you have never been to the Alto Fair:

http://www.altofair.com/

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

but i'm powering it from 3V3

and

F_CPU = 16000000

don't go well together.

John Samperi

Ampertronics Pty. Ltd.

www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Also, a 3V3 powered MCU does NOT fit with USB which is a 5V signal. Big time problem. Zener diodes are a mediocre (also known as half-assed) solution. But, they are necessary if your MCU is going to survive.

 

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net