Show Posts
Pages: 1 [2] 3
16  Using Arduino / Installation & Troubleshooting / Re: ATmega16u2 problem? on: September 05, 2012, 09:18:10 pm
I'm not sure if this will help anyone debug this but I tried to use the AVR ISP programmer within the Arduino IDE and received the following:

C:\arduino1\hardware/tools/avr/bin/avrdude -CC:\arduino1\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega2560 -cstk500v2 -P\\.\COM5 -b115200 -D -Uflash:w:C:\WINDOWS\TEMP\build5740842602492432075.tmp\BlinkTest.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\arduino1\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM5
         Using Programmer              : stk500v2
         Overriding Baud Rate          : 115200
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: ser_send(): write error: sorry no info avail
17  Using Arduino / Installation & Troubleshooting / Re: ATmega16u2 problem? on: September 05, 2012, 09:02:44 pm
A little success.  I am able to execute the loop-back test at this time.  However, I am still unable to program the ATmega2560 through the Arduino IDE.  Any suggestions?
18  Using Arduino / Installation & Troubleshooting / Re: ATmega16u2 problem? on: September 05, 2012, 01:55:21 pm
Problem is I need both the 2560 for the analog inputs and the 16u2 for USB/midi interface to the computer.
19  Using Arduino / Installation & Troubleshooting / ATmega16u2 problem? on: September 05, 2012, 12:39:57 pm
I have an ATmega2560 R3 with a 16u2 on it.  I am having a heck of a time resetting the 16u2 and was wondering if anyone else had some advice on this.  I have an AVRISPmkII and have tried to program the 16u2 with Arduino-COMBINED-dfu-usbserial-atmega16u2-Mega2560-Rev3.hex, however, this has not yet worked.  The System>Device Manager does not show that the ATmega2560 is being recognized.  When I try the loop-back test, of course it fails since the “Found New Hardware Dialog”pops up and therefore there is no COM port to connect to.  The result of going through installing the drivers results in the “Cannot Install this Hardware” dialog.
20  Using Arduino / Programming Questions / Re: Programming ATMEGA644 with an AVRISP MKII Programmer on: March 26, 2012, 12:24:09 am
I have the Arduino ATmega2560 board and have been experiencing the same issues with the AVRISP mkII.  None of the solutions that I have come across thus far have worked with the Arduino 1.0 IDE.  I find this disappointing since one of the programmer options is the mkII.  I have, however, successfully used the mkII with AVR Studio 5.0, 5.1 and 6.0 to upload all kinds of programs.
21  Using Arduino / Programming Questions / Re: Arduino ATmega2560 And AVR ONE! on: March 25, 2012, 08:03:13 pm
This post is a continuation of my previous one and includes a table representation of the AVR ONE! JTAG pinout and a table describing which pins get connected from the AVR ONE! to the ATmega2560/Arduino.

JTAG Header Pinout
Pin #PinName PinName Pin #
1
TCK
GND
2
3
TDO
VTref
4
5
TMS
nSRST
6
7
N.C.
nTRST
8
9
TDI
GND
10

JTAG Pin Description
Name Pin# AVR ONE! ATmega2560 Arduino
TCK
1
Test Clock (clock signal from the AVR ONE! into the target device)Pin 93 - PF4 ( ADC4/TMK )(A4) Analog pin 4
TMS
5
Test Mode Select (control signal from the AVR ONE! into the target device)PF5 ( ADC5/TMS )(A5) Analog pin 5
TDI
9
Test Data In (data transmitted from the AVR ONE into the target device)PF7 ( ADC7/PCINT15 ) (A7) Analog pin 7
TDO
3
Test Data Out (data transmitted from the target device into the AVR ONE!)PF6 ( ADC6/PCINT14 ) (A6) Analog pin 6
nTRST
8
Test Reset (optional, only on some AVR devices). Used to reset the JTAG TAP controller
nSRST
6
Source Reset (optional) Used to reset the target device. Connecting this pin is recommended since it allows the AVR ONE! to hold the target device in a reset state, which can be essential to debugging in certain scenarios.Pin 30RESET
VTref
4
Target voltage reference. The AVR ONE! samples the target voltage on this pin in order to power the level converters correctly. The AVR ONE! draws less than 1mA from this pin.Pins 10, 31, 61, or 100VCC
GND
2,10
Ground. Both must be connected to ensure that the AVR ONE! and the target device share the same ground reference.Pins 11,32, 62, 101, or 99GND

