Hi Ken, > The actual 7-bit slave device address for the way you wired the MAX517 (with > pins AD1, AD0 grounded) is 0x2C. > But when the slave address is coerced into the 8-bit 'I2C_Address' because > of the R/W bit, it becomes 0x58. > So you did your homework well and came up with 0x58. :) Hahaha, thank for praising me. It my first time doing such project, really got alot of thing to learn. But programming C language really a challenge for myself. > Nicholas, I think your best course of action is to test the function return > code of the 'WriteI2C()' function like I mentioned in my last post. This > will provide you with some useful information. You should really test and > act upon the function return code in future code, but for now, just test the > return value to see what you get. Yup, sure. But i got to get my DAC working first. Now I got to double up my effort, deadline for the project in end april. Opppsss... But really enjoy doing it, so much thing to learn... > Nicholas, in your pinout you said 'Pin 8 - No connection' -- this is where > you want to feed your voltage reference. > Isn't this the pin you said yesterday you connected to a voltage divider? > I'm confused now. You definitely do not want that pin as a NO CONNECT since > that's you voltage reference input. You could tie that pin to Vdd for now. > Then if you sent 0x7F to the DAC (output byte) you would expect > approximately Vdd/2 on your DAC output pin. Oh, yup that the pin that will be conencted to the voltage divider. but today i did not connect anything to it. cos i just wanna to make sure that my DAC is working. Maybe tomorrow i will tied it to Vdd. > I'm about a day away from a Master I2C/SMBus Engine (MISE) release that > could validate your project I2C hardware in a few minutes. > The MISE utility give you interactive feedback on your I2C transactions so > that you'll know if the START condition worked, if the control byte was > ACKed by the slave, etc. Sure, i will want to have it too. See whether my I2C really working. I2C device really simplify the hardware connection. I love it. hahaha... > I'm assuming that the MAX517 does not have a half-buffered output (some DACs > like the TLC5620 do) -- just check the data sheet to make sure. Errr... I got to check it out. Thank Ken. I will try again tomorrow in my lab. Will feedback to you again. Nicholas ----- Original Message ----- From: "Ken Pergola" To: Sent: Friday, March 19, 2004 12:21 AM Subject: Re: [PIC]:I2C DAC test > Hi Nicholas, > > Nicholas you definitely want to initialize 'I2C_Address' otherwise your code > will not work: > > Try this: > > char I2C_Address = 0x58; > > Instead of: > char I2C_Address; > > > > The actual 7-bit slave device address for the way you wired the MAX517 (with > pins AD1, AD0 grounded) is 0x2C. > But when the slave address is coerced into the 8-bit 'I2C_Address' because > of the R/W bit, it becomes 0x58. > So you did your homework well and came up with 0x58. :) > > Nicholas, I think your best course of action is to test the function return > code of the 'WriteI2C()' function like I mentioned in my last post. This > will provide you with some useful information. You should really test and > act upon the function return code in future code, but for now, just test the > return value to see what you get. > > I've always written my own I2C routines in HI-TECH PICC, PICC-18, and > PICC-Lite. I have never used the Microchip C18 compiler. > You main goal is to see if your slave ACKs your control byte correctly -- I > would imagine that this status is reflected in 'WriteI2C()' funtion code > status. > > Nicholas, in your pinout you said 'Pin 8 - No connection' -- this is where > you want to feed your voltage reference. > Isn't this the pin you said yesterday you connected to a voltage divider? > I'm confused now. You definitely do not want that pin as a NO CONNECT since > that's you voltage reference input. You could tie that pin to Vdd for now. > Then if you sent 0x7F to the DAC (output byte) you would expect > approximately Vdd/2 on your DAC output pin. > > I'm about a day away from a Master I2C/SMBus Engine (MISE) release that > could validate your project I2C hardware in a few minutes. > The MISE utility give you interactive feedback on your I2C transactions so > that you'll know if the START condition worked, if the control byte was > ACKed by the slave, etc. > > > I'm assuming that the MAX517 does not have a half-buffered output (some DACs > like the TLC5620 do) -- just check the data sheet to make sure. > > > Make that change I mentioned above and please report back. > > Good luck. > > Ken Pergola > > -- > http://www.piclist.com hint: The list server can filter out subtopics > (like ads or off topics) for you. See http://www.piclist.com/#topics > -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics