I wish to output data to my DUE DAC using assembly language - can someone tell me the port numbers or where I should be looking to have found that out myself?
Are there any tech-specs for the DAC? What's the maximum rate I can pump data out of this thing?
You didn't think to look in the SAM3X data sheet? It took me about 15 seconds to find:
12.11 Digital-to-Analog Converter (DAC)
• 2 channels, 12-bit DAC • Up to 1 mega-sample conversion rate in single channel mode
• Flexible conversion range
• Multiple trigger sources for each channel
• Built-in offset and gain calibration
• Possibility to drive output to ground
• Possibility to use as input to analog comparator or ADC (as an internal wire and without S/H
stage)
• Two PDCA channels
• Power reduction mode
Note that the Due DACs are not full scale outputs, they range from 1/6 Vdd to 5/6 Vdd
They also seem to have problems with sparkle codes(*) and perform nothing like as
good as the datasheet claims especially if the board is powered from a poor quality
5V supply such as a computer USB port.
@majenko - might have been more helpful to tell me what a SAM3X is, why it's relevant, and hey - pointed me at one even... but it's nice to know it took you 15seconds to find something when you already knew what to look for, and where/why.
@MarkT - thanks for the tip - as you can no doubt tell, this is all new to me (didn't know, or even think to look, that there'd be a Due sub forum).
I'm aware of the Due limitations - I'm actually using a compatible though (DigiX) which has better DACs, not that I need them for my application.
I'm interested in assembler because 20 years back, I used to write PC drivers in assembler - and I want to do some cool fast stuff in small sized code.
Well I'd start with the code in C and see what code the compiler generates - if its
doing a good job leave it as is!
The SAM/ARM architecture is really aimed at doing things in hardware rather than software,
you can configure it to drive the ADC/DACs via the DMA subsystem, which is a question
of reading a lot of datasheet (rather than writing a lot of assembler). The code
snippet I wrote doesn't quite go that far and uses interrupts instead, but the hardware
is powerful but complex - having to learn ARM assembler as well would be more learning
curve for probably little benefit.