Using an Arduino Due with Atmel Studio 7

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

I am currently writing code for the ATMEGA328P in Atmel Studio 7. I program it using the ISP connector on the ATMEL ICE (new white one).

 

I am programming a standalone chip chip on a breadboard.

 

I am finding that the chip is too slow to achieve some of the audio signal processing that I want to do.

 

I would like to upgrade to using the  Atmel SAM3X8E ARM Cortex-M3 

 

However I need some type of development board. I have not been able to find an ATMEL xplained board for this processor.

 

I feel that using an ARDUINO DUE would be the best fit especially considering the two 12 bit DACS.

 

I am unclear on several issues:

 

1) Can I physically program the  Atmel SAM3X8E ARM Cortex-M3 chip on the DUE using the Atmel ICE. The cable I am currently using has a 6 pin connector(used for 328p) and a 10 pin connector similar to the one that goes into the ICE (Jtag???).

 

2) Can I single step through the code on the DUE using the debugger on the ICE?

 

3) Will AS7 allow me to import Arduino Due code?

 

4) Is there a good resource on starting to write code for the  Atmel SAM3X8E ARM Cortex-M3

 

I would love to hear from someone  who has actually got this working to get their impression on how well it works.

 

Any help would be greatly appreciated as I have not been able to find any consistent take on this topic on the internet. 

 

 

It is better to light a candle than curse the darkness.

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

1. Yes. Attach to the 5x2 JTAG/SWD header. ATMEL-ICE ribbon uses SAM socket.
2. Yes
3. Yes. But only from v1.7.x IDE
4. It is just a regular ARM chip. Use any language that you like. Low level is a lot more complex than an AVR.
David.

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

Thanks David that's super I will pick one up.smiley

 

In regards to question 4. I believe that the low level is considerably more complex than the AVR.  I am considering learning the ATMEL Software framework (ASF)

 

This leads me to a few more questions

 

1) Does anyone know of a good resource for learning ASF

 

2) Does the red wire on the cable match a pin one marking on the board?

 

3) Will down loading a program from the ICE kill the bootloader

 

4) If so is there a way to put the bootloader back on

 

It is better to light a candle than curse the darkness.

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

In answer to #3:

 

1) that's the whole problem with ASF there isn't any decent documentation. Of course there is:

 

http://asf.atmel.com/docs/latest...

 

but often that just gives you a list of APIs with no idea of how to string them together - which are the high level ones intended for you to use and which are the low level ones used internally. If you are very, very lucky the device and peripheral you are trying to use has a "Quick Start Guide" such as this example:

 

http://asf.atmel.com/docs/latest...

 

and that gives you a better idea of how to use the module. But if your usage scenario does not match the example given you can be left floundering.

 

Libraries like this are all very well and for some really complex peripherals like CAN and USB you really have no choice but to use the library code as just looking at the raw registers you may never fathom how the silicon implementer intended the silicon to be used without library code written by the experts. But for "simple" devices like ADC, timer and UARTs (etc) you may find it as much work to learn how to actually use the ASF library interfaces as it would be to just read about the raw registers/bits and just implement something yourself (as people have been doing for AVR8 for years!)

 

2)/3)/4) - you are really asking in the wrong place, this is the Arduino forum under "AVr Freaks" and is really about the AVR based ones. Not sure if the ARM section here has an Arduino sub-forum of its own? But the fact is that the rules that apply to AVRs (like whether using ICE kills bootloader (for AVR it generally does)) may not be the same for ARM where the bootloader may well be in a separately protected/erased space. Posters in the ARM forums will know more about this.

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

I wish you luck with ASF. The SAM3X target is not as well supported as SAMD21 or SAM4.

I suggest that you stick with Arduino. Only use JTAG/SWD if you need to do some hardware debugging.
I am not sure about the Arduino bootloader. You should be able to do anything you want via JTAG e.g. replace bootloader.

David.

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

Yes, you can use the Arduino DUE as just a "normal" development board - ignoring all the Arduino stuff - should you so wish:

 

https://www.element14.com/commun...

 

 

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

Thanks Awneil!

 

Your element 14 link is very useful. The author had the same program as I am having, the JTAG connector won't fit because it hits the debug header.

I guess I will have to shave down the debug header.

 

The link to the pinout diagram is very useful as it bridges between Arduino and Atmel styles.

It is better to light a candle than curse the darkness.

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

Thanks David

 

I will start off using the Arduino environment and then when I feel a little more comfortable I will give Atmel studio a try. Thanks for the heads up about  ASF. I will give it a miss

It is better to light a candle than curse the darkness.

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

Thanks for the advice about ASF Clawson.

 

I will give it a miss unless I really need something like a USB library.

It is better to light a candle than curse the darkness.