The two things most likely to be wrong are the wiring to the chip and the configuration bits in the Shiftout command. The first four bits tell the DAC which output to use, if the Dac's Vref should be buffered or unbuffered, set the gain to x1 or x2, and enable/disable the output.
(Datasheet pg. 18)
I'm definitely trying to use output B. So the first bit should be 1.
I can't see why I care about the buffering on Vref. I have Vref connected to Vdd right now. My 2nd bit is 0.
I'm going for a x1 gain making the 3rd bit 1.
This last bit could be a problem, but I've changed it with no effect. It's the Output Power Down Control Bit. 1 = Output Power Down Control Bit. 0 = Output Buffer Disabled, Output is High Impedance. I have this bit set to 1.
So if I've done this right my configuration should be 1011. Did I format the Shiftout command right? Is there a better way to format the command?
As for the wiring:
pins 1 = Vdd = 5V
2 = NC = no connection
3 = CS = portc.6
4 = CLK = portc.3
5 = SDI = portc.5
6 = NC
7 = NC
8 = LDAC "If desired this input can be tied low to reduce the required connections from 4 to 3."(pg. 20) = GND
9 = SHDN This could also be a problem. "The device will remain in shutdown mode until the SHDN pin is brought high and a write command with SHDN = 1 is latched."(pg. 20) = 5V
10 = VoutB =
11 = VrefB = 5V
12 = AVss = GND
13 = VrefA = 5V
14 = VoutA =
If anyone needs more information I will be more than happy to provide. Is there some reason I can't use portc?
http://ww1.microchip.com/downloads/e...Doc/21897a.pdf
(link to datasheet)
Bookmarks