Guest0527211403
Mechanical
Hello everyone,
I'm using a Microchip MCP4922 DAC (dual output, 12 bit, SPI communication) connected to a dsPIC 30F6010A. The two outputs of the DAC will feed back to two pins, Vref+ and Vref- on my dsPIC to set my voltage references for my sensor and allow me to "window" the dsPIC's ADC in on a certain range. I need to do this for a few sensors so I want to do it "on the fly", hence my use of a DAC over a static voltage divider.
I'm limited in the number of output pins that I have, so I opted to go for a DAC that communicates via SPI, in this case the MCP4922. Another reason for this choice was the fact that this is what I had on hand.
I've managed to set up SPI in the dsPIC, and I can write to and latch one of the DAC outputs (DAC B), but I cannot seem to latch the other (DAC A).
As far as I can tell, all the MCP4922 needs me to do is change my most significant bit (i.e. bit 15) from a 1 to a 0 to write to DAC A. When I do this, however, the output changes on DAC B but nothing happens to DAC A. That is: what I think I should be getting on DAC A ends up on DAC B (and no change to DAC A).
I've checked the SCK and SDO lines on the scope, and everything the dsPIC is sending seems to be correct. My /LDAC pin on the DAC is tied low, which should mean that the DAC should latch its outputs as soon as my /CS pin goes high, but unfortunately it's not working out.
So now I'm wondering if anyone's encountered something similar before, and if there is something that I could have missed in diagnosing this problem.
Thanks in advance.
I'm using a Microchip MCP4922 DAC (dual output, 12 bit, SPI communication) connected to a dsPIC 30F6010A. The two outputs of the DAC will feed back to two pins, Vref+ and Vref- on my dsPIC to set my voltage references for my sensor and allow me to "window" the dsPIC's ADC in on a certain range. I need to do this for a few sensors so I want to do it "on the fly", hence my use of a DAC over a static voltage divider.
I'm limited in the number of output pins that I have, so I opted to go for a DAC that communicates via SPI, in this case the MCP4922. Another reason for this choice was the fact that this is what I had on hand.
I've managed to set up SPI in the dsPIC, and I can write to and latch one of the DAC outputs (DAC B), but I cannot seem to latch the other (DAC A).
As far as I can tell, all the MCP4922 needs me to do is change my most significant bit (i.e. bit 15) from a 1 to a 0 to write to DAC A. When I do this, however, the output changes on DAC B but nothing happens to DAC A. That is: what I think I should be getting on DAC A ends up on DAC B (and no change to DAC A).
I've checked the SCK and SDO lines on the scope, and everything the dsPIC is sending seems to be correct. My /LDAC pin on the DAC is tied low, which should mean that the DAC should latch its outputs as soon as my /CS pin goes high, but unfortunately it's not working out.
So now I'm wondering if anyone's encountered something similar before, and if there is something that I could have missed in diagnosing this problem.
Thanks in advance.