***Please let me know if you spot anything that appears to be incorrect so I can keep this updated with accurate info.  I would like to “keep it real” for anyone looking to this forum for answers.

Edit 08/26/2012 corrected pin spec for nTRST (optional Test Reset) per hemmerling' observation

22  Using Arduino / Programming Questions / Re: Arduino ATmega2560 And AVR ONE! on: March 25, 2012, 08:02:35 pm
I think I have a handle on this now and thought I would share should anyone ever experience this little bit of frustration I have just worked through. I created a second post (because I think I exceeded the message limits here) to include the JTAG header pinout table for the AVR ONE! along with a table describing what pins on the Arduino/ATmega2560 get connected to what pins on the JTAG header.

AVR ONE! – JTAG

AVR ONE! JTAG Debug Fuse Settings
  • If using  AVR Studio the OCDEN fuse will be enabled automatically each time a debug session is started and will be disabled when the debug session is ended.  That being said I did go into AVR programming with the AVRISP mkII and set the OCDEN to be enabled to be sure the settings where default initialized before starting.  Since then I haven’t touched OCDEN.
  • The JTAGEN fuse must be enabled.
  • The BOOTRST fuse must be enabled.

AVR Studio 5.1 Project Settings
  • Follow the documented tutorial for including Arduino source code to the AVR Studio environment.  Something to note, however, is that Atmel has appeared to have fixed the need to re-locate the “-Wl,-lcore  -Wl,-lm” within the makefile so there is no longer a need to use an external makefile.
  • Although I believe it is possible to compile and run both C and C++ projects I was only able to set break points and watch variables (i.e. debug)  AVR/GNU C projects.
  • I don’t know if this is a defect or not, however, when I compiled and tried to debug the blink example I was unable to set breakpoints or even use the “Start Debugging and Break (Alt+F5)” option within the studio.  Once I commented out the Arduino delay(nMillis) function I was able to set breakpoints and stepping functions again.
  • There is a warning directive defined in Atmel’s delay.h file indicating that if the compiler optimizations are turned off then the use of their delay_ms(nMillis) function will not work as designed which makes perfect sense.
  • When I use Atmel’s _delay_us(nMillis) inline function defined in their delay.h file I am able to set breakpoints and debug as usual.
  • Finally be sure to turn OFF all Compiler Optimizations.  This was both a good thing and a bad thing because as stated:
    • Bad Thing = if Optimizations = Off then some functions (in my case delay(nMillis) will cause the debugger to never stop, and never hit breakpoints.
    • Good Thing = Opened my eyes to what Atmel has included and they seem to have addressed (at least) this specific issue in their delay.h file via inlining.

***Please let me know if you spot anything that appears to be incorrect so I can keep this updated with accurate info.  I would like to “keep it real” for anyone looking to this forum for answers.

23  Using Arduino / Programming Questions / Re: Arduino ATmega2560 And AVR ONE! on: March 18, 2012, 09:56:49 pm
Thanks westfw!  I fixed my mistake.  For some reason I associate Low = 0 = Off.
24  Using Arduino / Programming Questions / Re: Arduino ATmega2560 And AVR ONE! on: March 18, 2012, 05:11:51 pm
Now I have the connections configured between the AVR ONE! and the Arduino ATmega2560.  The configuration hasn't changed (same as earlier posts) and I am able to view the fuses, lock bits and upload programs to the 2560 with JTAG, AVR ONE! and the AVR studio.  However, when I set break points in my source within the AVR Studio and run the IDE in debug mode the program doesn't stop and I am unable to watch the variables I have defined.
  
*)  I have tried to debug at breakpoints and trace points with the OCDEN fuse on and with it off.
*)  After I run the program in debug mode and then check the OCDEN fuse it has been turned off (set high).
*)  Lock Bits are all set to "NO_LOCK" which should allow me to set the OCDEN fuse.
*)  I have also tried compiling with all optimizations off.

