LTC2631-HM8 DAC does not work correctly in VSM

techguy2448

New Member
I can simulate i2c with the DS1307 in VSM just fine, but having an issue with the LTC2631-HM8 DAC.

I cannot get it to function at all. I read the data sheet a dozen times and nothing I try seems to help.

See attached BAS and DSN file.
 

Attachments

bruno.stpete

New Member
Hello, please find my code for the LTC2631-LZ10 version

'LTC2631 address
'(*===========*)
symbol LTC2631_address = %00100000

'LTC2631 commands
'(*=============*)
symbol LTC2631_wri = %00110000
symbol LTC2631_int = %01100000 'Internal reference (V = 4.096 volts)
symbol LTC2631_ext = %01110000
symbol LTC2631_off = %01000000

'LTC2631 value with internal voltage reference
'(*=========================================*)
' Vout = Vref*N/255 with Vref = 2.5V
symbol LTC2631_value = 204

call LTC2631_init
main:
call LTC2631_turnon
pause 2500
call LTC2631_turnoff
goto main

LTC2631_init:
'(*===========*)
i2cslave LTC2631_address,i2cslow,i2cbyte
writei2c (LTC2631_int)
return

LTC2631_turnon:
'(*==========*)
i2cslave LTC2631_address,i2cslow,i2cbyte
writei2c (LTC2631_wri,LTC2631_value,%11000000)
return

LTC2631_turnoff:
'(*===========*)
i2cslave LTC2631_address,i2cslow,i2cbyte
writei2c (LTC2631_off,%00000000,%00000000) 'turn off
return
 
Top