I am building a shield to do a PLC. It have digital debounced inputs, 24Vac digital ouput, 10K pulled-up analog input and a 8 channels DAC 0-10 or 2-10V analog ouput.
Most question are about DAC. the dac I use is : MAX528.
-first, I did not find any function into the DAC data sheet that use MISO, so should I leave the pin non connected?
-Secondo, the output configuration on the datasheet put a capacitor in serie with the DAC ouput, but I want to use it to make a steady dc voltage, not a wave forme, shoul I put the cap in parallel? In wich case, should I keep the same value ? or just forget it...
-Next... for the 2 volt reference (REFL1 and REFL2), I use LM385 Précision voltage Reference. But unlike zener voltage regulator, the data sheet do not give info about the resistance the Rs should have. Do I calculate it like with a standard zener reg? ( Vz/(current of the load + Iz)
Finally, I have 3 voltage reference and regulator: the 2v we just talk about, a 10V for REFH of DAC, and a 9V to power the arduino. Should I put some capacitor to filter the signal? In witch case, what size should I use.
(I did not findd a better reso for the pic sorry...)
First a quick look at the Max528 datasheet indicates it does not function via SPI nor I2C. It is what is commonly referred to as "bit banging". Which means you must read and understand the timing diagrams and in code manipulate the clock and data pins.
I am not familiar enough with the MAX528 to comment on the other questions. However this being a very old part I would keep the resistor and capacitors in the event of transients generated upon output change.
My comment about being old was only to suggest why the part wasn't SPI or I2C.
You can still use the part you just have to write the interface code or find a Max528 driver somewhere and copy it or maybe you have to convert it for the arduino.
If you look at Figure 5 of the data sheet to enter the first data bit you must:
Drop the CS line to "select" the DAC (using an I/O Pin)
Output the data on an I/O pin
Raise the clock on another I/O pin
So you need three control pins the rest is repetition. I don't mean to sound like I am trivializing the task, I am not. The basic concept is very easy but getting all the loops working correctly is a more challenging task.
is that not the way that SPI transfer work ? change the stat of data pin sync with CLK? But with chosong the corerct SPI mode, not sur with mode 2 or 3 is good...
For the rest, the data is with 2 byte, one to select output(s), the other the value...
first, I did not find any function into the DAC data sheet that use MISO, so should I leave the pin non connected?
You need to spend more time reading device datasheets. As already pointed out, it's not a true SPI part. The output pin is not named MISO, it is DOUT and they are not the same thing. The DOUT pin is provided to cascade several devices together on the same 3 wire serial bus by connecting the DOUT pin to the next device DIN pin. This is explained on page 13, "Digital Interface / Serial Interface".
-Secondo, the output configuration on the datasheet put a capacitor in serie with the DAC ouput, but I want to use it to make a steady dc voltage, not a wave forme, shoul I put the cap in parallel? In wich case, should I keep the same value ? or just forget it...
The title of Figure 4, the illustration with the caps, is "Using an AC reference with the MAX528". Are you using an AC reference? Again, all is explained on page 13, "Using an AC reference with the MAX528". DC output? No cap.
You are correct that the part will function with basic write only SPI and SPI_MODE3 should work, 4 MHz rate clock max.