Is there something I may be missing here?

Again, thanks for any help you can provide.
25  Using Arduino / Programming Questions / Re: Arduino ATmega2560 And AVR ONE! on: March 18, 2012, 05:05:36 pm
In case anyone does a search on this I wanted to post the solution I found as it might be helpful:

What westfw said is absolutely correct (by the way thank you much for pointing this out to me!).  A reply to my post on another website indicated the following:

For the ATmega2560:
There are 7 pins that need to be connected
   *)  TDI  - JTAG9 - Pin 90 - PF7 ( ADC7/PCINT15 ) - Analog pin 7
   *)  TDO - JTAG3 - Pin 91 - PF6 ( ADC6/PCINT14 ) - Analog pin 6
   *)  TMS - JTAG5 - Pin 92 - PF5 ( ADC5/TMS ) - Analog pin 5
   *)  TCK - JTAG1 - Pin 93 - PF4 ( ADC4/TMK ) - Analog pin 4
   *)  GND - JTAG2, JTAG10 - Pin 11,32, 62, 81, or 99
   *)  VCC - JTAG4 - Pin 10, 31, 61, or 80

I did not connect - JTAG 6,7, and 8

Since the AVR ONE! comes with an adapter cable I did not have to create one.  The adapter cable has a 10 pin male header on it and 10 multicolored wires so that the pins can be identified easily.

So that was the answer to the first question, but after that I ran into another wall and will put that question in the next post.
26  Using Arduino / Programming Questions / Arduino ATmega2560 And AVR ONE! [resolved ] on: March 13, 2012, 01:21:24 am
I have an Arduino with an ATmega2560 MC on it.  I was using the Arduino IDE 1.0 but moved on to AVR Studio v5.1.  Recently I found and purchased a new AVR ONE! on the cheap and am having some difficulty using it on the Arduino Mega 2560 board.  According to the AVR ONE! documentation and the Atmel datasheet for the 2560 they should work together, however, I am having a heck of a time figuring out how. I have done the following:

*) Use the AVR ONE as an ISP interface to upload programs successfully.  
*) Performred the self test on the AVR ONE! and it works fine.

However, while I have the ISP interface active I set the JTAGEN fuse to make the JTAG active and while that works fine as well, when I change the interface to JTAG and try to read the Device ID I receive the following error:

"Unable to enter programming mode. Please verify that the programmer is correctly attached to the target and that target power has been switched on. Also verify that the correct device and interface settings have been specified.

Timestamp:   2012-03-13 01:12:08.812
Severity:      ERROR
ComponentId:   20100
StatusCode:   0

Programming session setup failed: TCF command: Device:startSession failed:  Code:1 ,Service:Device ,Message from peer:setEmulatorMode failed:
An unknown emulator error occured."

I may be making a bad assumption here and that is, that the ICSP header is the JTAG interface.  Can someone confirm this for me?

It is not entirely clear as to how to connect the AVR ONE! to the Arduino board.

Thanks for any help you can provide!!
27  Using Arduino / Project Guidance / Standard USB to PC on: January 31, 2012, 12:32:01 am
I am in the process of building a midi drum brain.  It consists of the following:

*)  Atmega2560
*)  3 Mux/DeMux's
*)  40+ velocity and/or continuous input sensitive sensors

I am able to collect sensor data and format the data to complete midi messages. The project is currently at a point in which I would like to get the midi messages to the PC.  The computer I am interfacing with is running Windows XP SP3. 

This brings me to the following question(s):

Is it possible to connect the drum brain(Atmega2569 w/enhancements) to the PC with a standard USB cable, have the device be recognozed as a MIDI device and subsequently load the appropriate USB device drivers as in all "Windows standard PnP type hardware connections"?

