[Solved] Help with ATSAM3X8E (Due barebones)

zachtos:
Looks good. A lot more capacitors than I anticipated, and I wasn't sure if both crystals were necessary myself.

So what's the programming process w/ the USB attached directly to the MCU? Erase program w/ the button, then hit reset and upload via arduino user interface or what? Can you just upload a hex file with another program instead?

The caps are important specially for the USB communication. Getting fluctuations from the power supply/circuitry can lead to the USB connecting and disconnecting randomly.

Well, you program it through the USB native port. The first time you plug in the board it will present itself as AT91 USB to Serial Converter (use the drivers that comes with the SAM-BA program). To program it just go through the normal process through the arduino IDE(Select Arduino Due Native Port in the boards menu). After programming the USB will remount as the Arduino Due in which case you'll have to point the driver wizard to the arduino drivers located somewhere in the arduino ide folder.

After that it's simple really. Just program it with the option Arduino Due Native port (The bootloader will do a soft erase each time it flashes the chip).

NOTE: Regarding the hardware erase switch. If you press it, the chip will be whipped and you'll have to do the process all over again (choosing the SAM-BA drivers etc etc).

NOTE-2: Yes, you can program the chip with Atmels SAM-BA program. I use Atmel Studio sometimes with this chip. What I did is add a external script that programs the chip after compilation.

Hmm, I'm looking to build a barebones board like yours, but from goldphoenix PCB using EAGLEcad and will want to find a way to upload hex files via the native USB port. So it sounds like I can do that but not sure about the user interface yet.

I need a very simple way for a third party to update via a hex file though, possible w/ the DUE?

zachtos:
Hmm, I'm looking to build a barebones board like yours, but from goldphoenix PCB using EAGLEcad and will want to find a way to upload hex files via the native USB port. So it sounds like I can do that but not sure about the user interface yet.

I need a very simple way for a third party to update via a hex file though, possible w/ the DUE?

Hmmm, wasn't I clear in the previous post? To begin with it's a "bin" file that you upload in this case (not hex).. You can use arduinos "uploader tool" bossac manually, see post #3 in this topic: http://arduino.cc/forum/index.php/topic,153630.0.html.

Another option AGAIN! is to use the SAM-BA program (I said it like a 1000 times already). To download and use SAM-BA go to the following site: http://www.atmel.com/tools/ATMELSAM-BAIN-SYSTEMPROGRAMMER.aspx

thanks, I'll install those tools to see how user friendly they are to non engineers that may be using my devices.

Hi baselsw!

I have a question: can you please point to the .bin file that needs to be uploaded to the SAM chip?

Also, I think in your post above you posted an incorrect link by mistake, referring to using Arduino's bossac tool.

I am also making my own Due and am a little stuck on this step. Thank you!

michaeluna:
Hi baselsw!

I have a question: can you please point to the .bin file that needs to be uploaded to the SAM chip?

Also, I think in your post above you posted an incorrect link by mistake, referring to using Arduino's bossac tool.

I am also making my own Due and am a little stuck on this step. Thank you!

There is no bin file that needs to be uploaded.. The Sam-chip will come preloaded with a bootloader.. So it will work out of the box! The link isn't a mistake.. Let me try to explain it in simpler terms:

  • In case of uploading (a sketch) to an ordinary AVR (for example the atmega328/UNO) then you'll upload a HEX file with avrdude..
  • In case of uploading (a sketch) to a SAM-chip (for example the SAM3X8E/DUE) then you'll upload a BIN file with either BOSSAC or SAM-BA...
  • For a newbie I recommend sticking with BOSSAC for uploading because it's simpler.. SAM-BA has a GUI but there is a lot of boxes and settings (a newbie will simply get confused and run back to the arduino forum for help =P)..

If my explanation isn't clear enough then let me know exactly what you're stuck on and I'll do my best to help you!

//Basel

1 Like

As per baselsw recommendation i'll post this here.

