AT90USBKey tutorial: Could not open USB device.

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

In order I:
1. compiled blinky and got a hex file.
2. opened flip.
3. plugged AT90USBKey into USB port. A window for removable disk E: came up.
4. clicked on do nothing in above window.
5. noticed that in the flip window, pretty much everything was grayed out.
6. eventually discovered Device/Select and selected AT90USB1297.
7. clicked on File/Load HEX File and loaded blinky.hex .
8. clicked on Settings/Communication/USB.
9. clicked on open.
10. was told "Could not open USB device."

Under Human Interface Devices, the Device Manager tells me I have one HID-compliant device and four USB Human Interface Devices. All are at location 0.

Edit:
There is also a bunch of stuff under USB Serial Bus controllers:
One Generic USB Hub,
Five Intel(R) ICH8 Family USB Universal Host Controller - {2830,2831,2832,2834,2835},
Two Intel(R) ICH8 Family USB2 Enhanced Host Controller - {2836,283A}
One USB Composite Device
One USB Mass Storage Device
and seven USB Root Hub.
:tidE
I can move my mouse with the joystick.

Previously when I plugged in the AT90USBKey,
I clicked on open folder and it worked.

How do I load blinky into my AT90USBKey?

"SCSI is NOT magic. There are *fundamental technical
reasons* why it is necessary to sacrifice a young
goat to your SCSI chain now and then." -- John Woods

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

skeeve wrote:
In order I:
3. plugged AT90USBKey into USB port. A window for removable disk E: came up.

It seems like you are not in flash mode, but in normal mode.

You must press the buttons on the the AT90UsbKey when you connect it to the PC and then release the reset button and then the HWB-button.

But this is described better in the
AT90USBKey Hardware User Guide
Chapter 2.5 In-System Programming
http://www.atmel.com/dyn/resourc...

Cheers
Johan

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

jsiei97 wrote:
It seems like you are not in flash mode, but in normal mode.

You must press the buttons on the the AT90UsbKey when you connect it to the PC and then release the reset button and then the HWB-button.

But this is described better in the
AT90USBKey Hardware User Guide
Chapter 2.5 In-System Programming
http://www.atmel.com/dyn/resourc...

i.e. TFM. Thanks.
I read that, but by the time a got around to actually trying to run code, had forgotten it.

"SCSI is NOT magic. There are *fundamental technical
reasons* why it is necessary to sacrifice a young
goat to your SCSI chain now and then." -- John Woods

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

jsiei97 wrote:
It seems like you are not in flash mode, but in normal mode.

You must press the buttons on the the AT90UsbKey when you connect it to the PC and then release the reset button and then the HWB-button.

But this is described better in the
AT90USBKey Hardware User Guide
Chapter 2.5 In-System Programming
http://www.atmel.com/dyn/resourc...

i.e. TFM. Thanks.
I read that, but by the time I got around to actually trying to run code, had forgotten it.

"SCSI is NOT magic. There are *fundamental technical
reasons* why it is necessary to sacrifice a young
goat to your SCSI chain now and then." -- John Woods

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

I wrote too soon.
Eventually I discovered what to tell the hardware wizard.
After "Press the Run button in the "operation flow area",
Flip showed me an oscillating rectangle during "chip erase" and threw an exception:

java.lang.NullPointerException
	at com.atmel.flip.Programmer.(Programmer.java:79)
	at com.atmel.flip.ProgrammerFactory.createProgrammer(ProgrammerFactory.java:12)
	at com.atmel.flipGui.RunFlowAction$RunFlowThread.run(RunFlowAction.java:123)

"Blank check PASS" appears at the bottom of the main GUI window.

How do I run blinky?

Added:
For some reason it seemed to work when I tried it again.
Alas, pressing run didn't make blinky blink.
Pressing start application didn't make blinky blink.
How do I make blinky blink?
:deddA

"SCSI is NOT magic. There are *fundamental technical
reasons* why it is necessary to sacrifice a young
goat to your SCSI chain now and then." -- John Woods

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

skeeve wrote:

How do I run blinky?

Added:
For some reason it seemed to work when I tried it again.


Nice

skeeve wrote:

Alas, pressing run didn't make blinky blink.
Pressing start application didn't make blinky blink.
How do I make blinky blink?
:deddA

I have seen this too, it seems like the AT90UsbKey needs a hard reset and can't start correctly from flip ... the timing is often wrong (but not always) when you only press the run button in flip.

