A couple simple "DIY bare bones" questions

Hi everyone...im designing a custom compact board using the SAM3X and had some questions as far as simplifying the SAM3X support circuitry from what is included on the traditional Due development board.

The entire "programming port" stuff and ATMEGA16u2 was the first to go, obviously. I left a serial programming header on my PCB "just in case" though, so I can still program the Due via the serial port "just in case" using a second offboard Arduino as a USB-serial bridge.

  1. I assume the only SAM3X chip that will work with as a Due is the 144-pin AT91SAM3X8E? The smaller and less expensive 100-pin SAM3X8C will not work without doing a drastic library re-write? Im using the Due mainly because I need the processing speed, and the two internal/native CAN controllers...most of the regular I/O's are unused/disconnected.

  2. The Due development board uses some pretty large 1210-size capacitors for those several 10uF power supply caps on the board. Ive seen some other peoples' "DIY Due bare bones" design boards with smaller 0805-size caps. Is there any reason that Arduino chose to use such large caps? I would think as long as the value is the same (10uF), the voltage rating is appropriate, and the ESR is about the same (if that even matters?)....whats the harm in using some smaller size caps?

The SAM3X checklist datasheet says 4.7uF on the 3.3v pins, but I assume thats a minimum value.

  1. I couldnt find much about a "KX-7" crystal as shown on the Due schematic, just one datasheet and no sources to buy them. Looking at the SAM3X8E datasheet, it says the max crystal ESR allowed at 12MHz is 80ohms, so I found FQ5032BR-12.000 Abracon | Fox ......seems to fit the bill?

  2. The 32.768KHz crystal is NOT needed unless Im using the low-power/sleep functions, correct?

  3. Im not going to be using any USB peripherals or USB on-the-go stuff. Im only going to be using the SAM3X native USB port for programming (and debugging if need be) the SAM3X. I also do NOT care about having the ability to power my entire board and board accessories (some CAN controllers and LED's) via my PC's USB port....during normal operation, its going to be powered solely by the Due's 5v switching power supply/regulator. I just duplicated the LM2734 switching power supply circuit from the Due development board since it seems to work well with my 12v supply.

So I assume I can remove the MOSFETS and associated components for the "USB power/offboard power automatic switching" feature? On my design, the "USB VBUS" 5v input from the USB connector goes only to Pin 39 of the SAM3X (VBUS) and thats it. It does not tie into the 5v supply anywhere else on the board because I assume that could potentially cause some dangerous backfeeding issues?

Which leads me to a second sub-question...because I dont have the USB port power tied into the boards normal 5v supply and dont have the switching circuitry, when programming the DUE via USB, does that mean I ALSO need to have my external +12v source hooked up simultaneously? Or does that one single "5v VBUS input" on the SAM3X automatically power up enough stuff inside the SAM3X for USB flashing?

  1. Last question...ive done a lot of searching on the SAM-BA bootloader and Bossa etc.... But just to confirm....if I buy a bare SAM3X chip from Digi-Key/Mouser, its all ready to go and can be programmed straight away from the Arudino IDE correct? I dont have to do any initial setup or bootloader programming like with older Arduino stuff when starting with a totally blank chip? Just plug in to the Native USB port on my board, select "Arduino Native USB port" in the Arduino IDE, and click "program"?

Sorry for all of the questions at once...but I figured it was easier to just ask everything at once rather than starting a dozen different threads.

Thanks!
Ben

Also had one other question...

The "TST" pin....the Due board leaves it floating/unconnected with a mini jumper to tie it to ground if you want.

But the SAM3X datasheet says "in noisy electrical environments, if you are not using it, tie it to ground".

I put a JTAG header on my board in case I wanted to try some direct debugging (not sure if that even works with Arduino code in there??) or direct flashing via JTAG with the SAM-BA software. Ill probably never actually use it, but I figured if Im having a custom board made...why not put the JTAG header on there just for grins.

My question is, if I tie that pin permanently to ground, does the JTAG header become completely useless?

The SAM3X datasheet wasnt that clear (to me) on this...it seemed to indicate that the TST pin was only "used" (needed to be pulled high) if you are doing the [parallel] "FFPI" fast flash programming interface...which I will never use. When using regular debugging mode to see real time pin status etc, the TST pin is not used and can remain tied to ground like during normal operation.

Also...the JTAG-SEL pin....the Due development board shows it permanently tied to ground...but the SAM3X datasheet shows that you need to toggle it to use the JTAG port for debugging.

TL;DR version.... Im a confused on the JTAG pins/header and how it works, and if I permanently ground the TST and JTAG-SEL pins on my board, will I effectively permanently disable/render the JTAG debug header useless.

  1. I would expect that it would not take long to edit boards.txt and pins.h to change the pin definitions. If you're really keen to minimize the size of your board, this should not be a big hurdle. The libraries would need to change if the UART and USART distribution is different on the other chip. Any other differences like missing a timer module may also be important.

  2. ESR is important. I would not change the size of the caps. Either bigger or smaller may cause problems.

  3. I don't know.

  4. The 32kHz crystal is useful as a real time clock. If you don't need an RTC, then don't install the crystal.

  5. I would not delete the USB power circuitry. The great convenience of USB is you can just plug it in and work with your board, regardless of any other power supply. I can't stop you making this choice but I bet you will regret it later.

Yes, you need to power the board to have any USB functions work.

  1. The 'bootloader' as such is in ROM and can't be changed. Every blank chip includes that ROM.

  2. If you are so squeezed for space that you want to use smaller footprint capacitors then you definitely don't have space for the JTAG header. I've never used it, other than the SPI pins, of course.

Some of this stuff you will have to verify by experiment. Personally, I would follow most of the Arduino layout since it obviously does work like that. (For a suitably small value of "work".)

MorganS:

  1. I would expect that it would not take long to edit boards.txt and pins.h to change the pin definitions. If you're really keen to minimize the size of your board, this should not be a big hurdle. The libraries would need to change if the UART and USART distribution is different on the other chip. Any other differences like missing a timer module may also be important.

  2. ESR is important. I would not change the size of the caps. Either bigger or smaller may cause problems.

  3. I don't know.

  4. The 32kHz crystal is useful as a real time clock. If you don't need an RTC, then don't install the crystal.

  5. I would not delete the USB power circuitry. The great convenience of USB is you can just plug it in and work with your board, regardless of any other power supply. I can't stop you making this choice but I bet you will regret it later.

Yes, you need to power the board to have any USB functions work.

  1. The 'bootloader' as such is in ROM and can't be changed. Every blank chip includes that ROM.

  2. If you are so squeezed for space that you want to use smaller footprint capacitors then you definitely don't have space for the JTAG header. I've never used it, other than the SPI pins, of course.

Some of this stuff you will have to verify by experiment. Personally, I would follow most of the Arduino layout since it obviously does work like that. (For a suitably small value of "work".)

Awesome, thanks so much...really appreciated.

I might look into modifying the boards.txt and pins.h file, I dont have any experience messing with that stuff, but it seems like it would probably be easy. But the additional more complicated stuff like UART distribution, timer modules, etc....Im not sure. Ive got a couple hundred dollars' worth of prototype boards on the line, and I dont really trust myself to make all of the changes correctly to "port" the Due stuff over to the smaller 100-pin SAM3X. But maybe Ill try in effort to save space.....

On the JTAG...yeah I was on the fence about just ditching it. I wasnt sure how useful it really was as pertaining to Arduino, and if it was popular for people to use, or if 99% of users just ignore it.

I guess Ill say screw it and remove the JTAG header...in its place, Ill put the USB switching circuitry. Since you said that even just to only do a basic flash with USB, the SAM3X still has to be "totally" powered up (and not just only fed 5v on the VBUS pin), I might as well put the switching circuitry on there.

After thinking about it...realistically, Ill probably miss the USB auto-switching circuitry more than the JTAG header. :slight_smile:

thanks
Ben

One other question...

I am NOT using any USB on the go stuff. Im only using the native USB port for programming the Due and thats it.

Can I leave both the USB OTG ID UOTGID pin and the UOTGVBOF power switching pins on the SAM3X disconnected/floating?

My understanding is that the USB ID pin and USB power switching pin on the SAM3X are only used when the SAM3X is in "host" mode and using a peripheral (keyboard, etc)......if you are just using the USB port for flashing, those two pins are unused/unnecessary.

I sacrificed a chinese Due board in the name of testing....scratched off/broke the traces for USB ID (UOTGID) and USB master/host power switching (UOTGVBOF)....and everything seems to still work with reflashing and serial printing...

So im thinking I can just leave those two circuits hanging/disconnected? I think the SAM3X datasheet says its ok to leave floating.

Can anyone confirm?

I'm looking at doing something very similar, I'm reaching production point with a couple of prototype boards and the extra versatility that the SAM chip offers when working in the auto world is awesome. I've got some pretty hardcore data manipulation going through the SAM in real-time that I have trouble running on the more basic Arduino boards/processors. I did look at utilising a TI chip that has a useful in-built LIN-bus system but the work involved out-weights the benefits.

I plan to run most of the USB stuff as per the Due board, I'm only removing the "programming USB" stuff and changing to some more space efficient headers that work better with my design. I have no concern for my board being usable by others at this stage so can be quite selfish on space/design which is nice.

I'd be interested to hear/see the outcome of your testing & questions!

Daniel

Well I bit the bullet and ordered 10 prototype boards of my own custom design. Fingers crossed I didnt mess anything up, wouldnt want to throw $200 in the trash (its a fairly large board, 3.8"x1.95").

Its pretty feature-packed;

Two high speed CAN transceivers (MCP2562) on the Due's native CAN0 and CAN1 controllers.

One single-wire CAN transceiver (TH8056) with an MCP2515 controller interfaced to the Due via SPI.

One J1850-VPW transceiver (J1850 is the General Motors "Class-2" bus that they used on vehicles prior to CAN, single wire, runs at 10.4k) interfaced to the Due via UART/serial to an ELM322 (which is a clever little serial to J1850vpw interface chip that uses the AT-command set).

A header tied to a ULN2003a to drive some relays or whatever.

A header with power/ground/serial to drive an external display or something via UART/serial.

A header tied to several other analog/digital I/O pins for misc button or sensor interfaces to the Due.

And finally, a high power "smart automotive rated" MOSFET to drive a solenoid etc.

We'll see how it turns out....

Thanks again for the help
Ben

duramax, how did your prototype boards go?