Hi baselsw,
I was looking at your schematic for the barebones DUE clone, I wanted to confirm something from you,
SV1 headder's pin 1 is pin 1 on atsam3x8e and pin 1on SV2 is pin 37 on the atsam3x8e and so on so forth?

Also i see that in your schematic for VDDCORE and VDDPLL pins on the atsam3x8e you are powering them with 1.8V but i don't see where you are creating the 1.8V. I don't see any resistive divider or any regulated source with that output. Can you tell me how you are creating that source.

Thanks

Taha

Hey Taha,

Yes, pin 1 on SV1 is pin 1 on atsam3x8e, the same goes for SV2, so you're correct there.

The 1.8V is supplied from the internal voltage regulator (pin 56 [VDDOUT]).. You can see how it's connected on page 22 in the atsam3x8e datasheet, here is the link: http://www.atmel.com/Images/doc11057.pdf

If you have any more questions feel free to ask. But please use the thread instead, so others can learn also =)..

Best regards
//Basel

baselsw i had another question whats the power consumption like with the barebone circuit?

that's a darn good question.. Normally I don't think about power consumption if it's not something that is going to be a 'final product'... I really have no idea.. The circuit is not "current measurement friendly"... If I get some spare time this week, I'll make a workaround and measure the power consumption.. No promises though..

//Basel

lynxz3:
As per baselsw recommendation i'll post this here.

Hi baselsw,
I was looking at your schematic for the barebones DUE clone, I wanted to confirm something from you,
SV1 headder's pin 1 is pin 1 on atsam3x8e and pin 1on SV2 is pin 37 on the atsam3x8e and so on so forth?

Also i see that in your schematic for VDDCORE and VDDPLL pins on the atsam3x8e you are powering them with 1.8V but i don't see where you are creating the 1.8V. I don't see any resistive divider or any regulated source with that output. Can you tell me how you are creating that source.

Thanks

Taha

Hey Taha,

Yes, pin 1 on SV1 is pin 1 on atsam3x8e, the same goes for SV2, so you're correct there.

The 1.8V is supplied from the internal voltage regulator (pin 56 [VDDOUT]).. You can see how it's connected on page 22 in the atsam3x8e datasheet, here is the link: http://www.atmel.com/Images/doc11057.pdf

If you have any more questions feel free to ask. But please use the thread instead, so others can learn also =)..

Best regards
//Basel

I thought i'd add this here for everyone else SV2 in baselsw's schematic the pin numbers is are incorrectly labled SV2 e.g. Pin1 goes to ATSAM3X8E - Pin38 (DHSDM) not Pin37. So if anyone uses it as a reference they should be weary of this.

Just looking at the pins can be confusing.. It's good that you double checked that.. Still the electrical connections in the schematic are correct.. Let's make it easier for everyone.. I found a excel file with the pinout for my board..

SAM3X8E pinout.xlsx (15.6 KB)

So, you got this working and you're currently programming the chip over USB?

You mentioned using Atmel Studio, is that with a USB cable, or using a SAM-ICE?

jtw11:
So, you got this working and you're currently programming the chip over USB?

You mentioned using Atmel Studio, is that with a USB cable, or using a SAM-ICE?

Yes... USB only.. I don't have SAM-ICE or any other JTAG module.. Fortunately the chip comes preloaded with a bootloader... I've programmed the chip with Atmel Studio over USB.. It's simple.. Just create a external tool (http://www.atmel.no/webdoc/atmelstudio/atmelstudio.section.csl_qbq_kc.html) in Atmel Studio.. The tool will consist of a call to bossac (just like the Arduino IDE).. If you need further details let me know..

//Basel

I'll look into that in the morning, thanks.

When you say you've been programming it from Atmel Studio, what have you been doing code wise? Coding using pure C and not the Arduino libraries etc?

jtw11:
I'll look into that in the morning, thanks.