I usually remove the unit physically from the computer and then reinsert it again.
And then it behaves as I wan't it to (if my code is correct of course :lol: )

BR
Johan

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

skeeve wrote:

How do I run blinky?

By the way, what type off blinky are you trying to run?
https://www.avrfreaks.net/wiki/index.php/Documentation:Tutorials_gcc_AT90UsbKey#Blinky

BR
Johan

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

That Java error that you have come across is from clicking on the chip select menu. once you click on that it shits itself and u have to restart the flip program. thats what has happened with me, it gets annoying but you only have to set it once and it remembers it. then it should just be a matter of loading the hex into it.
Providing you have it ported correctly etc. there are functions in the demo code for turning the LEDs that are on board on and off. I figure if you have the USB kit then you are slightly more advanced than just a solitary flashing LED. Hope that helps!

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

michael_R wrote:
That Java error that you have come across is from clicking on the chip select menu. once you click on that it shits itself and u have to restart the flip program. thats what has happened with me, it gets annoying but you only have to set it once and it remembers it. then it should just be a matter of loading the hex into it.
Providing you have it ported correctly etc. there are functions in the demo code for turning the LEDs that are on board on and off. I figure if you have the USB kit then you are slightly more advanced than just a solitary flashing LED. Hope that helps!
Thanks.
I'm trying the blinky from the tutorial mentioned earlier.
Something is blinking,
but it's only blinking the lower red LED.
In an effort to diagnose the problem,
I changed SLEEP_TIME to 4*25, but it behaves the same.
Methinks Flip is lying to me about the code it's using.
BTW closing Flip crashed Windoze.

"SCSI is NOT magic. There are *fundamental technical
reasons* why it is necessary to sacrifice a young
goat to your SCSI chain now and then." -- John Woods

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

I finally managed to change blinky's behavior.
With SLEEP_TIME at 25 or 250, only the lower red LED blinks.
The rate does not seem to change.
Changing SLEEP_TIME to zero causes all four LED to blink.
The rate does not seem to change.
Leaving a PORT bit clear darkens the corresponding LED.
Keeping a DDR bit clear produces more complicated results.

With bit 4 clear, all four still light, but the bottom pair combine to form a faint green.

With bit 5 clear, the bottom green LED goes dark.

With bit 6 clear, the top green LED goes dark.

With bit 7 clear, all four light, but the top pair combine to form a faint green.

Any idea what is going on?

BTW, to me, the "red" is pink or pale orange.

"SCSI is NOT magic. There are *fundamental technical
reasons* why it is necessary to sacrifice a young
goat to your SCSI chain now and then." -- John Woods

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0
#define Leds_init()     (DDRD |= 0xF0)
#define Leds_on()       (PORTD |= 0xF0)
#define Leds_off()      (PORTD &= 0x0F)
#define Led0_on()       (PORTD |= 0x10)
#define Led1_on()       (PORTD |= 0x20)
#define Led2_on()       (PORTD |= 0x40)
#define Led3_on()       (PORTD |= 0x80)
#define Led0_off()      (PORTD &= 0xEF)
#define Led1_off()      (PORTD &= 0xDF)
#define Led2_off()      (PORTD &= 0xBF)
#define Led3_off()      (PORTD &= 0x7F)

That is the led ports from the at90 from the demo code, I'm not sure if it helps, maybe the porting was wrong, I've managed without to much trouble to having various patterns of lights flashing for when I'm doing other things on the key. ie. creating files.
And with that being said.. ah nah, I better not hi-jack the thread. Unless I add an idiots version to creating a very ..very basic fat fs to the wiki...

RE: Flip, yes, it can be very annoying at times. there is no explanation to somethings it does.... much like all technology.

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

jsiei97 wrote:
I have seen this too, it seems like the AT90UsbKey needs a hard reset and can't start correctly from flip ... the timing is often wrong (but not always) when you only press the run button in flip.

I usually remove the unit physically from the computer and then reinsert it again.
And then it behaves as I wan't it to (if my code is correct of course :lol: )

As I discovered on Friday, just pressing the board's reset button doesn't give it a hard enough reset. Weird things will happen until I unplug it and plug it back in.

Power cycling, after reprogramming seems to do the trick.

"SCSI is NOT magic. There are *fundamental technical
reasons* why it is necessary to sacrifice a young
goat to your SCSI chain now and then." -- John Woods