Anyone used the MCP4725 or TLC5615 DAC?

Pongo

Senior Member
I found one very old thread that's hard to follow without the images, and a couple of mentions of the MCP4725P Digital to Analog converter, but no recent posts. Has anyone made this chip work, hopefully with a 20X2?

Failing that does anyone have code for the TLC5615?
 

inglewoodpete

Senior Member
I've used the TLC5620. Let me know if that is similar enough to the 5615 for the code to be of use. If it is, I'll see if I can dig out the code.
 

Pongo

Senior Member
I've used the TLC5620. Let me know if that is similar enough to the 5615 for the code to be of use. If it is, I'll see if I can dig out the code.
Looks like the TLC5620 interface is simpler, or maybe the datasheet is just better lol. Thanks for the offer, but let's see what else shows up before you initiate a search.
 

Pongo

Senior Member
Too easy :D Found a TLC5615 in my odd chips box, and it's happy taking 12 bits, spiout:

Code:
SPIOUT SCK,SDT,1,(b41/8,b40/4)
Haven't tried hspiout yet but that should work too.
 

Pongo

Senior Member
Phew! I finally got the MCP4725 working. The first device was bad which added to my confusion but now I have a good one and was able to identify an error in the code in the old thread which was causing some strange results. So herewith simple code for this tiny, inexpensive, 12 bit D/A chip:

Code:
#picaxe 20x2
#Terminal 9600
#No_Table
#No_Data

hi2csetup i2cmaster, %11000000, i2cfast, i2cbyte 'default chip address

hi2cout (%00000101) 'startup and pass the value stored in the eeprom to the DAC.
'note: don't use the General Call Address as suggested previously, hi2cout is sending the 
'device address so "%00000000,(%00000110)" changes the DAC output voltage.
'if you want the output at startup to be zero or other defined voltage store that value in the 
'eeprom

main:

for w1 = 0 to 4095
w2 = w1<<4
hi2cout (%01000000,b5,b4) 'sets DAC output voltage without storing in eeprom
'hi2cout (%01100000,b5,b4) 'sets DAC output voltage and stores in eeprom
next w1 

for w1 = 4095 to 0 step -1
w2 = w1<<4
hi2cout (%01000000,b5,b4)
next w1 
goto main

theend:
 
Last edited:
Top