Can you please take a look on the diagram attached and could you please confirm to me if i thinking it right?
Also, i have tracoPower TMR 6-2423WIR and output pins are +VOUT, COMMON, -VOUT
So the opamp takes +VOUT from regulator to VCC+, -VOUT from regulator goes to VCC-, but where does the COMMON goes? Ground?
Thank you in advance.
Hi,
All the Vdd would be the positive supply of the device controlling the I2C.
If you look the I2C lines have their pullup resistors connected to Vdd as well.
Vdd can only be the control supply for the DAC.
The + and - 15V supplies are just for the output amplifier, which can be, using the equations make the output more than 0 to Vdd that the DAC can supply.
What is a TMR 6-2423WIR?
I assume it is a power supply with + and - and common outputs, common is gnd.
Ok, Things are promising but…
I only get 2.7V all the way to -2.2V over the 4096 scale.i need at lesat +10V/-10V from this setup.
Any advice please?
See connection diagram.
code for reference
int inPin = 4;
int val = 0;
int dacValue = 0;
#define encoder0PinA 2
#define encoder0PinB 3
#include <Wire.h>
#define MCP4725_ADDR 0x60
volatile unsigned int encoder0Pos = 0;
void setup() {
pinMode(inPin, INPUT_PULLUP);
pinMode(13, OUTPUT);
pinMode(encoder0PinA, INPUT);
digitalWrite(encoder0PinA, HIGH); // turn on pull-up resistor
pinMode(encoder0PinB, INPUT);
digitalWrite(encoder0PinB, HIGH); // turn on pull-up resistor
attachInterrupt(0, doEncoder, CHANGE); // encoder pin on interrupt 0 - pin 2
Serial.begin (9600);
Serial.println("start"); // a personal quirk
Wire.begin();
}
void loop() {
val = digitalRead(inPin); // read the input pin
digitalWrite(13, val);
// Serial.println(val);
// do some stuff here - the joy of interrupts is that they take care of themselves
if (digitalRead(val) == 0); {
encoder0Pos == 1;
}
dacValue = map(encoder0Pos, 0 , 65535, 0, 4096);
Wire.beginTransmission(MCP4725_ADDR);
Wire.write(64); // cmd to update the DAC
Wire.write(dacValue >> 4); // the 8 most significant bits...
Wire.write(dacValue << 4); // the 4 least significant bits...
Wire.endTransmission();
}
void doEncoder() {
if (digitalRead(encoder0PinA) == digitalRead(encoder0PinB)) {
encoder0Pos += 100;
} else {
encoder0Pos -= 100;
}
Serial.println (dacValue);
}
void doEncoder_Expanded() {
if (digitalRead(encoder0PinA) == HIGH) { // found a low-to-high on channel A
if (digitalRead(encoder0PinB) == LOW) { // check channel B to see which way
// encoder is turning
encoder0Pos = encoder0Pos - 1; // CCW
}
else {
encoder0Pos = encoder0Pos + 1; // CW
}
}
else // found a high-to-low on channel A
{
if (digitalRead(encoder0PinB) == LOW) { // check channel B to see which way
// encoder is turning
encoder0Pos = encoder0Pos + 1; // CW
}
else {
encoder0Pos = encoder0Pos - 1; // CCW
}
}
}