As much as possible I would like this to be a hardware solution.  There is a device I took a look at: 

http://www.stephenhobley.com/blog/2010/09/07/arduino-sending-midi-over-usb-for-6-in-parts/

This is a very inexpensive solution that works in a pinch but I would rather not have to carry aound a bunch of loosly connected PCB's in my project box.  It doesn't make for a very seemless presentation when showing it off.  Modular yes, well connected, single PCB seemless way nooooo.

I have read many articles and Forum posts regarding FTDI and UART solutions and these may be viable but there is nothing that really brings either of them together solving the requirement.  I have also read material covering the RS232 hardware interfaces but the RS232 seems to be dissapearing on PC's these days. 

Any help would be greatly appreciated!!
 -Ken
28  Using Arduino / Installation & Troubleshooting / Re: Timeout() issue with WinAvr/Avrdude on 2560 .HEX upload on: January 08, 2012, 01:06:38 am
Yes I did close the IDE before the upload but still same results.  Nick, sorry that was hard to read, I would be glad to put code tags but I am not sure what you mean.

Thanks,
 -Ken Q.
29  Using Arduino / Installation & Troubleshooting / Re: Timeout() issue with WinAvr/Avrdude on 2560 .HEX upload on: January 08, 2012, 12:27:41 am
James - Thanks I hadn't thought to unplug while doing the upload and that worked with copying what the IDE is using for its makefile switches.  Here is a copy of the IDE makefile and keep in mind that this works within the IDE just fine:

C:\Arduino\arduino-1.0\hardware/tools/avr/bin/avrdude -CC:\Arduino\arduino-1.0\hardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega2560 -cstk500v2 -P\\.\COM4 -b115200 -D -Uflash:w:C:\DOCUME~1\Mozart\LOCALS~1\Temp\build5991853816765248887.tmp\Blink.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Arduino\arduino-1.0\hardware/tools/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM4
         Using Programmer              : stk500v2
         Overriding Baud Rate          : 115200

=======>

Here is a copy of my CMD session:

C:\Arduino\arduino-1.0\hardware\tools\avr\bin>avrdude -CC:\Arduino\arduino-1.0\h
ardware/tools/avr/etc/avrdude.conf -v -v -v -v -patmega2560 -cstk500v2 -P\\.\COM
4 -b115200 -D -Uflash:w:C:\DOCUME~1\Mozart\LOCALS~1\Temp\build599185381676524888
7.tmp\Blink.cpp.hex:i

avrdude: Version 5.11, compiled on Sep  2 2011 at 19:38:36
         Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
         Copyright (c) 2007-2009 Joerg Wunsch

         System wide configuration file is "C:\Arduino\arduino-1.0\hardware/tool
s/avr/etc/avrdude.conf"

         Using Port                    : \\.\COM4
         Using Programmer              : stk500v2
         Overriding Baud Rate          : 115200
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]
avrdude: Recv:
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: Send: . [1b] . [01] . [00] . [01] . [0e] . [01] . [14]

=====>

I just copied what was captured and pasted it.  The results are still the same in terms of the Timeout error.  Any other suggestion?

Thanks,
 -Ken Q.
30  Using Arduino / Installation & Troubleshooting / Re: Timeout() issue with WinAvr/Avrdude on 2560 .HEX upload on: January 07, 2012, 11:10:28 pm
Agreed, debug was not turned on for the upload, however, the verbose settings were turned on for compilation.  The last line is accurate for a clean compile and that is what I posted.  However, I did not have verbose settings turned on for the upload and I do now (I didn't see that option when I was last in preferences).  Anyway, I did go into preferences and set that switch so I could get a verbose listing on upload.  This time during upload there is so much information scrolling by that I am unable to catch the switches used by the IDE.  Evidently a successful upload fills the multi-line edit buffer at the bottom of the IDE.

Is there a way to pause the scrolling as the program is being uploaded so I can see the switches used. I am using Arduino 1.0 if that helps.

Thanks,
 -Ken Q.
Pages: 1 [2] 3