simple DAC with DS2890 - done

KTarke

Senior Member
My project today was to make a working setup of DS2890 digital potentiometer ,with Picaxe.

Goals:
-To learn using ow-commands. (I am quite new with Picaxe, and manual is not much help with those commands...)
-I have seen quite many questions about a SIMPLE dac in the forum...

DS2890 can accept separate Vcc on the potentiometer side, at maximum 11V.
It makes it possible to make a simple 0-10V dac with resolution of 10/256= 0,04V (in theory anyway)

Testing:
DS2890 connected to inputpin C7 on Picaxe 28X1, chips Vcc from Picaxe (5V), external Vcc (10V) to resistor side from a separate regulator.
NOTE! If using a Picaxe project board, puldown resistors must be removed! And 4k7 pull-up added to the data line.



Here is a pic of DS2890 (soic) ,and a little adapter board I had made for prototyping soic's



Here's the commented code:
(NOTE, the DS2890 is alone in that pin, so 1-wire addressing is skipped in the code)

Code:
'DS2890 digital potentiometer test program by KTarke
'first inits the chip, then sets value to zero, then raises the resistor value from 0 to maximum

#picaxe 28X1
pause 500

main:

gosub Init

gosub SetWiperZero

for b1 = 0 to 255

	gosub IncrementWiper		'increment wiper position by 1 step

	serout 7,N2400,(254,1)
	serout 7,N2400,(#b1)
	pause 250

next b1

end


Init:

owout 7,%0001,($CC,$55,%01001100)	'send reset,skip rom -cmd,write control register -cmd,value
						        'charge pump MUST BE ON,wiper 1 selected
owin 7,%0000,(b4)				'read back sent value (read needed for right timing)
owout 7,%0000,($96)			        'send release code to update -cmd
owin 7,%0000,(b4)				'read, if update was successful (if 0 then ok,test if problems w/ program) 
						        '(read needed for right timing)
return


SetWiperZero:

owout 7,%0001,($CC,$0F,0)	        'send reset,skip rom -cmd,write position -cmd,value = 0
owin 7,%0000,(b4)			'read back send value (read needed for right timing)
owout 7,%0000,($96)		        'send release code to update -cmd
owin 7,%0000,(b4)			'read, if update was successful (if 0 then ok,test if problems W/ program) 
					        '(read needed for right timing)
return


IncrementWiper:

owout 7,%0001,($CC,$C3)		'send reset,skip rom -cmd,increment wiper -cmd
owin 7,%0000,(b4)			'read back send value (read needed for right timing)

return


'To write a wanted value to wiper:
'owout 7,%0001,($CC,$0F,value)
'owin 7,%0000,(b4)
Works nicely, but today I could not get a full 0-10V range output.
(applying ground and 10V to the RL and RH does not give out full 10V to the wiper, in theory it should...)
Have to look into it more.
 
Last edited:

MPep

Senior Member
Well done and thanks for letting us know. Suggest you post in the Finished Projects section for easy reference later.
 

KTarke

Senior Member
Well done and thanks for letting us know. Suggest you post in the Finished Projects section for easy reference later.
Case is open, until I either find out, how to get a voltage range from 0V to full 10V ,or don't find out... (give up and say, that op-amp has to be used on output):)

Then this can go to finished projects.

Edit: I give up now... see the following post.
 
Last edited:

KTarke

Senior Member
The project was educational and fun, but turned to be obsolete!
When, late at night, was searching more data about resistor network, I found out, that Maxim has dropped this chip from pruduction!:mad:

I have on the shelf a few dozens various 1-wire chips from earlier projects, and it didn't even cross my mind to check further availability.

To replace DS2890, Maxim offers DS1840, but it has SERIAL interface.

I am determined to find a simple dac-solution for Picaxe, and will now start searching other suitable chips. Maybe have to go to the I2C-side.

Maxim has dropped other 1-wire products ,too.
All 1-wire switches have vanished (maybe their usage was marginal, anyway)

We are still lucky to have tempsensors,16 bit adc, and battery monitors on the 1-wire list.

The battery monitors can be used as adc:s, too... Earlier I have made a 1-wire adapter for K-type thermocouple with Ds2760. The chip has inbuild thermometer, which can be used as temperature compensation.
Now there is available Ds2762, have to see, what are the differences...
 

westaust55

Moderator
Case is open, until I either find out, how to get a voltage range from 0V to full 10V ,or don't find out... (give up and say, that op-amp has to be used on output):)
If you look at figure 11 in the DS2980 datasheet, relating to Wiper Resistance and Wiper voltage, you will see that the digital pot wiper has some resistance (around 1 kOhm) and there is a voltage loss/drop across that resistance (of the order of 4 volts at 6V supply and a little unclear but likely a little less at 11V). Thus with an 11 V supply the max output at the wiper will be of the order of 11V - “say” 3.5V = 7.5V.

So while component obsolescence has forced you to abandon the project,, at least you know why the 11V is not available at the digital pot wiper terminal.
 

KTarke

Senior Member
If you look at figure 11 in the DS2980 datasheet, relating to Wiper Resistance and Wiper voltage, you will see that the digital pot wiper has some resistance (around 1 kOhm) and there is a voltage loss/drop across that resistance (of the order of 4 volts at 6V supply and a little unclear but likely a little less at 11V). Thus with an 11 V supply the max output at the wiper will be of the order of 11V - “say” 3.5V = 7.5V.

So while component obsolescence has forced you to abandon the project,, at least you know why the 11V is not available at the digital pot wiper terminal.
Thanks! That cleared the thing.
In Maxim's papers that was not so clearly shown, AND in their application note, DS2890 had been used to control a 0 to 10V light dimming ballast.
In that case, however, the voltage seemed to come from the ballast...
and maybe rail-to-rail -values were not needed.
 

KTarke

Senior Member
For some information on my past work with SPI and i2c DACs and Digital Pots you can have a look at these threads:

For some SPI and i2c DAC’s see:
http://www.picaxeforum.co.uk/showthread.php?t=14686

For some SPI Dig Pots see:
http://www.picaxeforum.co.uk/showthread.php?t=14087
I had a quick look at the links, and saw that there is what is needed...
So, I should not try to "re-invent the wheel"...
Anyway, I found some alternatives, using pwm (NOT unreliable R-C solutions)
I will concentrate on them, and post some code soon.

Reasons:
-not to "compete",really:)
-I prefer: as few components, as possible
-HAVE to learn Picaxe-coding fast (and best way to that is to do experimenting...)
-still, usually needed w/ "industrial" solutions,is 0-10V output, and that matter was not fully covered in the links.
(For example: My future need is to control a heating-valve-turning-motor ,that is almost always controlled by a 0-10V -message. And the message MUST cover the whole area from 0 to 10V = rail-to-rail)
 
Top