Not sure if this is the best way or place to ask this, but I'm kind of paranoid I've made mistakes and just can't see them because I've no idea what I'm doing. I'm also not sure what the best way to share schematics is, but I've uploaded an image of the schematic.
Essentially, I wanted to make a source for 0-2mAmps, and hook it up to something to monitor exactly how much current it was producing and a display to select exactly what the output should be. While I'm certain there are much easier ways of accomplishing this, honestly I don't much care so long as it actually works.
Given I approached this with absolutely no idea what I was doing, and mostly designed it by just reading the datasheet of the parts that sort of seemed like they'd work, I'm not sure that any of it will work. I'm reasonably confident in subsections like the part producing 24v, given TI provides simulations to show it's results, but I'm less confident I haven't done something incredibly stupid trying to tie together these mostly prepackaged solutions.
So what I think I've done:
This's the display used, and despite the fact it claims to be for MEGA/Uno it seems to work just fine with the DUE, as it runs on 3.3v at logic; mostly you just have to use it like a shield, but given it uses the 11-13(Can't remember exactly atm) pins for SPI to SD card, that's why those pins are being redirected to the Due's SPI pins. I believe this should solve the problems in the Due (or MEGA) that keep the SD card reader in the display from actually working, and SS is kept as p10. This connection is also split to feed the SPI for the DAC, SS set to pin 16 for that. I think I understand SPI, and am confident I can sort out code problems in the display library, but am a little worried I've just bungled the connections somehow.
Top left is a voltage upconverter copied directly out of the parts datasheet, and TI power-supply calculator, that should supply 24V. Nothing about the recommended specifications for parts has been changed.
Otherwise, a high-voltage Differential Amplifier (AD8277) is used to supply the current; the current source design is directly from an AD precision current supply document. The current sink, which I understand to be totally unnecessary but harmless, is just me modifying the design of the source and what I thought would work (NPN BJT). This actual supply portion of the circuit is monitored at the high side by an INA266 to allow voltage/current to be monitored and to ensure the power never exceeds 2mA; To this end, the alert pin (pull to ground) is connected to the pin enabling the voltage source and a digital pin that can be set to use it's internal pull-up resistor and monitor for any problems. I don't even actually know enough to be certain this is safe for the arduino.
The current source that is to control the AD8277 is a 5V source (REF02BU)(I was under the impression the arduino's was probably not reliable enough to be trusted) feeding a 16-bit DAC (DAC8551); this is set up how I think the datasheet directed me too, but again, I have no idea what I do and don't know. This, according to the sheet, gives me the 0-5V source I need to select 0-2 mAmps according to the AD8277 current source sheet, using a 3kOhms resistor with the AD8277.
Just using 3.5mm jacks to source and sink the power, and a final 3.5mm jack to connect two digital pins with a pushbutton, so that the power supply can be toggled a second way without having to touch the tft.
So, if anyone's had the patience to read this, am I actually doing anything that I think I am?
Last thing, do I have to do something to protect the ground pin from the parts 5V supply using a 24V source and the current sink? I don't actually know if the pins labeled ground are safe from high voltages and don't really want to kill my Due.
Thanks for reading.