Arduino DUE, some thoughts

Having spent a lot of time over the last few weeks looking at LPC processors and at first glance I was not impressed by the SAM3U that is being used in the New Ardiuino Due. However I just spent an hour or so quickly going through the SAM3U data sheet and now I think it will be a good peice of kit.

Here is a summary of my first impressions of features that will affect the average Arduino user. Note that I am mostly just looking at the chip, I am not privy to what the Arduino guys are doing or what features they are implementing.

3v3 IO - All IO is 3v3, that's pretty standard for new chips so no surprises there. How will existing shields will work? They probably won't.

Millis rollover - OK this is different but we're always talking about the 49-day rollover of millis, the SAM3U has an RTT (real time timer, that's not an RTC but serves a similar function) that also rolls over and will have to be taken into account by your code.

The 32-bit counter can count up to 2^32 seconds, corresponding to more than 136 years, then roll over to 0.

Just keep that in mind.

Pin current - Forget about hanging most LEDs and all small relays off the pins, source 3mA, sink 6mA, 130mA for entire package.

Timers - at first glance it looked like there are only 3 16-bit timers.

3-Channel 16-bit Timer/Counter (TC) for capture, compare and PWM

WTF I thought? I'm still a but confused but it seems that there are 3 TC blocks and each block has 3 TCs. But 16 bits, again WTF?

However it also seems that within each block TCs can be daisy-chained, so you can have 3 16-bitters, a 32-bit + 16-bit or even a single 48-bit TC. If that's the case then this is a very flexible arrangement giving a total of 9 16-bit TCs or various combinations of 16, 32 and 48-bits.

No DAC - This is a little strange because most modern large chips do, personally I've never had a need for one but there you have it. No DAC.

ADC - There are a total of 16 analogue inputs, same as the Mega but better in that there are two 8-ch ADCs, one is high speed (1Msps) and high(er) res (12-bit), and the other is more like the Mega (10-bit, 384ksps)

SPI - Despite the "5 SPI channels" mooted there is only 1 dedicated SPI port. The other 4 are obtained by using the 4 USARTs. Nothing wrong with that but be aware of the tradoffs.

JTAG - It looks like full JTAG debugging, and from what I can see on the photo the port is connected to a header on the PCB. Maybe I'll finally be able to use my JTAG debugger.

RAM - At 50k this is a little disappointing and not as much as a lot of chips, but a lot better that we've had. Also bear in mind that I'm pretty sure that with this architecture your constants will not be copied into RAM. This will make a big difference.

I2C - There are two ports and it looks like the second one has been brought out to an extended header.

That's it for the time being, I'll delve a bit deeper now, but I'm starting to like this chip.


Rob

I too have been looking at this.

Pin current - Forget about hanging most LEDs and all small relays off the pins, source 3mA, sink 6mA, 130mA for entire package.

Yes I think this will be good, it will (should) stop people using it just for lots of LEDs, there is no need for such a processor to be used.

I think it could find a use in the "how can I interface my web cam" sort of projects as while 50K is not big it is a usable amount of space for an image.

It should also be good for the audio projects like synthesizers, sound processing and speech recognition. As well as being able to implement a decent FFT.

The danger is that beginners might think it is a super set of what has gone before and buy it when it is totally unsuitable for what they want to do. I think the advice should be if you don't know exactly why you want it don't buy it.

it will (should) stop people using it just for lots of LEDs

Won't stop them from trying though :)

Here's a gotcha that appears to be unresolvable...

Some of the ADC pins clash with other functions that cannot be done without, for example AD12B1 (ch 1 of the high-speed ADC) is on pin 77, so is TXD2 (Tx for the 3rd serial port).

Neither of these can be used on other pins, so which one will we get?

Other ADC pins clash with timer outputs (read: PWM pins).

It may be for example that you can have 16 analogue inputs OR 4 serial ports but not both at the same time.

As I said before this is just my conjecture, but I can't see way way around it.

I'm sure hanging out to see more details.


Rob

Neither of these can be used on other pins, so which one will we get?

We will get what we get now, just the raw pin. This happens with the serial port and the analogue inputs now doesn't it. For example the I2C is on analogue inputs 4 & 5, but it is just a pin so we wire it up just as we want.

This thing happens on every processor nowadays and is quite a pain when trying to select a processor for a project as you have to know what resources you need to use simultaneously in advance of the processor choice. In my working life a lot of processors have had to be eliminated from the short list because of this. It is worst when you miss something and get a prototype out to the developers and then they find out they can't have two functions at the same time from the same pin.

Yep, I got caught the other day with an LPC, the data sheet says something like

1 x SPI 1 x SSC

So I thought no problems SSC can do SPI and I need two SPIs. The pins are not common so I didn't thing any more about it until reading the details of one of them and I found that you can have one OR the other. And that's not a pin-muxing issue, who knows why that is like that.

So it looks like the Due should say

16 x ADC 4 x USART (but not all at the same time)

As you say this is already the case with other functions.

BTW I would have thought there'd be more interest in the latest Arduino, did I put this in the wrong forum :)


Rob

I think the lack of comments are down to people not thinking about it until it is out.
I think things will pick up when we have a bit more to go at

I'm looking into designing a clone at present (difficult with no reference design) and there are some interesting issues.

For example all the IO, is there much point in having 54 (or whatever) 3v3 IO signals? What would you connect them to? Are there enough 3v3 "things" around yet?

Doing the level conversion for all pins is possible but prohibitive I think, especially if you want complete freedom re selecting inputs and outputs.

Maybe such a board is better as a grunty motherboard and leave the majority of the IO to modules or shields.

Much to think about (for some of us anyway :))


Rob

My thoughts are more towards the software side of things.. ARM's are generally meant to be a multi-tasking/multi-threaded device, as I understand it. It'd be cool if the Arduino code implemented something like "loop1" "loop2" "loop3" etc, so you can have multiple loops running simultaneously, while still keeping it easy to understand few newb's like myself.. ;)

Its single core, so you cant do multi tasking more real in an ARM than in an Atmega328p.

Tell that to the thousands of PC's with single core CPU's. I know they aren't running literally at the same time. But it's going to do a helluvalot better job of faking it than an 8bit CPU could.

UnaClocker: Tell that to the thousands of PC's with single core CPU's. I know they aren't running literally at the same time. But it's going to do a helluvalot better job of faking it than an 8bit CPU could.

PCs are also running an operating system which supervises the multitasking.

Graynomad: ADC - There are a total of 16 analogue inputs, same as the Mega but better in that there are two 8-ch ADCs, one is high speed (1Msps) and high(er) res (12-bit), and the other is more like the Mega (10-bit, 384ksps)

Any insight if both A/Ds can be used at the same time? Or at all 16 inputs MUXed into a single A/D?

Two separate ADCs, each with an 8:1 MUX, it's own set of registers and PDC (peripheral DMA controller) so no reason they can't be used independently.

One thing though, before you get too exited about the 12-bit resolution the INL (Integral Non-linearity) of the 12-bit ADC is +-2 LSBs typical, 4 LSB max.

You can use it at 10 bits though where it's +-.5 LSB which is OK and normal I think for these on-board ADCs.

I'm designing a Due-compatible at present and I have to say that so far the features and pins seem to be falling into place quite nicely. The SAM3U is not the most powerful ARM on the block but this is one nice chip and I think about perfect for this sort of board IMO.


Rob