Forum Menu




 


Log in Problems?
New User? Sign Up!
AVR Freaks Forum Index

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
Bluefurryfood
PostPosted: Nov 29, 2011 - 07:32 PM
Newbie


Joined: Nov 29, 2011
Posts: 2


Alright first time here, so hoping this will go smoothly. Currently in a course where a teacher has devoted a few students, including myself, to figure out an AVR90USBKEY2 and it's controls (joystick and two buttons) to work correctly with a simple java or C++ program (a crosshair that moves with the joystick and saves locations based on button pressed). I have started out with AVR studio 5 and, as a result, have some code that (hopefully) works. I'm kind of stuck on how I...

1) Debug the code.
a) The "simulator" provided by studio 5 does not support the microcontroller (AVR90USB1287). Don't suppose there is another "simulator" available?

2) Have it run on the USBKEY.
b) I've "released" the code which has generated a .hex file. Supposedly winAVR is suppose to handle this somehow? Kind of lost with it.

Due to time constraints I haven't had enough to time to research this as much I should have. Thus, I appreciate any and all help!
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Dec 02, 2011 - 10:01 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62298
Location: (using avr-gcc in) Finchingfield, Essex, England

1) get a physical debugger interface such as Dragon, JTAGICE3, JTAGICEmkII, AVR One!

I was surprised when you said the simulator didn't support 1287 but it seems to be the case - I guess it has to be that way otherwise they'd have to implement a complete simulation of the USB hardware. If the stuff you were trying to check was related to other hardware functions apart from USB then I guess you could build/simulate for a "similar" AVR instead.

BTW rather curiously I went back to AVR Studio 4.19 and confirmed that "Simulator 2" there (which is the same simulator as in AS5) does not support 1287, HOWEVER it looks like the original Simulator in 4.19 does list 1287 as being supported - maybe worth a look!

2) To get your .hex into the AVR you need some kind of programmer. Any of the devices listed in (1) would also work as a programmer and in addition there is the AVRISPmkII, STK500 and STK600 that could also be used. HOWEVER one of the great things about all the Atmel USB chips is that they come pre-loaded with the DFU bootloader code so after adding an 8MHz or 16MHz crystal (which I assume the USBKEY has anyway) then by simply connecting a USB cable to the PC and running "Flip!" on the PC it should be possible to program the generated .hex file down into the AVR.

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
je_ruud
PostPosted: Dec 02, 2011 - 11:14 AM
Wannabe


Joined: Feb 14, 2002
Posts: 63
Location: Atmel, Norway

The "Simulator 2" has never, and for the time being still don't support AVR90USB1287.
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Dec 02, 2011 - 11:56 AM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62298
Location: (using avr-gcc in) Finchingfield, Essex, England

That's quite a shame when it appears that AS4 Sim1 did! I guess this is another one to be chalked up to "progress"?

(OK, I know the AS4-sim1 simulation may not be great but if your only goal was to check out an LED flasher it's kind of a shame that facility is no longer available).

Surely folks would prefer a SIM2 model (both AS4.1x and AS5) for 1287 that simply has a USB section saying "this bit not available" but that provides all the timers/ADC/UART/other stuff than no model at all? For the USB registers just treat reads/writes as if they were RAM perhaps?

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
je_ruud
PostPosted: Dec 02, 2011 - 04:53 PM
Wannabe


Joined: Feb 14, 2002
Posts: 63
Location: Atmel, Norway

I agree with you that a partly supported model might be better than no model, but we have chosen not to prioritize those devices which main feature is non-sythesizable HDL code, and rather done the devices we can support more completely. If you want to test your code for 1287, except the USB, in the simulator you could select a 1281 instead.
Our goal is of course to support all of our devices, but it takes time to create the models and we have to prioritize.
 
 View user's profile Send private message  
Reply with quote Back to top
Koshchi
PostPosted: Dec 02, 2011 - 05:44 PM
10k+ Postman


Joined: Nov 17, 2004
Posts: 13840
Location: Vancouver, BC

Quote:
That's quite a shame when it appears that AS4 Sim1 did
I find this hard to believe since the development of simulator 1 stopped long before the 1287 was born.

_________________
Regards,
Steve A.

The Board helps those that help themselves.
 
 View user's profile Send private message  
Reply with quote Back to top
clawson
PostPosted: Dec 02, 2011 - 06:29 PM
10k+ Postman


Joined: Jul 18, 2005
Posts: 62298
Location: (using avr-gcc in) Finchingfield, Essex, England

The dialog might be lying I guess..

_________________
 
 View user's profile Send private message  
Reply with quote Back to top
Bluefurryfood
PostPosted: Dec 03, 2011 - 02:06 AM
Newbie


Joined: Nov 29, 2011
Posts: 2


Thank you very much for the reponses! Sorry it took awhile for me to get back. Finals week here so been workong on overdrive! I've actually solved my problem sort of with what clawson said, by using Flip software. The .hex file worked perfectly fine with Flip. I have the USB detected as a joystick as of now. From here on, its just java/C++ coding to access the device. Again, thank you so much!
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT + 1 Hour
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2006 The PNphpBB Group
Credits