When you say you've been programming it from Atmel Studio, what have you been doing code wise? Coding using pure C and not the Arduino libraries etc?

Well, I wouldn't call it pure C.. But sure.. C/C++.. No arduino libraries.. In the case of the SAM chip, I'm only using ASF (Atmel Software Framework) in Atmel Studio..

P.S: Arduino IDE uses ASF .. D.S

You're welcome bro =)..
//Basel

I see - well done again!

EDIT - I've just been playing with Atmel Studio, my Due and SAM-BA trying to get some results. Maybe you can help.

When I open SAM-BA, under 'Select your board' - what did you select, no_board? As when I press connect SAM-BA just disappears but seems to be running in the background according to Windows Task Manager.

jtw11:
I see - well done again!

EDIT - I've just been playing with Atmel Studio, my Due and SAM-BA trying to get some results. Maybe you can help.

When I open SAM-BA, under 'Select your board' - what did you select, no_board? As when I press connect SAM-BA just disappears but seems to be running in the background according to Windows Task Manager.

Well, I remember I had a lot of trouble with SAM-BA.. I tried no_board and also atmels official sam3x8e board (I'm currently at work and can't remember the name of the board).. In both cases I got an error and the board refused to connect.. I also remember that SAM-BA disappeared just as you describe it.. I didn't look into it further.. I'll have a look at it when I get home and report back!

//Basel

Thanks, I may get Atmel in on this and see what they have to say.

baselsw:
To all of you, yes it works now :D:D:D:D.. It was probably noise from the breadboard. After two hours of trying to fit the break out (made wrong measurements) board to my newly soldered board it's finally working.

Here is some pictures as proof =P:

Board soldered (Front): https://dl.dropbox.com/u/74389175/BaselM3Proto/IMAG0457.jpg
Board soldered (Back): https://dl.dropbox.com/u/74389175/BaselM3Proto/IMAG0458.jpg

Breakout board attached to the board (Front): https://dl.dropbox.com/u/74389175/BaselM3Proto/IMAG0461.jpg

When you attach the USB the first time, you need the drivers delivered with SAM-BA. After installing the drivers you should get the following: https://dl.dropbox.com/u/74389175/BaselM3Proto/sam_ba_com.png

Then open Arduino IDE and upload the blink sketch. The board will restart as Arduino Due (you'll need to install the arduino due drivers that comes with the arduino IDE). After install you should get the following: https://dl.dropbox.com/u/74389175/BaselM3Proto/arduino_blink.png.

If you've got any questions hit me! =P

And by the way I've changed a small thing in the schematic so here is the updated version:

Schematic: https://dl.dropbox.com/u/74389175/BaselM3Proto/BaselsM3ProtoV1.0.sch
Board: https://dl.dropbox.com/u/74389175/BaselM3Proto/BaselsM3ProtoV1.0.brd

Nice work & post!
So how did you solder AT91SAM3X8E to PCB? Is there any 144 LFBGA Adapter available to ease use of AT91SAM3X8E on custom pcb build like yours?
From what distributor of electronic component did you buy AT91SAM3X8E? I tried farnell but they sell only Arduino Due. What's the price?
I just found it: http://si.farnell.com/jsp/displayProduct.jsp?sku=2318838&action=view&CMP=GRHS-1000082, price: €8.57
Would it be possible for you to find out minimalistic number of periferal passive components? Are the 2 oscillators really needed? Why are there two of them?
I would need AT91SAM3X8E because of 700kHz ADC. At328p is simply too slow.

tsaG:
So, thats how my "minimum" looks like. Well, thats all I need. I wont be frugal with the capacitors and hope this works :smiley:
Sorry for the wrong symbol of the switch (Schalter), but Multisim/Ultiboard doesnt allow different footprints for buttons :-/

Have you tried that - I mean have you soldered it acording this schematics?
And - is it working?
Can you post schematics and pcb - what design program you use? DesignSpark PCB maybe? :wink: