Question to DUE pins and mapping to the SAM3X8E documentation

Hello,

I am currently working through the documentation of the DUE and the SAM3X8E, to understand all possibilities.

My biggest problem right now, is the understanding of PWM. When I look at the official Atmel documentation of the SAM3X8E
I read about 8 PWM.channels with Independent Complementary Outputs (Chapter 39.2)
Each of those 8 channels has two OUTPUTS PWMHx and PWMLx (Chapter 39.4)

That does not fit to 12 PWM-Pins on the DUE, which don't map to the PWMLx or the PWMHx IO-lines, what I would have expected.
I believe, that I miss some piece of information. Can someone here bring some light into the shadow?

Furthermore, there is an virtual AD15 port mentioned in the Atmel documentation (chapter 44.4, page 1330ff ), which is internal connected to an temperature sensor. Is there a way, to access that PIN through a library?

Last question is related to the DUE-Pins 4/87 and 10/77 (PA29/PC26 and PA28/PC29). Why are those Pins crossconnected to each other?

IIRC the SAM can do PWM using either the timers or the dedicated PWM engine. Arduino (presumably to keep compatibility with previous boards) use the timers.

It's the PWM engine that has the H and L versions of the PWM signals but they aren't used by Arudino, which is not to say some of the pins aren't broken out to headers, if so you can learn how to drive the PWM engine and use them.

DUE-Pins 4/87 and 10/77 (PA29/PC26 and PA28/PC29). Why are those Pins crossconnected to each other?

You'll have to ask the Arduino designers about that, we've talked about it before and AFAIK nobody can figure out why that was done, especially as it stuffs up the external memory interface.

As for reading the temp sensor, you'll have to read more and get down and dirty with the registers (I think).


Rob

Thanks for that answer, that brings me one step further.
You are confirming as well my findings, that the crossconnection of the pins is more counterproductive than advantageous.

Arduino pins 4 and 10 are connected to two SAM3X8E pins because they need to be SPI
chip selects and PWM capacble. They need to be SPI selects for the existing shields that
require it (including ethernet I think), they need to be PWM to be compatible with
Mega (pins 2..13 are PWM). Presumably Mega-only shields are intended to also
work on the Due if 3V compatible.

No SPI pins share with PWM or TC pins on the chip.

However the downside is its possible to set those pins fighting each other which is
outside the abs-max specs. I've seen this and you get approx mid-rail output and
a noticable increase in supply current.

I think using the SPI extensions is where the problem lies, Uno and Mega compatible
SPI seems to DTRT.