USB QUERY

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

I have used atmega32u4 which supports native usb, when i connect the usb to pc no pop up notification appears. my understanding is that 32u4 virgin chip has usb dfu flashed.

so when it is connected to pc it should appear as atmega32u4dfu device, but when i connect nothing happens. when i referred usb self powered 3.3v topic the uvcc pin was left floating but in my schematic its tied to vcc. Also tried hbe pin to reset so it executes bootloader but it was of no use.

Is the uvcc pin causing the trouble or some design flaw in my schematic .

Any suggestion would be helpful, thanks in advance.

 

This topic has a solution.
Last Edited: Tue. Dec 26, 2017 - 08:10 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you really mean to write the whole post in bold ?

 

udayAKUMAR123 wrote:
my understanding is that 32u4 virgin chip has usb dfu flashed

I couldn't see that mentioned in the datasheet ...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

udayAKUMAR123 wrote:
my understanding is that 32u4 virgin chip has usb dfu flashed

I couldn't see that mentioned in the datasheet ...

Datasheet, page 1 : "Parts using external XTAL clock are pre-programed with a default USB bootloader"

 

udayAKUMAR123, possible problem may be the value for R11 in your schematic.

10 kOhm with internal pull-up of 20k..50k don't guarantee proper logical 0 level to start bootloader.

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

Aha - I just searched for, "DFU".

 

But it just says, "a bootloader" - it doesn't say that it's USB-DFU specifically...

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Andy almost all the AVRs with USB interfaces come preloaded with the same DFU as documented in AVR1916 and then expect the "Flip" utility on the PC to be used to send data to it using the USB Device Firmware Update (DFU) class.

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

 

awneil wrote:

 

 

 

udayAKUMAR123, possible problem may be the value for R11 in your schematic.

10 kOhm with internal pull-up of 20k..50k don't guarantee proper logical 0 level to start bootloader.

 

 

 

Forget the hwb pin the usb should be detected by default if its running in usb dfu mode.

Last Edited: Mon. Nov 27, 2017 - 11:01 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

udayAKUMAR123 wrote:
Forget the hwb pin the usb should be detected by default if its running in usb dfu mode.

If the BOOTRST is not programmed, the HWB pin needs to be low at reset when reset goes high to enter the bootloader, otherwise the chip will try to start at the application area.

The default BOOTRST is unprogrammed (reset vector @ 0x0000).

 

Edit: strikethru, add "when reset goes high"

David (aka frog_jr)

Last Edited: Mon. Nov 27, 2017 - 02:11 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm just a bit mangler but won't a 10K pull down on HWB achieve what is required then? I would have naively thought that's all it would take to ensure it's "active low". Vladivolt talked about an internal 20k..50k acting against this, presumably as a "voltage divider" which may mean it does not pull low enough to be a firm "0". But why would such an internal 20k..50k be active anyway? For one thing HWB is not a "normal IO" and for another at the moment this input is sampled it is just coming out of reset and no code has executed yet to enable such a pull up. So is the suggestion that HWB has a permanently enabled 20..50k pull up then?? Confused.
.
BTW what is the reason to hardwire HWB anyway? If you are going to do that why not just BOOTRST?

Last Edited: Mon. Nov 27, 2017 - 02:34 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is a hold time for HWB low after RST high:

 

 

Of course that delay is to insure HWB is still low when the internal reset is released:

 

Although a 10K may should be sufficient, I typically use a stronger pull-down for HWB (1K - 2K2, YMMV).

clawson wrote:
BTW what is the reason to hardwire HWB anyway? If you are going to do that why not just BOOTRST?

The OP was talking about a "virgin chip"

 

Edit: strike through "may", add "should"

 

 

David (aka frog_jr)

Last Edited: Mon. Nov 27, 2017 - 04:04 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I've tried to imagine myself to sit inside microcontroller.

My task is to decide, what to start - application code or bootloader.

I know state of HWBE fuse and I should monitor level on HWB pin at the moment of releasing of External Reset.

Somebody outside instructed  'tie to ground' HWB pin.

Alternative is left pin floating.

To prevent possible noise my suggestion is to activate pull-up when a low level is present on the ~Reset terminal.

 

 

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

Vladivolt wrote:
at the moment of releasing of External Reset.
You must satisfy the hold time for HWB low after RESET goes high to jump to bootloader.

 

Vladivolt wrote:
To prevent possible noise my suggestion is to activate pull-up when a low level is present on the ~Reset terminal.
How would that help? When external reset is active (low) how is a pull-up to be activated? HWB needs to be low (unless as clawson pointed out) BOOTRST is programmed (which it is not in a virgin device).

 

@udayAKUMAR123:

Looking at my past projects, I noticed that for self-powered designs, I tied UVCC to VBUS (even though the diagrams show it unconnected)...I believe that may be an error in the datasheet...

David (aka frog_jr)

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

My presumption about builtin pull-up was wrong.

Just done short test with Mega32u2 demo board.

With real external pull-up resistor of 47k removed and floating (open) PD7 pin

micro starts the bootloader.

frog_jr wrote:
When external reset is active (low) how is a pull-up to be activated?

With the help of some hypothetical internal circuitry (again: it was my dream)

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

Vladivolt wrote:

I've tried to imagine myself to sit inside microcontroller.

My task is to decide, what to start - application code or bootloader.

I know state of HWBE fuse and I should monitor level on HWB pin at the moment of releasing of External Reset.

Somebody outside instructed  'tie to ground' HWB pin.

Alternative is left pin floating.

To prevent possible noise my suggestion is to activate pull-up when a low level is present on the ~Reset terminal.

 

 

 

Is the hwb pin is programmed (i.e "0" in fuse value) by default in virgin chip

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

The default HWBE fuse setting is programmed ("0") in a ATmega32u4. (See Table 28-3 in the datasheet.)

David (aka frog_jr)

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

Thanks for the info, so if short the hwb to ground and  press and release reset, will it run the usb dfu bootloader.

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

@udayAKUMAR123:

Did you see my comment in post #11?

frog_jr wrote:
@udayAKUMAR123: Looking at my past projects, I noticed that for self-powered designs, I tied UVCC to VBUS (even though the diagrams show it unconnected)...I believe that may be an error in the datasheet...
(emphasis added)

I did this because the datasheet "implies" that UVCC should be >= 3.4V (see the Vreg spec in Table 29-1, page 384 of the 04/2016 datasheet) for the USB pads to maintain the correct voltage levels.

 

udayAKUMAR123 wrote:
if short the hwb to ground and press and release reset, will it run the usb dfu bootloader
It should...

 

David (aka frog_jr)

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The problem was solved , i shorted resonator to ground then the usbdfu bootloader worked automatically and removed 1m resistor used across crystal.

Last Edited: Tue. Dec 26, 2017 - 08:11 AM