Having troubles trying to get the dac to generate an output voltage with the schematic and code as posted.
The address code for the MCP4725 is 11000000 from the data sheet
Basically just trying to take the adc reading from c.4
write the value to eeprom location 0
generate the analog value from the dac
With the code as written the output of the dac sits at half the supply voltage even if not connected to the 08M2.
Apparently I do not have the hi2csetup command correctly and/or the code is not correct.
I searched the archives and found only one thread with some code but honestly having difficulty understanding this whole hi2c system.
Any suggestions please.
Steve G
[/CODE]
The address code for the MCP4725 is 11000000 from the data sheet
Basically just trying to take the adc reading from c.4
write the value to eeprom location 0
generate the analog value from the dac
With the code as written the output of the dac sits at half the supply voltage even if not connected to the 08M2.
Apparently I do not have the hi2csetup command correctly and/or the code is not correct.
I searched the archives and found only one thread with some code but honestly having difficulty understanding this whole hi2c system.
Any suggestions please.
Steve G
Code:
[code] [COLOR=Blue]hi2csetup i2cmaster[/COLOR][COLOR=Black], [/COLOR][COLOR=Navy]%11000000[/COLOR][COLOR=Black], [/COLOR][COLOR=Blue]i2cslow[/COLOR][COLOR=Black], [/COLOR][COLOR=Blue]i2cbyte
[/COLOR][COLOR=Black]main: [/COLOR][COLOR=Blue]readadc [/COLOR][COLOR=Navy]4[/COLOR][COLOR=Black],[/COLOR][COLOR=Purple]b0
[/COLOR][COLOR=Blue]write [/COLOR][COLOR=Navy]0[/COLOR][COLOR=Black],[/COLOR][COLOR=Purple]b0
[/COLOR][COLOR=Blue] pause [/COLOR][COLOR=Navy]5[/COLOR][COLOR=Purple]
[/COLOR][COLOR=Blue]hi2cout [/COLOR][COLOR=Navy]0[/COLOR][COLOR=Black],[/COLOR][COLOR=Blue]([/COLOR][COLOR=Purple]b0[/COLOR][COLOR=Blue])
[/COLOR][COLOR=Navy] [/COLOR][COLOR=Blue]goto [/COLOR][COLOR=Black]main[/COLOR]
Attachments
Last edited: